mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 20:14:54 +02:00
Provide the option to suppress lua call in setText
This commit is contained in:
@@ -14,7 +14,8 @@ function init()
|
||||
onSpellGroupCooldown = onSpellGroupCooldown,
|
||||
onSpellCooldown = onSpellCooldown })
|
||||
|
||||
cooldownButton = modules.client_topmenu.addRightGameToggleButton('cooldownButton', tr('Cooldowns'), '/images/topbuttons/cooldowns', toggle)
|
||||
cooldownButton = modules.client_topmenu.addRightGameToggleButton('cooldownButton',
|
||||
tr('Cooldowns'), '/images/topbuttons/cooldowns', toggle)
|
||||
cooldownButton:setOn(true)
|
||||
cooldownButton:hide()
|
||||
|
||||
@@ -47,6 +48,7 @@ end
|
||||
function loadIcon(iconId)
|
||||
local spell, profile, spellName = Spells.getSpellByIcon(iconId)
|
||||
if not spellName then return end
|
||||
if not profile then return end
|
||||
|
||||
clientIconId = Spells.getClientId(spellName)
|
||||
if not clientIconId then return end
|
||||
@@ -57,8 +59,13 @@ function loadIcon(iconId)
|
||||
icon:setId(iconId)
|
||||
end
|
||||
|
||||
icon:setImageSource(SpelllistSettings[profile].iconFile)
|
||||
icon:setImageClip(Spells.getImageClip(clientIconId, profile))
|
||||
local spellSettings = SpelllistSettings[profile]
|
||||
if spellSettings then
|
||||
icon:setImageSource(spellSettings.iconFile)
|
||||
icon:setImageClip(Spells.getImageClip(clientIconId, profile))
|
||||
else
|
||||
icon = nil
|
||||
end
|
||||
return icon
|
||||
end
|
||||
|
||||
@@ -133,7 +140,10 @@ function updateCooldown(progressRect, duration)
|
||||
|
||||
if progressRect:getPercent() < 100 then
|
||||
removeEvent(progressRect.event)
|
||||
progressRect.event = scheduleEvent(function() progressRect.callback[ProgressCallback.update]() end, 100)
|
||||
|
||||
progressRect.event = scheduleEvent(function()
|
||||
progressRect.callback[ProgressCallback.update]()
|
||||
end, 100)
|
||||
else
|
||||
progressRect.callback[ProgressCallback.finish]()
|
||||
end
|
||||
|
Reference in New Issue
Block a user