Added more menu file loading system stuff

master
AlmTech 5 years ago
parent 14dd39e06c
commit e4bda2189b
  1. 2
      gamemode/cl_init.lua
  2. 4
      gamemode/engine/core/sh_player_binds.lua
  3. 3
      gamemode/engine/derma/cl_menu.lua
  4. 0
      gamemode/engine/derma/menus/menu_character.lua
  5. 4
      gamemode/engine/lib/server/sv_networking.lua
  6. 10
      gamemode/init.lua

@ -41,7 +41,7 @@ if CLIENT then
local function loadAllDermaMenus()
local fol = GM.FolderName .. "/gamemode/engine/derma/"
include( fol .. "/cl_menu.lua" )
include( fol .. "cl_menu.lua" )
end
function Quantum.Client.Load()

@ -13,7 +13,7 @@ if SERVER then
Quantum.Debug( tostring( pl ) .. " pressed IN_USE" )
end,
["openCharMenu"] = function( pl )
Quantum.Net.OpenMenu( pl, "character", {} )
end
}
@ -21,6 +21,6 @@ if SERVER then
if( keyfuncs[key] ) then keyfuncs[key]( ply ) end
end
function GM:ShowHelp( ply )
keyfuncs["openCharMenu"]( ply )
end
end

@ -6,8 +6,7 @@
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
net.Receive( "quantum_menu_net", function( len, pl )
local menu = net.ReadString()
local dt = net.ReadTable()
local menu = include( "lib/cl_" .. menu .. ".lua" )
local menu = include( "menus/menu_" .. dt.id .. ".lua" )
menu.open( dt )
end)

@ -49,6 +49,10 @@ local function SendDatatableToClient( client, dt, type )
net.Send( client )
end
function Quantum.Net.OpenMenu( pl, type, dt )
SendDatatableToClient( pl, dt, type )
end
local funcs = {
["createChar"] = true
}

@ -63,13 +63,13 @@ if SERVER then
end
local function addAllDermaMenus()
AddCSLuaFile( fol .. "/cl_menu.lua" )
local fol = GM.FolderName .. "/gamemode/engine/derma/"
local menuFiles = file.Find( fol .. "/lib/menu_*.lua", "LUA" )
AddCSLuaFile( fol .. "cl_menu.lua" )
local libfol = GM.FolderName .. "/gamemode/engine/derma/menus/"
local menuFiles = file.Find( libfol .. "menu_*.lua", "LUA" )
for _, file in pairs( menuFiles ) do
AddCSLuaFile( fol .. "/" .. file )
AddCSLuaFile( libfol .. file )
end
end

Loading…
Cancel
Save