Server intro progress & dialogue box API stuff

master
AlmTech 5 years ago
parent fe1d3b8446
commit dfc6e54965
  1. 6
      gamemode/engine/core/client/cl_fonts.lua
  2. 7
      gamemode/engine/core/server/sv_player_init.lua
  3. 3
      gamemode/engine/derma/cl_menu.lua
  4. 30
      gamemode/engine/derma/lib/cl_menu_dialogueBox.lua
  5. 12
      gamemode/engine/derma/menus/menu_intro.lua

@ -60,3 +60,9 @@ surface.CreateFont( "q_header", {
size = 50 * Quantum.Client.ResolutionScale,
antialias = true
})
surface.CreateFont( "q_header_s", {
font = "Constantia Bold Italic",
size = 42 * Quantum.Client.ResolutionScale,
antialias = true
})

@ -20,7 +20,12 @@ local function setUpPlayer( ply )
else
Quantum.Error( tostring(ply) .. " doesn't have a valid model. Unable to set up hands!" )
end
Quantum.Debug( tostring( ply ) .. " spawned." )
local char = Quantum.Server.Char.GetCurrentCharacter( ply )
local charnametxt = " spawned."
if( char ~= nil ) then
charnametxt = " spawned as '" .. char.name .. "'."
end
Quantum.Debug( tostring( ply ) .. charnametxt )
end
function GM:PlayerSpawn( ply )

@ -9,7 +9,8 @@ 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"
["theme"] = GM.FolderName .. "/gamemode/engine/derma/lib/cl_menu_theme.lua",
["dialogue"] = GM.FolderName .. "/gamemode/engine/derma/lib/cl_menu_dialogueBox.lua"
}
Quantum.Client.Menu.GetAPI = function( lib ) return include( libs[lib] ) end

@ -12,14 +12,36 @@ local padding_s = 4 * scale
local theme = Quantum.Client.Menu.GetAPI( "theme" )
function log.createinfobox( text, parent )
function log.createinfobox( title, text, parent )
local fw, fh = parent:GetSize()
local box = vgui.Create( "DPanel", parent )
box:SetSize( 250 * scale, 80 * scale )
box.Paint = function( self ) theme.panel( self, Color( 0, 0, 0, 100 ) )
box:SetSize( 775 * scale, 200 * scale )
box.Paint = function( self ) theme.blurpanel( self, Color( 0, 0, 0, 0 ) ) end
box.w, box.h = box:GetSize()
box:SetPos( fw/2 - box.w/2, fh*0.8 - box.h/2 )
box.x, box.y = box:GetSize()
local header = vgui.Create( "DLabel", parent )
header:SetText( title )
header:SetFont( "q_header_s" )
header:SetTextColor( Color( 255, 255, 255, 220 ) )
header:SizeToContents()
header.w, header.h = header:GetSize()
header:SetPos( box.x - box.w/2 + header.w/2, box.y )
local scroll = vgui.Create( "DScrollPanel", box )
--scroll:SetSize()
scroll:SetSize( box:GetSize() )
scroll.Paint = function( self ) end
local sb = scroll:GetVBar()
sb.Paint = function( self ) end
function sb.btnGrip:Paint()
theme.button( self, Color( 0, 0, 0, 80 ) )
end
sb.btnUp:SetSize(0,0)
sb.btnDown:SetSize(0,0)
return box
end
return log

@ -7,6 +7,8 @@
local intro = {}
local log = Quantum.Client.Menu.GetAPI( "dialogue" )
local scenes = {
["rp_truenorth_v1a_livin"] = {
[1] = {
@ -41,8 +43,13 @@ function intro.open( dt )
local f = vgui.Create( "DFrame" )
f:SetSize( sw, sh )
f:SetTitle( "Cinematic Intro Test" )
f.Paint = function( self ) end
f:SetTitle( "" )
f.Paint = function( self, w, h )
surface.SetDrawColor( Color( 20, 20, 20, 255 ) )
local height = 90 * resScale
surface.DrawRect( 0, 0, w, 90 * resScale )
surface.DrawRect( 0, h - height, w, height )
end
f:SetDraggable( false )
f:MakePopup()
function f:OnClose()
@ -51,6 +58,7 @@ function intro.open( dt )
end
Quantum.Client.Cam.Start( scenes[game.GetMap()], false ) -- start the cinematic
local box = log.createinfobox( "Sample Title", "TEST", f )
end
end

Loading…
Cancel
Save