diff --git a/lua/ulx/modules/cl/xgui_client.lua b/lua/ulx/modules/cl/xgui_client.lua index edd476f3..3c3baf0b 100644 --- a/lua/ulx/modules/cl/xgui_client.lua +++ b/lua/ulx/modules/cl/xgui_client.lua @@ -524,7 +524,7 @@ function xgui.PermissionsChanged( ply ) xgui.processModules() local types = {} for dtype, data in pairs( xgui.data ) do - if table.Count( data ) > 0 then table.insert( types, dtype ) end + if not table.IsEmpty(data) then table.insert( types, dtype ) end end RunConsoleCommand( "xgui", "refreshdata", unpack( types ) ) end diff --git a/lua/ulx/modules/cl/xlib.lua b/lua/ulx/modules/cl/xlib.lua index 94f94bfd..ad6e8b76 100644 --- a/lua/ulx/modules/cl/xlib.lua +++ b/lua/ulx/modules/cl/xlib.lua @@ -377,7 +377,7 @@ function xlib.makecombobox( t ) --Garrys function with no comments, just adding support for Spacers and setting the skin. function pnl:OpenMenu() - if ( #self.Choices == 0 ) then return end + if ( table.IsEmpty(self.Choices) ) then return end if ( IsValid( self.Menu ) ) then self.Menu:Remove() self.Menu = nil @@ -1126,14 +1126,14 @@ xlib.animQueue_forceStop = function() end xlib.animQueue_call = function() - if #xlib.animQueue > 0 then + if not table.IsEmpty(xlib.animQueue) then local func = xlib.animQueue[1] table.remove( xlib.animQueue, 1 ) func() else xlib.animRunning = nil --Check for queues in the backup that haven't been started. - if #xlib.animBackupQueue > 0 then + if not table.IsEmpty(xlib.animBackupQueue) then xlib.animQueue = table.Copy( xlib.animBackupQueue ) xlib.animBackupQueue = {} xlib.animQueue_start() @@ -1198,4 +1198,4 @@ local function fadeAnim_end( data ) if data.panelOut then data.panelOut:SetVisible( false ) end if data.panelIn then data.panelIn:SetAlpha( 255 ) end end -xlib.registerAnimType( "pnlFade", fadeAnim_run, fadeAnim_start, fadeAnim_end ) \ No newline at end of file +xlib.registerAnimType( "pnlFade", fadeAnim_run, fadeAnim_start, fadeAnim_end ) diff --git a/lua/ulx/modules/xgui_server.lua b/lua/ulx/modules/xgui_server.lua index 0aee5aed..64a65c9f 100644 --- a/lua/ulx/modules/xgui_server.lua +++ b/lua/ulx/modules/xgui_server.lua @@ -139,7 +139,7 @@ function xgui.init() if type( plys ) == "Player" then plys = { plys } elseif #plys == 0 then - for _, v in pairs( player.GetAll() ) do + for _, v in ipairs( player.GetAll() ) do table.insert( plys, v ) end end @@ -324,7 +324,7 @@ function xgui.postInit() for _, v in ipairs( xgui.svmodules ) do if v.postinit then v.postinit() end end --Fix any users who requested data before the server was ready - for _, ply in pairs( player.GetAll() ) do + for _, ply in ipairs( player.GetAll() ) do for UID, data in pairs( xgui.activeUsers ) do if ply:UniqueID() == UID then ULib.clientRPC( ply, "xgui.getChunk", -1, "Initializing..." ) diff --git a/lua/ulx/xgui/bans.lua b/lua/ulx/xgui/bans.lua index d1bef056..8507702b 100644 --- a/lua/ulx/xgui/bans.lua +++ b/lua/ulx/xgui/bans.lua @@ -284,7 +284,7 @@ function xgui.ShowBanWindow( ply, ID, doFreeze, isUpdate, bandata ) local name if not isUpdate then name = xlib.makecombobox{ x=75, y=30, w=200, parent=xgui_banwindow, enableinput=true, selectall=true } - for k,v in pairs( player.GetAll() ) do + for k,v in ipairs( player.GetAll() ) do name:AddChoice( v:Nick(), v:SteamID() ) end name.OnSelect = function( self, index, value, data )