diff --git a/gamemode/cl_init.lua b/gamemode/cl_init.lua index 5fe7877..a198c3f 100644 --- a/gamemode/cl_init.lua +++ b/gamemode/cl_init.lua @@ -10,22 +10,49 @@ if CLIENT then Quantum.Client = {} Quantum.Client.ResolutionScale = ScrW() / 1080 - -- Add all core files + local function loadCoreFiles() + local fol = GM.FolderName .. "/gamemode/engine/core/" - function Quantum.Client.Load() - local fol = GM.FolderName .. "/gamemode/engine/core/" - - -- Shared files - local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" ) - for _, file in pairs( shFiles ) do - include( fol .. file ) - end + local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" ) + for _, file in pairs( shFiles ) do + include( fol .. file ) + end + + local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" ) + for _, file in pairs( clFiles ) do + include( fol .. "client/" .. file ) + end + end + + local function loadLibFiles() + local fol = GM.FolderName .. "/gamemode/engine/lib/" + + local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" ) + for _, file in pairs( shFiles ) do + AddCSLuaFile( fol .. file ) + include( fol .. file ) + end - -- CLient files local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" ) for _, file in pairs( clFiles ) do include( fol .. "client/" .. file ) end + end + + local function loadAllDermaMenus() + local fol = GM.FolderName .. "/gamemode/engine/derma/" + local clFiles = file.Find( fol .. "/cl_*.lua", "LUA" ) + for _, file in pairs( clFiles ) do + include( fol .. "/" .. file ) + end + end + + function Quantum.Client.Load() + local fol = GM.FolderName .. "/gamemode/engine/core/" + + loadCoreFiles() + loadLibFiles() + loadAllDermaMenus() Quantum.Debug( "Loaded all files." ) end diff --git a/gamemode/engine/core/server/sv_player_character.lua b/gamemode/engine/core/server/sv_player_character.lua index a19a31d..3e535bd 100644 --- a/gamemode/engine/core/server/sv_player_character.lua +++ b/gamemode/engine/core/server/sv_player_character.lua @@ -22,6 +22,7 @@ function Quantum.Server.Char.CreateCharTable( args ) combat = 0, science = 0 }, + training = args.training || {}, licenses = args.licenses || {}, titles = args.titles || {} } diff --git a/gamemode/init.lua b/gamemode/init.lua index d8a4075..fa7697f 100644 --- a/gamemode/init.lua +++ b/gamemode/init.lua @@ -15,8 +15,8 @@ if SERVER then Quantum.Server = {} include( "settings/sv_settings.lua" ) -- include the settings - -- Add all core files - function Quantum.Server.Load() + + local function loadCoreFiles() local fol = GM.FolderName .. "/gamemode/engine/core/" -- Shared files @@ -36,7 +36,45 @@ if SERVER then local cFiles = file.Find( fol .. "/server/sv_*.lua", "LUA" ) for _, file in pairs( cFiles ) do include( fol .. "server/" .. file ) - end + end + end + + local function loadLibFiles() + local fol = GM.FolderName .. "/gamemode/engine/lib/" + + -- Shared files + local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" ) + for _, file in pairs( shFiles ) do + AddCSLuaFile( fol .. file ) + include( fol .. file ) + end + + -- CLient files + local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" ) + for _, file in pairs( clFiles ) do + AddCSLuaFile( fol .. "client/" .. file ) + end + + -- Server files + local cFiles = file.Find( fol .. "/server/sv_*.lua", "LUA" ) + for _, file in pairs( cFiles ) do + include( fol .. "server/" .. file ) + end + end + + local function addAllDermaMenus() + local fol = GM.FolderName .. "/gamemode/engine/derma/" + local clFiles = file.Find( fol .. "/cl_*.lua", "LUA" ) + for _, file in pairs( clFiles ) do + AddCSLuaFile( fol .. "/" .. file ) + end + end + + function Quantum.Server.Load() + -- Add all of the base files + loadCoreFiles() + loadLibFiles() + addAllDermaMenus() end Quantum.Server.Load()