mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 03:54:54 +02:00
Some minor changes/additions.
This commit is contained in:
@@ -9,6 +9,9 @@ contentsPanel = nil
|
||||
cooldownPanel = nil
|
||||
lastPlayer = nil
|
||||
|
||||
cooldown = {}
|
||||
groupCooldown = {}
|
||||
|
||||
function init()
|
||||
connect(g_game, { onGameStart = online,
|
||||
onSpellGroupCooldown = onSpellGroupCooldown,
|
||||
@@ -149,6 +152,14 @@ function updateCooldown(progressRect, duration)
|
||||
end
|
||||
end
|
||||
|
||||
function isGroupCooldownIconActive(groupId)
|
||||
return groupCooldown[groupId]
|
||||
end
|
||||
|
||||
function isCooldownIconActive(iconId)
|
||||
return cooldown[iconId]
|
||||
end
|
||||
|
||||
function onSpellCooldown(iconId, duration)
|
||||
local icon = loadIcon(iconId)
|
||||
if not icon then
|
||||
@@ -172,8 +183,10 @@ function onSpellCooldown(iconId, duration)
|
||||
end
|
||||
local finishFunc = function()
|
||||
removeCooldown(progressRect)
|
||||
cooldown[iconId] = false
|
||||
end
|
||||
initCooldown(progressRect, updateFunc, finishFunc)
|
||||
cooldown[iconId] = true
|
||||
end
|
||||
|
||||
function onSpellGroupCooldown(groupId, duration)
|
||||
@@ -194,7 +207,9 @@ function onSpellGroupCooldown(groupId, duration)
|
||||
end
|
||||
local finishFunc = function()
|
||||
turnOffCooldown(progressRect)
|
||||
groupCooldown[groupId] = false
|
||||
end
|
||||
initCooldown(progressRect, updateFunc, finishFunc)
|
||||
groupCooldown[groupId] = true
|
||||
end
|
||||
end
|
||||
|
@@ -357,7 +357,7 @@ function onUseWith(clickedWidget, mousePosition)
|
||||
if clickedWidget:getClassName() == 'UIGameMap' then
|
||||
local tile = clickedWidget:getTile(mousePosition)
|
||||
if tile then
|
||||
if selectedThing:isFluidContainer() then
|
||||
if selectedThing:isFluidContainer() or selectedThing:isMultiUse() then
|
||||
g_game.useWith(selectedThing, tile:getTopMultiUseThing())
|
||||
else
|
||||
g_game.useWith(selectedThing, tile:getTopUseThing())
|
||||
@@ -590,7 +590,8 @@ function createThingMenu(menuPosition, lookThing, useThing, creatureThing)
|
||||
menu:addSeparator()
|
||||
for name,opt in pairs(category) do
|
||||
if opt and opt.condition(menuPosition, lookThing, useThing, creatureThing) then
|
||||
menu:addOption(name, opt.callback, opt.shortcut)
|
||||
menu:addOption(name, function() opt.callback(menuPosition,
|
||||
lookThing, useThing, creatureThing) end, opt.shortcut)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -677,6 +678,7 @@ function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, u
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local player = g_game.getLocalPlayer()
|
||||
player:stopAutoWalk()
|
||||
|
||||
|
Reference in New Issue
Block a user