Added themes & inventory menu stuff

master
AlmTech Software 5 years ago
parent 35a1d28300
commit 4890d4e08a
  1. 2
      gamemode/engine/core/server/sv_player_init.lua
  2. 9
      gamemode/engine/derma/lib/cl_menu_theme.lua
  3. 52
      gamemode/engine/derma/menus/menu_charinfo.lua

@ -47,7 +47,7 @@ function GM:PlayerSpawn( ply )
setUpPlayer( ply )
else
ply:SetPos( Vector( -8936.411133, 8244.439453, 7744.031250 ) )
Quantum.Net.OpenMenu( ply, "main", Quantum.Server.Char.GetPlayerChars_cl( ply ) ) -- make the player open the main menu
Quantum.Net.OpenMenu( ply, "main", { chars = Quantum.Server.Char.GetPlayerChars_cl( ply ) } ) -- make the player open the main menu
end
end

@ -126,4 +126,13 @@ function theme.skipbutton( b, inClr )
surface.DrawRect( padding_s/2, padding_s/2, w - padding_s, h - padding_s )
end
function theme.pagetitle( b )
local w, h = b:GetSize()
b:SetTextColor( Color( 205, 205, 205, 255 ) )
surface.SetDrawColor( Color( 0, 0, 0, 0 ) )
surface.DrawRect( 0, 0, w, h )
end
return theme

@ -20,12 +20,20 @@ local errorMdl = "models/player.mdl"
function menu.open( dt )
local items = dt.cont.items
if( !f ) then
Quantum.Client.IsInMenu = true
local f = vgui.Create( "DFrame" )
f:SetSize( sw, sh )
f:SetTitle("Character Info")
f.w, f.h = f:GetSize()
f:SetTitle( "" )
f:SetDraggable( false )
f:ShowCloseButton( false )
f:MakePopup()
f.Paint = function() end
f.Paint = function( self, w, h )
surface.SetDrawColor( 0, 0, 0, 40 )
surface.DrawRect( 0, 0, w, h )
theme.renderblur( self, 10, 10 )
end
function f:OnClose()
Quantum.Client.IsInMenu = false -- show the hud when closed
Quantum.Client.Cam.Stop()
@ -33,7 +41,45 @@ function menu.open( dt )
-- Default is the inventory page --
--f.inv = page.New( f, {} )
local bar = vgui.Create( "DPanel", f )
bar:SetSize( f.w, padding*5 )
bar.w, bar.h = bar:GetSize()
bar:SetPos( 0, 0 )
bar.Paint = function( self ) theme.blurpanel( self ) end
bar.DoClick = function( self ) f:Close() end
f.pages = {
inventory = { title = "Inventory" },
info = { title = "Character Information" }
}
-- Inventory button --
title = vgui.Create( "DLabel", bar )
title:SetText( "Inventory" )
title:SetFont( "q_header_s" )
title:SetTextColor( Color( 255, 255, 255, 255 ) )
title.Paint = function( self )
theme.pagetitle( self )
end
title:SizeToContents()
title.w, title.h = title:GetSize()
title:SetPos( bar.w/2 - title.w/2, bar.h/2 - title.h/2 )
---- Character view ----
local char = vgui.Create( "DModelPanel", f )
char:SetSize( 500, 500 )
--char:SetModel( dt.cont.char.model ) ------------FIX THIS
---- TEMPORARY: REMOVE WHEN THE MENU IS DONE ----
local close = vgui.Create( "DButton", f )
close:SetText( "DEV CLOSE" )
close:SizeToContents()
close.w, close.h = close:GetSize()
close:SetPos( 0, f.h - close.h )
close.DoClick = function( self ) f:Close() end
end
end

Loading…
Cancel
Save