Fixed linking to other menus

master
AlmTech Software 5 years ago
parent 08040147b9
commit b28192f549
  1. 18
      gamemode/engine/derma/menus/menu_character.lua
  2. 4
      gamemode/engine/derma/menus/menu_main.lua

@ -11,8 +11,6 @@ local snm = Quantum.Client.Menu.GetAPI( "net" )
local page = Quantum.Client.Menu.GetAPI( "page" ) local page = Quantum.Client.Menu.GetAPI( "page" )
local theme = Quantum.Client.Menu.GetAPI( "theme" ) local theme = Quantum.Client.Menu.GetAPI( "theme" )
--local mainmenu = include( GAMEMODE.FolderName .. "/gamemode/engine/derma/menus/menu_main.lua" )
local resScale = Quantum.Client.ResolutionScale local resScale = Quantum.Client.ResolutionScale
local sw, sh = ScrW(), ScrH() local sw, sh = ScrW(), ScrH()
local padding = 10 * resScale local padding = 10 * resScale
@ -84,7 +82,7 @@ local pages = {
p:Remove() p:Remove()
end end
local scene = { p.scene = {
["rp_truenorth_v1a_livin"] = { ["rp_truenorth_v1a_livin"] = {
[1] = { [1] = {
fov = 75, fov = 75,
@ -94,7 +92,11 @@ local pages = {
} }
} }
} }
Quantum.Client.Cam.Start( scene[game.GetMap()], true ) Quantum.Client.Cam.Start( p.scene[game.GetMap()], true )
p.OnRemove = function( self )
Quantum.Client.Cam.Start( parent.scene[game.GetMap()], true ) -- switch back to the parents scene
end
local banner = vgui.Create( "DImage", p ) local banner = vgui.Create( "DImage", p )
banner:SetImage( Quantum.Client.ServerBannerPath ) banner:SetImage( Quantum.Client.ServerBannerPath )
@ -448,7 +450,7 @@ function menu.open( dt )
Quantum.Client.Cam.Stop() Quantum.Client.Cam.Stop()
end end
local scene = { f.scene = {
["rp_truenorth_v1a_livin"] = { ["rp_truenorth_v1a_livin"] = {
[1] = { [1] = {
fov = 70, fov = 70,
@ -458,10 +460,10 @@ function menu.open( dt )
} }
} }
} }
Quantum.Client.Cam.Start( scene[game.GetMap()], true ) Quantum.Client.Cam.Start( f.scene[game.GetMap()], true )
local args = { local args = {
CloseButtonText = "Main Menu", CloseButtonText = "Return",
CloseButtonFont = "q_text" CloseButtonFont = "q_text"
} }
local p, c = page.New( f, args ) local p, c = page.New( f, args )
@ -487,7 +489,7 @@ function menu.open( dt )
c.DoClick = function() c.DoClick = function()
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
f:Close() f:Close()
mainmenu.open(dt) Quantum.Client.Menu.Menus["main"].open(dt)
end end
--- ---

@ -47,8 +47,6 @@ local scenes = {
} }
} }
local charmenu = include( GAMEMODE.FolderName .. "/gamemode/engine/derma/menus/menu_character.lua" )
function main.open(dt) function main.open(dt)
if( !f ) then if( !f ) then
@ -76,7 +74,7 @@ function main.open(dt)
f.OnClose = function( self ) f.OnClose = function( self )
--Quantum.Client.IsInMenu = false --Quantum.Client.IsInMenu = false
--Quantum.Client.Cam.Stop() --Quantum.Client.Cam.Stop()
charmenu.open( dt ) Quantum.Client.Menu.Menus["character"].open( dt )
end end
Quantum.Client.Cam.Start( scenes[ game.GetMap() ][math.random( 1, table.Count(scenes[ game.GetMap() ])) ], false ) Quantum.Client.Cam.Start( scenes[ game.GetMap() ][math.random( 1, table.Count(scenes[ game.GetMap() ])) ], false )

Loading…
Cancel
Save