Spell List: Small tweaks

Tweaks and formatting.
This commit is contained in:
Samuel 2012-10-07 04:17:45 +02:00
parent a83be17bfe
commit 8536c61c01
2 changed files with 18 additions and 10 deletions

View File

@ -136,7 +136,8 @@ function init()
g_keyboard.bindKeyPress('Down', function() spellList:focusNextChild(KeyboardFocusReason) end, spelllistWindow) g_keyboard.bindKeyPress('Down', function() spellList:focusNextChild(KeyboardFocusReason) end, spelllistWindow)
g_keyboard.bindKeyPress('Up', function() spellList:focusPreviousChild(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 info = SpellInfo[spell]
local tmpLabel = g_ui.createWidget('SpellListLabel', spellList) local tmpLabel = g_ui.createWidget('SpellListLabel', spellList)
tmpLabel:setId(spell) tmpLabel:setId(spell)
@ -164,6 +165,11 @@ function terminate()
disconnect(g_game, { onGameStart = setupOptions, disconnect(g_game, { onGameStart = setupOptions,
onGameEnd = resetWindow }) onGameEnd = resetWindow })
disconnect(spellList, { onChildFocusChange = function(self, focusedChild)
if focusedChild == nil then return end
updateSpellInformation(focusedChild)
end })
spelllistButton:destroy() spelllistButton:destroy()
spelllistButton = nil spelllistButton = nil
spelllistWindow:destroy() spelllistWindow:destroy()
@ -204,7 +210,8 @@ function terminate()
end end
function updateSpelllist() function updateSpelllist()
for index, spell in ipairs(spellDisplayOrder) do for i = 1, #spellDisplayOrder do
local spell = spellDisplayOrder[i]
local info = SpellInfo[spell] local info = SpellInfo[spell]
local tmpLabel = spellList:getChildById(spell) local tmpLabel = spellList:getChildById(spell)
@ -236,7 +243,8 @@ function updateSpellInformation(widget)
name = spell name = spell
formula = info.words formula = info.words
for _, vocationId in ipairs(info.vocations) do for i = 1, #info.vocations do
local vocationId = info.vocations[i]
if vocationId <= 4 or not(table.find(info.vocations, (vocationId-4))) then if vocationId <= 4 or not(table.find(info.vocations, (vocationId-4))) then
vocation = vocation .. (vocation:len() == 0 and '' or ', ') .. VocationNames[vocationId] vocation = vocation .. (vocation:len() == 0 and '' or ', ') .. VocationNames[vocationId]
end end

View File

@ -77,11 +77,11 @@ SpellInfo = {
['Sharpshooter'] = {words = 'utito tempo san', exhaustion = 2000, premium = true, type = 'Instant', icon = 'sharpshooter', mana = 450, level = 60, soul = 0, group = {[2] = 10000, [3] = 10000}, vocations = {3, 7}}, ['Sharpshooter'] = {words = 'utito tempo san', exhaustion = 2000, premium = true, type = 'Instant', icon = 'sharpshooter', mana = 450, level = 60, soul = 0, group = {[2] = 10000, [3] = 10000}, vocations = {3, 7}},
['Protector'] = {words = 'utamo tempo', exhaustion = 2000, premium = true, type = 'Instant', icon = 'protector', mana = 200, level = 55, soul = 0, group = {[1] = 10000, [3] = 2000}, vocations = {4, 8}}, ['Protector'] = {words = 'utamo tempo', exhaustion = 2000, premium = true, type = 'Instant', icon = 'protector', mana = 200, level = 55, soul = 0, group = {[1] = 10000, [3] = 2000}, vocations = {4, 8}},
['Blood Rage'] = {words = 'utito tempo', exhaustion = 2000, premium = true, type = 'Instant', icon = 'bloodrage', mana = 290, level = 60, soul = 0, group = {[3] = 2000}, vocations = {4, 8}}, ['Blood Rage'] = {words = 'utito tempo', exhaustion = 2000, premium = true, type = 'Instant', icon = 'bloodrage', mana = 290, level = 60, soul = 0, group = {[3] = 2000}, vocations = {4, 8}},
['Train Party'] = {words = 'utito mas sio', exhaustion = 2000, premium = true, type = 'Instant', icon = 'trainparty', mana = -1, level = 32, soul = 0, group = {[3] = 2000}, vocations = {8}}, ['Train Party'] = {words = 'utito mas sio', exhaustion = 2000, premium = true, type = 'Instant', icon = 'trainparty', mana = 'Var.', level = 32, soul = 0, group = {[3] = 2000}, vocations = {8}},
['Protect Party'] = {words = 'utamo mas sio', exhaustion = 2000, premium = true, type = 'Instant', icon = 'protectparty', mana = -1, level = 32, soul = 0, group = {[3] = 2000}, vocations = {7}}, ['Protect Party'] = {words = 'utamo mas sio', exhaustion = 2000, premium = true, type = 'Instant', icon = 'protectparty', mana = 'Var.', evel = 32, soul = 0, group = {[3] = 2000}, vocations = {7}},
['Heal Party'] = {words = 'utura mas sio', exhaustion = 2000, premium = true, type = 'Instant', icon = 'healparty', mana = -1, level = 32, soul = 0, group = {[3] = 2000}, vocations = {6}}, ['Heal Party'] = {words = 'utura mas sio', exhaustion = 2000, premium = true, type = 'Instant', icon = 'healparty', mana = 'Var.', level = 32, soul = 0, group = {[3] = 2000}, vocations = {6}},
['Enchant Party'] = {words = 'utori mas sio', exhaustion = 2000, premium = true, type = 'Instant', icon = 'enchantparty', mana = -1, level = 32, soul = 0, group = {[3] = 2000}, vocations = {5}}, ['Enchant Party'] = {words = 'utori mas sio', exhaustion = 2000, premium = true, type = 'Instant', icon = 'enchantparty', mana = 'Var.', level = 32, soul = 0, group = {[3] = 2000}, vocations = {5}},
['Summon Creature'] = {words = 'utevo res', exhaustion = 2000, premium = false, type = 'Instant', icon = 'summoncreature', mana = -1, level = 25, soul = 0, group = {[3] = 2000}, vocations = {1, 2, 5, 6}}, ['Summon Creature'] = {words = 'utevo res', exhaustion = 2000, premium = false, type = 'Instant', icon = 'summoncreature', mana = 'Var.', level = 25, soul = 0, group = {[3] = 2000}, vocations = {1, 2, 5, 6}},
['Conjure Arrow'] = {words = 'exevo con', exhaustion = 2000, premium = false, type = 'Conjure', icon = 'conjurearrow', mana = 100, level = 13, soul = 1, group = {[3] = 2000}, vocations = {3, 7}}, ['Conjure Arrow'] = {words = 'exevo con', exhaustion = 2000, premium = false, type = 'Conjure', icon = 'conjurearrow', mana = 100, level = 13, soul = 1, group = {[3] = 2000}, vocations = {3, 7}},
['Food'] = {words = 'exevo pan', exhaustion = 2000, premium = false, type = 'Instant', icon = 'food', mana = 120, level = 14, soul = 1, group = {[3] = 2000}, vocations = {2, 6}}, ['Food'] = {words = 'exevo pan', exhaustion = 2000, premium = false, type = 'Instant', icon = 'food', mana = 120, level = 14, soul = 1, group = {[3] = 2000}, vocations = {2, 6}},
['Conjure Poisoned Arrow'] = {words = 'exevo con pox', exhaustion = 2000, premium = false, type = 'Conjure', icon = 'poisonedarrow', mana = 130, level = 16, soul = 2, group = {[3] = 2000}, vocations = {3, 7}}, ['Conjure Poisoned Arrow'] = {words = 'exevo con pox', exhaustion = 2000, premium = false, type = 'Conjure', icon = 'poisonedarrow', mana = 130, level = 16, soul = 2, group = {[3] = 2000}, vocations = {3, 7}},