Fixed file loading in the file structure system

master
AlmTech 5 years ago
parent 8719d77397
commit 28e91b9a86
  1. 45
      gamemode/cl_init.lua
  2. 1
      gamemode/engine/core/server/sv_player_character.lua
  3. 42
      gamemode/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/"
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/"
-- 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
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

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

@ -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
@ -39,5 +39,43 @@ if SERVER then
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()
end
Loading…
Cancel
Save