Preload properly with g_textures.preload
* Thanks Baxnie for advising me of this method :)
This commit is contained in:
parent
f4f9e319d8
commit
039c3072dc
|
@ -25,10 +25,9 @@ function init()
|
|||
contentsPanel = cooldownWindow:getChildById('contentsPanel')
|
||||
cooldownPanel = contentsPanel:getChildById('cooldownPanel')
|
||||
|
||||
-- load cooldown icons
|
||||
local iconIds = Spells.getSpellIconIds()
|
||||
for k,id in pairs(iconIds) do
|
||||
loadIcon(id):destroy()
|
||||
-- preload cooldown images
|
||||
for k,v in pairs(SpelllistSettings) do
|
||||
g_textures.preload(v.iconFile)
|
||||
end
|
||||
|
||||
if g_game.isOnline() then
|
||||
|
|
|
@ -50,7 +50,7 @@ function init()
|
|||
|
||||
-- load condition icons
|
||||
for k,v in pairs(Icons) do
|
||||
loadIcon(k):destroy()
|
||||
g_textures.preload(v.path)
|
||||
end
|
||||
|
||||
if g_game.isOnline() then
|
||||
|
|
|
@ -371,6 +371,17 @@ function Spells.getSpellIconIds()
|
|||
return ids
|
||||
end
|
||||
|
||||
function Spells.getSpellProfileById(id)
|
||||
for profile,data in pairs(SpellInfo) do
|
||||
for k,spell in pairs(data) do
|
||||
if spell.id == id then
|
||||
return profile
|
||||
end
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
function Spells.getSpellProfileByWords(words)
|
||||
for profile,data in pairs(SpellInfo) do
|
||||
for k,spell in pairs(data) do
|
||||
|
|
Loading…
Reference in New Issue