mirror of
https://github.com/StyledStrike/gmod-custom-loadout.git
synced 2025-03-04 03:03:09 -05:00
Only initialize registry when needed
This commit is contained in:
parent
ff8796c94b
commit
859982989b
@ -184,7 +184,6 @@ function CLoadout:Init()
|
||||
self.frame = nil
|
||||
end
|
||||
|
||||
self:InitRegistry()
|
||||
self:Load()
|
||||
|
||||
if #self.loadouts == 0 then
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user