Fixed file loading in the file structure system

master
AlmTech 5 years ago
parent 8719d77397
commit 28e91b9a86
  1. 47
      gamemode/cl_init.lua
  2. 1
      gamemode/engine/core/server/sv_player_character.lua
  3. 44
      gamemode/init.lua

@ -10,22 +10,49 @@ if CLIENT then
Quantum.Client = {} Quantum.Client = {}
Quantum.Client.ResolutionScale = ScrW() / 1080 Quantum.Client.ResolutionScale = ScrW() / 1080
-- Add all core files local function loadCoreFiles()
local fol = GM.FolderName .. "/gamemode/engine/core/"
function Quantum.Client.Load() local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" )
local fol = GM.FolderName .. "/gamemode/engine/core/" for _, file in pairs( shFiles ) do
include( fol .. file )
-- Shared files end
local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" )
for _, file in pairs( shFiles ) do local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" )
include( fol .. file ) for _, file in pairs( clFiles ) do
end 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" ) local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" )
for _, file in pairs( clFiles ) do for _, file in pairs( clFiles ) do
include( fol .. "client/" .. file ) include( fol .. "client/" .. file )
end 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." ) Quantum.Debug( "Loaded all files." )
end end

@ -22,6 +22,7 @@ function Quantum.Server.Char.CreateCharTable( args )
combat = 0, combat = 0,
science = 0 science = 0
}, },
training = args.training || {},
licenses = args.licenses || {}, licenses = args.licenses || {},
titles = args.titles || {} titles = args.titles || {}
} }

@ -15,8 +15,8 @@ if SERVER then
Quantum.Server = {} Quantum.Server = {}
include( "settings/sv_settings.lua" ) -- include the settings 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/" local fol = GM.FolderName .. "/gamemode/engine/core/"
-- Shared files -- Shared files
@ -36,7 +36,45 @@ if SERVER then
local cFiles = file.Find( fol .. "/server/sv_*.lua", "LUA" ) local cFiles = file.Find( fol .. "/server/sv_*.lua", "LUA" )
for _, file in pairs( cFiles ) do for _, file in pairs( cFiles ) do
include( fol .. "server/" .. file ) 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 end
Quantum.Server.Load() Quantum.Server.Load()

Loading…
Cancel
Save