2012-10-08 06:51:25 +02:00
|
|
|
local SpelllistProfile = 'Default'
|
|
|
|
|
|
|
|
spelllistWindow = nil
|
|
|
|
spelllistButton = nil
|
|
|
|
spellList = nil
|
|
|
|
nameValueLabel = nil
|
|
|
|
formulaValueLabel = nil
|
|
|
|
vocationValueLabel = nil
|
|
|
|
groupValueLabel = nil
|
|
|
|
typeValueLabel = nil
|
|
|
|
cooldownValueLabel = nil
|
|
|
|
levelValueLabel = nil
|
|
|
|
manaValueLabel = nil
|
|
|
|
premiumValueLabel = nil
|
|
|
|
descriptionValueLabel = nil
|
|
|
|
|
|
|
|
vocationBoxAny = nil
|
|
|
|
vocationBoxSorcerer = nil
|
|
|
|
vocationBoxDruid = nil
|
|
|
|
vocationBoxPaladin = nil
|
|
|
|
vocationBoxKnight = nil
|
|
|
|
|
|
|
|
groupBoxAny = nil
|
|
|
|
groupBoxAttack = nil
|
|
|
|
groupBoxHealing = nil
|
|
|
|
groupBoxSupport = nil
|
|
|
|
|
|
|
|
premiumBoxAny = nil
|
|
|
|
premiumBoxNo = nil
|
|
|
|
premiumBoxYes = nil
|
|
|
|
|
|
|
|
vocationRadioGroup = nil
|
|
|
|
groupRadioGroup = nil
|
|
|
|
premiumRadioGroup = nil
|
2012-10-07 03:24:06 +02:00
|
|
|
|
|
|
|
-- consts
|
|
|
|
FILTER_PREMIUM_ANY = 0
|
|
|
|
FILTER_PREMIUM_NO = 1
|
|
|
|
FILTER_PREMIUM_YES = 2
|
|
|
|
|
|
|
|
FILTER_VOCATION_ANY = 0
|
|
|
|
FILTER_VOCATION_SORCERER = 1
|
|
|
|
FILTER_VOCATION_DRUID = 2
|
|
|
|
FILTER_VOCATION_PALADIN = 3
|
|
|
|
FILTER_VOCATION_KNIGHT = 4
|
|
|
|
|
|
|
|
FILTER_GROUP_ANY = 0
|
|
|
|
FILTER_GROUP_ATTACK = 1
|
|
|
|
FILTER_GROUP_HEALING = 2
|
|
|
|
FILTER_GROUP_SUPPORT = 3
|
|
|
|
|
|
|
|
-- Filter Settings
|
|
|
|
local filters = {
|
|
|
|
level = false,
|
|
|
|
vocation = false,
|
2014-01-18 15:09:26 +01:00
|
|
|
|
|
|
|
vocationId = FILTER_VOCATION_ANY,
|
2012-10-07 03:24:06 +02:00
|
|
|
premium = FILTER_PREMIUM_ANY,
|
|
|
|
groupId = FILTER_GROUP_ANY
|
|
|
|
}
|
|
|
|
|
2012-10-09 02:46:23 +02:00
|
|
|
function getSpelllistProfile()
|
|
|
|
return SpelllistProfile
|
|
|
|
end
|
|
|
|
|
2012-10-08 06:51:25 +02:00
|
|
|
function setSpelllistProfile(name)
|
|
|
|
if SpelllistProfile == name then return end
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-08 06:51:25 +02:00
|
|
|
if SpelllistSettings[name] and SpellInfo[name] then
|
|
|
|
local oldProfile = SpelllistProfile
|
|
|
|
SpelllistProfile = name
|
|
|
|
changeSpelllistProfile(oldProfile)
|
|
|
|
else
|
|
|
|
perror('Spelllist profile \'' .. name .. '\' could not be set.')
|
|
|
|
end
|
|
|
|
end
|
2012-10-07 03:24:06 +02:00
|
|
|
|
2013-01-26 17:38:48 +01:00
|
|
|
function online()
|
2013-01-26 21:40:03 +01:00
|
|
|
if g_game.getFeature(GameSpellList) then
|
|
|
|
spelllistButton:show()
|
2013-01-26 17:38:48 +01:00
|
|
|
else
|
2013-01-26 21:40:03 +01:00
|
|
|
spelllistButton:hide()
|
2013-01-26 17:38:48 +01:00
|
|
|
end
|
2012-12-28 12:05:45 +01:00
|
|
|
if g_game.getProtocolVersion() >= 950 then -- Vocation is only send in newer clients
|
2012-10-07 03:24:06 +02:00
|
|
|
spelllistWindow:getChildById('buttonFilterVocation'):setVisible(true)
|
|
|
|
else
|
|
|
|
spelllistWindow:getChildById('buttonFilterVocation'):setVisible(false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-01-26 17:38:48 +01:00
|
|
|
function offline()
|
|
|
|
resetWindow()
|
|
|
|
end
|
2013-01-24 17:01:28 +01:00
|
|
|
|
2013-01-26 17:38:48 +01:00
|
|
|
function init()
|
|
|
|
connect(g_game, { onGameStart = online,
|
|
|
|
onGameEnd = offline })
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2013-01-18 23:39:11 +01:00
|
|
|
spelllistWindow = g_ui.displayUI('spelllist', modules.game_interface.getRightPanel())
|
2012-10-07 03:24:06 +02:00
|
|
|
spelllistWindow:hide()
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2013-01-18 23:39:11 +01:00
|
|
|
spelllistButton = modules.client_topmenu.addRightGameToggleButton('spelllistButton', tr('Spell List'), '/images/topbuttons/spelllist', toggle)
|
2012-10-07 03:24:06 +02:00
|
|
|
spelllistButton:setOn(false)
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
nameValueLabel = spelllistWindow:getChildById('labelNameValue')
|
|
|
|
formulaValueLabel = spelllistWindow:getChildById('labelFormulaValue')
|
|
|
|
vocationValueLabel = spelllistWindow:getChildById('labelVocationValue')
|
|
|
|
groupValueLabel = spelllistWindow:getChildById('labelGroupValue')
|
|
|
|
typeValueLabel = spelllistWindow:getChildById('labelTypeValue')
|
|
|
|
cooldownValueLabel = spelllistWindow:getChildById('labelCooldownValue')
|
|
|
|
levelValueLabel = spelllistWindow:getChildById('labelLevelValue')
|
|
|
|
manaValueLabel = spelllistWindow:getChildById('labelManaValue')
|
|
|
|
premiumValueLabel = spelllistWindow:getChildById('labelPremiumValue')
|
2012-10-08 06:51:25 +02:00
|
|
|
descriptionValueLabel = spelllistWindow:getChildById('labelDescriptionValue')
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
vocationBoxAny = spelllistWindow:getChildById('vocationBoxAny')
|
|
|
|
vocationBoxSorcerer = spelllistWindow:getChildById('vocationBoxSorcerer')
|
|
|
|
vocationBoxDruid = spelllistWindow:getChildById('vocationBoxDruid')
|
|
|
|
vocationBoxPaladin = spelllistWindow:getChildById('vocationBoxPaladin')
|
|
|
|
vocationBoxKnight = spelllistWindow:getChildById('vocationBoxKnight')
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
groupBoxAny = spelllistWindow:getChildById('groupBoxAny')
|
|
|
|
groupBoxAttack = spelllistWindow:getChildById('groupBoxAttack')
|
|
|
|
groupBoxHealing = spelllistWindow:getChildById('groupBoxHealing')
|
|
|
|
groupBoxSupport = spelllistWindow:getChildById('groupBoxSupport')
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
premiumBoxAny = spelllistWindow:getChildById('premiumBoxAny')
|
|
|
|
premiumBoxYes = spelllistWindow:getChildById('premiumBoxYes')
|
|
|
|
premiumBoxNo = spelllistWindow:getChildById('premiumBoxNo')
|
|
|
|
|
|
|
|
vocationRadioGroup = UIRadioGroup.create()
|
|
|
|
vocationRadioGroup:addWidget(vocationBoxAny)
|
|
|
|
vocationRadioGroup:addWidget(vocationBoxSorcerer)
|
|
|
|
vocationRadioGroup:addWidget(vocationBoxDruid)
|
|
|
|
vocationRadioGroup:addWidget(vocationBoxPaladin)
|
|
|
|
vocationRadioGroup:addWidget(vocationBoxKnight)
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
groupRadioGroup = UIRadioGroup.create()
|
|
|
|
groupRadioGroup:addWidget(groupBoxAny)
|
|
|
|
groupRadioGroup:addWidget(groupBoxAttack)
|
|
|
|
groupRadioGroup:addWidget(groupBoxHealing)
|
|
|
|
groupRadioGroup:addWidget(groupBoxSupport)
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
premiumRadioGroup = UIRadioGroup.create()
|
|
|
|
premiumRadioGroup:addWidget(premiumBoxAny)
|
|
|
|
premiumRadioGroup:addWidget(premiumBoxYes)
|
|
|
|
premiumRadioGroup:addWidget(premiumBoxNo)
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
premiumRadioGroup:selectWidget(premiumBoxAny)
|
|
|
|
vocationRadioGroup:selectWidget(vocationBoxAny)
|
|
|
|
groupRadioGroup:selectWidget(groupBoxAny)
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
vocationRadioGroup.onSelectionChange = toggleFilter
|
|
|
|
groupRadioGroup.onSelectionChange = toggleFilter
|
|
|
|
premiumRadioGroup.onSelectionChange = toggleFilter
|
2014-01-18 15:09:26 +01:00
|
|
|
|
|
|
|
spellList = spelllistWindow:getChildById('spellList')
|
2012-10-07 03:24:06 +02:00
|
|
|
|
|
|
|
g_keyboard.bindKeyPress('Down', function() spellList:focusNextChild(KeyboardFocusReason) end, spelllistWindow)
|
|
|
|
g_keyboard.bindKeyPress('Up', function() spellList:focusPreviousChild(KeyboardFocusReason) end, spelllistWindow)
|
2014-01-18 15:09:26 +01:00
|
|
|
|
|
|
|
initialiseSpelllist()
|
2012-10-08 06:51:25 +02:00
|
|
|
resizeWindow()
|
2013-02-19 02:18:10 +01:00
|
|
|
|
|
|
|
if g_game.isOnline() then
|
|
|
|
online()
|
|
|
|
end
|
2012-10-07 03:24:06 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function terminate()
|
2013-01-26 17:38:48 +01:00
|
|
|
disconnect(g_game, { onGameStart = online,
|
|
|
|
onGameEnd = offline })
|
2012-10-07 03:24:06 +02:00
|
|
|
|
2012-10-07 04:17:45 +02:00
|
|
|
disconnect(spellList, { onChildFocusChange = function(self, focusedChild)
|
|
|
|
if focusedChild == nil then return end
|
|
|
|
updateSpellInformation(focusedChild)
|
2014-01-18 15:09:26 +01:00
|
|
|
end })
|
2012-10-07 04:17:45 +02:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
spelllistWindow:destroy()
|
2013-02-01 05:32:15 +01:00
|
|
|
spelllistButton:destroy()
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
vocationRadioGroup:destroy()
|
|
|
|
groupRadioGroup:destroy()
|
|
|
|
premiumRadioGroup:destroy()
|
2012-10-08 06:51:25 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function initialiseSpelllist()
|
|
|
|
for i = 1, #SpelllistSettings[SpelllistProfile].spellOrder do
|
|
|
|
local spell = SpelllistSettings[SpelllistProfile].spellOrder[i]
|
|
|
|
local info = SpellInfo[SpelllistProfile][spell]
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-08 06:51:25 +02:00
|
|
|
local tmpLabel = g_ui.createWidget('SpellListLabel', spellList)
|
|
|
|
tmpLabel:setId(spell)
|
|
|
|
tmpLabel:setText(spell .. '\n\'' .. info.words .. '\'')
|
|
|
|
tmpLabel:setPhantom(false)
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-08 06:51:25 +02:00
|
|
|
local iconId = tonumber(info.icon)
|
2012-10-09 20:34:39 +02:00
|
|
|
if not iconId and SpellIcons[info.icon] then
|
2012-10-08 06:51:25 +02:00
|
|
|
iconId = SpellIcons[info.icon][1]
|
|
|
|
end
|
|
|
|
|
|
|
|
if not(iconId) then
|
2014-01-18 15:09:26 +01:00
|
|
|
perror('Spell icon \'' .. info.icon .. '\' not found.')
|
2012-10-09 20:34:39 +02:00
|
|
|
end
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-09 20:34:39 +02:00
|
|
|
tmpLabel:setHeight(SpelllistSettings[SpelllistProfile].iconSize.height + 4)
|
|
|
|
tmpLabel:setTextOffset(topoint((SpelllistSettings[SpelllistProfile].iconSize.width + 10) .. ' ' .. (SpelllistSettings[SpelllistProfile].iconSize.height - 32)/2 + 3))
|
2013-02-23 07:23:18 +01:00
|
|
|
tmpLabel:setImageSource(SpelllistSettings[SpelllistProfile].iconFile)
|
2013-01-29 07:26:32 +01:00
|
|
|
tmpLabel:setImageClip(Spells.getImageClip(iconId, SpelllistProfile))
|
2012-10-09 20:34:39 +02:00
|
|
|
tmpLabel:setImageSize(tosize(SpelllistSettings[SpelllistProfile].iconSize.width .. ' ' .. SpelllistSettings[SpelllistProfile].iconSize.height))
|
2012-10-08 06:51:25 +02:00
|
|
|
tmpLabel.onClick = updateSpellInformation
|
|
|
|
end
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-08 06:51:25 +02:00
|
|
|
connect(spellList, { onChildFocusChange = function(self, focusedChild)
|
|
|
|
if focusedChild == nil then return end
|
|
|
|
updateSpellInformation(focusedChild)
|
2014-01-18 15:09:26 +01:00
|
|
|
end })
|
2012-10-08 06:51:25 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function changeSpelllistProfile(oldProfile)
|
|
|
|
-- Delete old labels
|
|
|
|
for i = 1, #SpelllistSettings[oldProfile].spellOrder do
|
|
|
|
local spell = SpelllistSettings[oldProfile].spellOrder[i]
|
|
|
|
local tmpLabel = spellList:getChildById(spell)
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-08 06:51:25 +02:00
|
|
|
tmpLabel:destroy()
|
|
|
|
end
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-08 06:51:25 +02:00
|
|
|
-- Create new spelllist and ajust window
|
|
|
|
initialiseSpelllist()
|
|
|
|
setOptions()
|
|
|
|
resizeWindow()
|
|
|
|
resetWindow()
|
2012-10-07 03:24:06 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function updateSpelllist()
|
2012-10-08 06:51:25 +02:00
|
|
|
for i = 1, #SpelllistSettings[SpelllistProfile].spellOrder do
|
|
|
|
local spell = SpelllistSettings[SpelllistProfile].spellOrder[i]
|
|
|
|
local info = SpellInfo[SpelllistProfile][spell]
|
2012-10-07 03:24:06 +02:00
|
|
|
local tmpLabel = spellList:getChildById(spell)
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
local localPlayer = g_game.getLocalPlayer()
|
|
|
|
if (not(filters.level) or info.level <= localPlayer:getLevel()) and (not(filters.vocation) or table.find(info.vocations, localPlayer:getVocation())) and (filters.vocationId == FILTER_VOCATION_ANY or table.find(info.vocations, filters.vocationId) or table.find(info.vocations, filters.vocationId+4)) and (filters.groupId == FILTER_GROUP_ANY or info.group[filters.groupId]) and (filters.premium == FILTER_PREMIUM_ANY or (info.premium and filters.premium == FILTER_PREMIUM_YES) or (not(info.premium) and filters.premium == FILTER_PREMIUM_NO)) then
|
|
|
|
tmpLabel:setVisible(true)
|
|
|
|
else
|
|
|
|
tmpLabel:setVisible(false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function updateSpellInformation(widget)
|
|
|
|
local spell = widget:getId()
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-08 06:51:25 +02:00
|
|
|
local name = ''
|
|
|
|
local formula = ''
|
|
|
|
local vocation = ''
|
|
|
|
local group = ''
|
|
|
|
local type = ''
|
|
|
|
local cooldown = ''
|
|
|
|
local level = ''
|
|
|
|
local mana = ''
|
|
|
|
local premium = ''
|
|
|
|
local description = ''
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-08 06:51:25 +02:00
|
|
|
if SpellInfo[SpelllistProfile][spell] then
|
|
|
|
local info = SpellInfo[SpelllistProfile][spell]
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
name = spell
|
|
|
|
formula = info.words
|
|
|
|
|
2012-10-07 04:17:45 +02:00
|
|
|
for i = 1, #info.vocations do
|
|
|
|
local vocationId = info.vocations[i]
|
2012-10-07 03:24:06 +02:00
|
|
|
if vocationId <= 4 or not(table.find(info.vocations, (vocationId-4))) then
|
|
|
|
vocation = vocation .. (vocation:len() == 0 and '' or ', ') .. VocationNames[vocationId]
|
|
|
|
end
|
|
|
|
end
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
cooldown = (info.exhaustion / 1000) .. 's'
|
|
|
|
for groupId, groupName in ipairs(SpellGroups) do
|
|
|
|
if info.group[groupId] then
|
|
|
|
group = group .. (group:len() == 0 and '' or ' / ') .. groupName
|
|
|
|
cooldown = cooldown .. ' / ' .. (info.group[groupId] / 1000) .. 's'
|
|
|
|
end
|
|
|
|
end
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
type = info.type
|
|
|
|
level = info.level
|
|
|
|
mana = info.mana .. ' / ' .. info.soul
|
|
|
|
premium = (info.premium and 'yes' or 'no')
|
2012-10-09 20:34:39 +02:00
|
|
|
description = info.description or '-'
|
2012-10-07 03:24:06 +02:00
|
|
|
end
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
nameValueLabel:setText(name)
|
|
|
|
formulaValueLabel:setText(formula)
|
|
|
|
vocationValueLabel:setText(vocation)
|
|
|
|
groupValueLabel:setText(group)
|
|
|
|
typeValueLabel:setText(type)
|
|
|
|
cooldownValueLabel:setText(cooldown)
|
|
|
|
levelValueLabel:setText(level)
|
|
|
|
manaValueLabel:setText(mana)
|
|
|
|
premiumValueLabel:setText(premium)
|
2012-10-08 06:51:25 +02:00
|
|
|
descriptionValueLabel:setText(description)
|
2012-10-07 03:24:06 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function toggle()
|
|
|
|
if spelllistButton:isOn() then
|
|
|
|
spelllistWindow:hide()
|
|
|
|
spelllistButton:setOn(false)
|
|
|
|
else
|
|
|
|
spelllistWindow:show()
|
|
|
|
spelllistButton:setOn(true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function toggleFilter(widget, selectedWidget)
|
|
|
|
if widget == vocationRadioGroup then
|
|
|
|
local boxId = selectedWidget:getId()
|
|
|
|
if boxId == 'vocationBoxAny' then
|
|
|
|
filters.vocationId = FILTER_VOCATION_ANY
|
|
|
|
elseif boxId == 'vocationBoxSorcerer' then
|
|
|
|
filters.vocationId = FILTER_VOCATION_SORCERER
|
|
|
|
elseif boxId == 'vocationBoxDruid' then
|
|
|
|
filters.vocationId = FILTER_VOCATION_DRUID
|
|
|
|
elseif boxId == 'vocationBoxPaladin' then
|
|
|
|
filters.vocationId = FILTER_VOCATION_PALADIN
|
|
|
|
elseif boxId == 'vocationBoxKnight' then
|
|
|
|
filters.vocationId = FILTER_VOCATION_KNIGHT
|
|
|
|
end
|
|
|
|
elseif widget == groupRadioGroup then
|
|
|
|
local boxId = selectedWidget:getId()
|
|
|
|
if boxId == 'groupBoxAny' then
|
|
|
|
filters.groupId = FILTER_GROUP_ANY
|
|
|
|
elseif boxId == 'groupBoxAttack' then
|
|
|
|
filters.groupId = FILTER_GROUP_ATTACK
|
|
|
|
elseif boxId == 'groupBoxHealing' then
|
|
|
|
filters.groupId = FILTER_GROUP_HEALING
|
|
|
|
elseif boxId == 'groupBoxSupport' then
|
|
|
|
filters.groupId = FILTER_GROUP_SUPPORT
|
|
|
|
end
|
|
|
|
elseif widget == premiumRadioGroup then
|
|
|
|
local boxId = selectedWidget:getId()
|
|
|
|
if boxId == 'premiumBoxAny' then
|
|
|
|
filters.premium = FILTER_PREMIUM_ANY
|
|
|
|
elseif boxId == 'premiumBoxNo' then
|
|
|
|
filters.premium = FILTER_PREMIUM_NO
|
|
|
|
elseif boxId == 'premiumBoxYes' then
|
|
|
|
filters.premium = FILTER_PREMIUM_YES
|
|
|
|
end
|
|
|
|
else
|
|
|
|
local id = widget:getId()
|
|
|
|
if id == 'buttonFilterLevel' then
|
|
|
|
filters.level = not(filters.level)
|
|
|
|
widget:setOn(filters.level)
|
|
|
|
elseif id == 'buttonFilterVocation' then
|
|
|
|
filters.vocation = not(filters.vocation)
|
|
|
|
widget:setOn(filters.vocation)
|
|
|
|
end
|
|
|
|
end
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
updateSpelllist()
|
|
|
|
end
|
|
|
|
|
2012-10-08 06:51:25 +02:00
|
|
|
function resizeWindow()
|
|
|
|
spelllistWindow:setWidth(SpelllistSettings['Default'].spellWindowWidth + SpelllistSettings[SpelllistProfile].iconSize.width - 32)
|
|
|
|
spellList:setWidth(SpelllistSettings['Default'].spellListWidth + SpelllistSettings[SpelllistProfile].iconSize.width - 32)
|
|
|
|
end
|
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
function resetWindow()
|
|
|
|
spelllistWindow:hide()
|
|
|
|
spelllistButton:setOn(false)
|
|
|
|
|
|
|
|
-- Resetting filters
|
|
|
|
filters.level = false
|
|
|
|
filters.vocation = false
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
local buttonFilterLevel = spelllistWindow:getChildById('buttonFilterLevel')
|
|
|
|
buttonFilterLevel:setOn(filters.level)
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
local buttonFilterVocation = spelllistWindow:getChildById('buttonFilterVocation')
|
|
|
|
buttonFilterVocation:setOn(filters.vocation)
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
vocationRadioGroup:selectWidget(vocationBoxAny)
|
|
|
|
groupRadioGroup:selectWidget(groupBoxAny)
|
|
|
|
premiumRadioGroup:selectWidget(premiumBoxAny)
|
2014-01-18 15:09:26 +01:00
|
|
|
|
2012-10-07 03:24:06 +02:00
|
|
|
updateSpelllist()
|
2013-01-29 07:26:32 +01:00
|
|
|
end
|