You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.4 KiB
32 lines
1.4 KiB
-- __ _ _______ _ __
|
|
-- / / /\ | | |__ __| | | \ \
|
|
-- / / / \ | |_ __ ___ | | ___ ___| |__ \ \
|
|
-- < < / /\ \ | | '_ ` _ \| |/ _ \/ __| '_ \ > >
|
|
-- \ \ / ____ \| | | | | | | | __/ (__| | | | / /
|
|
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
|
|
|
|
Quantum.Client.Menu = {}
|
|
local libs = {
|
|
["net"] = GM.FolderName .. "/gamemode/engine/derma/lib/cl_network.lua",
|
|
["page"] = GM.FolderName .. "/gamemode/engine/derma/lib/cl_menu_pages.lua",
|
|
["theme"] = GM.FolderName .. "/gamemode/engine/derma/lib/cl_menu_theme.lua"
|
|
}
|
|
Quantum.Client.Menu.GetAPI = function( lib ) return include( libs[lib] ) end
|
|
|
|
net.Receive( "quantum_menu_net", function( len, pl )
|
|
local dt = net.ReadTable() -- TO DO: merge datatable with cached ( if same id/type )
|
|
if( Quantum.Client.Cache[dt.id] ~= nil && #Quantum.Client.Cache[dt.id] >= 1 ) then
|
|
table.Merge( dt, Quantum.Client.Cache[dt.id] )
|
|
end
|
|
Quantum.Client.Cache[dt.id] = dt || { id = dt.id }
|
|
|
|
if( Quantum.Client.EnableDebug ) then -- debug
|
|
Quantum.Debug( "Datatable size: " .. len .. "b (" .. len/8 .. "B)" )
|
|
Quantum.Debug( "--Datatable contents--")
|
|
PrintTable( dt )
|
|
Quantum.Debug( "--End of datatable contens--" )
|
|
end
|
|
|
|
local menu = include( GAMEMODE.FolderName .. "/gamemode/engine/derma/menus/menu_" .. dt.id .. ".lua" )
|
|
menu.open( dt )
|
|
end) |