Added a 'page' library & added loading debug

master
AlmTech 5 years ago
parent 24cb897984
commit a255824202
  1. 38
      gamemode/engine/derma/lib/cl_menu_pages.lua
  2. 4
      gamemode/engine/derma/menus/menu_character.lua
  3. 36
      gamemode/init.lua

@ -0,0 +1,38 @@
-- __ _ _______ _ __
-- / / /\ | | |__ __| | | \ \
-- / / / \ | |_ __ ___ | | ___ ___| |__ \ \
-- < < / /\ \ | | '_ ` _ \| |/ _ \/ __| '_ \ > >
-- \ \ / ____ \| | | | | | | | __/ (__| | | | / /
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
local page = {}
local scale = Quantum.Client.ResolutionScale
function page.New( args )
args.w, args.h = args.w, args.h || ScrW(), ScrH()
args.x, args.y = args.x, args.y || 0, 0
local p = vgui.Create( "DPanel", args.parent )
p.w, p.h = args.w, args.h
p.x, p.y = args.x, args.y
p:SetSize( p.w, p.h )
p:SetPos( p.x, p.y )
p.Paint = args.Paint || function( self, w, h )
-- Draw nothing, unless this function is overwritten
end
p.OnClose = args.OnClose || function() end
local close = vgui.Create( "DButton", p )
close:SetSize( 50 * scale, 20 * scale )
close.DoClick = function() p:Close() end
close.Paint = args.CloseButtonPaint || function( self, w, h )
surface.SetDrawColor( 255, 60, 60, 255 )
surface.DrawRect( 0, 0, w, h )
end
return p
end
return page

@ -11,6 +11,10 @@ local net = Quantum.Client.Menu.GetAPI( "net" )
local resScale = Quantum.Client.ResolutionScale
local panels = {
[1] = function( parent, args ) end
}
function menu.open( dt )
local sw, sh = ScrW(), ScrH()
local padding = 10 * resScale

@ -18,59 +18,79 @@ if SERVER then
local function loadCoreFiles()
local fol = GM.FolderName .. "/gamemode/engine/core/"
MsgC( "\n" )
Quantum.Debug( "Loading core files..." )
-- Shared files
local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" )
for _, file in pairs( shFiles ) do
AddCSLuaFile( fol .. file )
include( fol .. file )
include( fol .. file )
Quantum.Debug( "(CORE) Loaded: " .. fol .. file )
end
-- CLient files
local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" )
for _, file in pairs( clFiles ) do
AddCSLuaFile( fol .. "client/" .. file )
Quantum.Debug( "(CORE) Loaded: " .. 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 )
Quantum.Debug( "(CORE) Loaded: " .. fol .. "server/" .. file )
end
end
local function loadLibFiles()
local fol = GM.FolderName .. "/gamemode/engine/lib/"
MsgC( "\n" )
Quantum.Debug( "Loading libraries..." )
-- Shared files
local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" )
for _, file in pairs( shFiles ) do
AddCSLuaFile( fol .. file )
include( fol .. file )
include( fol .. file )
Quantum.Debug( "Added library: " .. fol .. file )
end
-- CLient files
local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" )
for _, file in pairs( clFiles ) do
AddCSLuaFile( fol .. "client/" .. file )
Quantum.Debug( "Added library: " .. 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 )
Quantum.Debug( "Added library: " .. fol .. "server/" .. file )
end
end
local function addAllDermaMenus()
local fol = GM.FolderName .. "/gamemode/engine/derma/"
MsgC( "\n" )
Quantum.Debug( "Loading menus...")
AddCSLuaFile( fol .. "cl_menu.lua" )
AddCSLuaFile( fol .. "lib/cl_network.lua" )
local libfol = GM.FolderName .. "/gamemode/engine/derma/menus/"
local menuFiles = file.Find( libfol .. "menu_*.lua", "LUA" )
for _, file in pairs( menuFiles ) do
-- add all the menu libs
local libfol = fol .. "lib/"
local libFiles = file.Find( libfol .. "cl_*.lua", "LUA" )
for _, file in pairs( libFiles ) do
AddCSLuaFile( libfol .. file )
Quantum.Debug( "Added library: " .. libfol .. file )
end
-- add the menu's
local menufol = GM.FolderName .. "/gamemode/engine/derma/menus/"
local menuFiles = file.Find( menufol .. "menu_*.lua", "LUA" )
for _, file in pairs( menuFiles ) do
AddCSLuaFile( menufol .. file )
Quantum.Debug( "Added menu: " .. menufol .. file )
end
end

Loading…
Cancel
Save