Only initialize registry when needed

This commit is contained in:
StyledStrike 2024-06-14 15:19:35 -03:00
parent ff8796c94b
commit 859982989b
2 changed files with 6 additions and 3 deletions

View File

@ -184,7 +184,6 @@ function CLoadout:Init()
self.frame = nil
end
self:InitRegistry()
self:Load()
if #self.loadouts == 0 then

View File

@ -26,12 +26,16 @@ function CLoadout:UpdateLists()
end
function CLoadout:ShowPanel()
if not self.categories then
CLoadout.PrintF( "Too early! Weapons have not been loaded and categorized yet!" )
if not self.loadouts then
CLoadout.PrintF( "Too early! The addon is not prepared!" )
return
end
if not self.categories then
self:InitRegistry()
end
if IsValid( self.frame ) then
self.frame:Close()
self.frame = nil