Fix: Multiline npc messages

- Multiline npc messages with curly braces will now display correctly
- Curly braces are no longer shown in screen
- Removed some tabs  in spellsystem :S My bad ..

TODO: Hightlight text in screen area not only in console?
This commit is contained in:
Samuel
2012-10-09 20:34:39 +02:00
parent c0a3b083f6
commit 95e46dbbaf
4 changed files with 70 additions and 46 deletions

View File

@@ -38,39 +38,39 @@ function hide()
end
function updateProgressRect(progressRect, interval, init)
if init then
progressRect:setPercent(0)
else
progressRect:setPercent(progressRect:getPercent() + 4)
end
if progressRect:getPercent() < 100 then
removeEvent(progressRect.event)
progressRect.event = scheduleEvent(function() updateProgressRect(progressRect, interval) end, interval)
end
if init then
progressRect:setPercent(0)
else
progressRect:setPercent(progressRect:getPercent() + 4)
end
if progressRect:getPercent() < 100 then
removeEvent(progressRect.event)
progressRect.event = scheduleEvent(function() updateProgressRect(progressRect, interval) end, interval)
end
end
function onSpellCooldown(iconId, duration)
local spellName = SpelllistSettings[modules.game_spelllist.getSpelllistProfile()].spellIcons[iconId]
if not spellName then return end
local otcIconId = tonumber(SpellInfo[modules.game_spelllist.getSpelllistProfile()][spellName].icon)
if not otcIconId and SpellIcons[SpellInfo[modules.game_spelllist.getSpelllistProfile()][spellName].icon] then
otcIconId = SpellIcons[SpellInfo[modules.game_spelllist.getSpelllistProfile()][spellName].icon][1]
end
if not otcIconId then return end
local icon = cooldownPanel:getChildById(spellName)
if not icon then
icon = g_ui.createWidget('SpellIcon', spellCooldownPanel)
icon:setId(spellName)
icon:setImageSource('/game_cooldown/icons/' .. SpelllistSettings[modules.game_spelllist.getSpelllistProfile()].iconFile)
icon:setImageClip(modules.game_spelllist.getIconImageClip(otcIconId))
icon.event = scheduleEvent(function() icon:destroy() end, duration)
local progressRect = g_ui.createWidget('SpellProgressRect', icon)
updateProgressRect(progressRect, duration/25, true)
icon.event = scheduleEvent(function() icon:destroy() end, duration)
local progressRect = g_ui.createWidget('SpellProgressRect', icon)
updateProgressRect(progressRect, duration/25, true)
progressRect:setTooltip(spellName)
end
end
@@ -83,11 +83,11 @@ function onSpellGroupCooldown(groupId, duration)
if icon then
icon:setOn(true)
removeEvent(icon.event)
icon.event = scheduleEvent(function() icon:setOn(false) end, duration)
icon.event = scheduleEvent(function() icon:setOn(false) end, duration)
end
if progressRect then
removeEvent(progressRect.event)
updateProgressRect(progressRect, duration/25, true)
updateProgressRect(progressRect, duration/25, true)
end
end