Spell List: Small tweaks

Tweaks and formatting in spells.lua
This commit is contained in:
Samuel
2012-10-07 04:11:11 +02:00
parent eae002ea71
commit 261dd40b96
2 changed files with 14 additions and 8 deletions

View File

@@ -136,7 +136,8 @@ function init()
g_keyboard.bindKeyPress('Down', function() spellList:focusNextChild(KeyboardFocusReason) end, spelllistWindow)
g_keyboard.bindKeyPress('Up', function() spellList:focusPreviousChild(KeyboardFocusReason) end, spelllistWindow)
for index, spell in ipairs(spellDisplayOrder) do
for i = 1, #spellDisplayOrder do
local spell = spellDisplayOrder[i]
local info = SpellInfo[spell]
local tmpLabel = g_ui.createWidget('SpellListLabel', spellList)
tmpLabel:setId(spell)
@@ -164,6 +165,11 @@ function terminate()
disconnect(g_game, { onGameStart = setupOptions,
onGameEnd = resetWindow })
disconnect(spellList, { onChildFocusChange = function(self, focusedChild)
if focusedChild == nil then return end
updateSpellInformation(focusedChild)
end })
spelllistButton:destroy()
spelllistButton = nil
spelllistWindow:destroy()