Pulls in FPS menu so we can make edits
This commit is contained in:
40
code/UI/MainMenu/MainMenu.razor
Normal file
40
code/UI/MainMenu/MainMenu.razor
Normal file
@@ -0,0 +1,40 @@
|
||||
@using System;
|
||||
@using Sandbox;
|
||||
@using Sandbox.UI;
|
||||
|
||||
@inherits Sandbox.UI.NavHostPanel
|
||||
@implements Sandbox.Menu.IGameMenuPanel
|
||||
@attribute [StyleSheet]
|
||||
@namespace LuckerGame.UI.MainMenu
|
||||
|
||||
<root style="flex-direction: column;">
|
||||
<div class="background" />
|
||||
<div class="navigator-canvas" slot="navigator-canvas" />
|
||||
</root>
|
||||
|
||||
@code
|
||||
{
|
||||
public MainMenu()
|
||||
{
|
||||
DefaultUrl = "/";
|
||||
|
||||
AddDestination( "/", typeof( FrontPage ) );
|
||||
AddDestination( "/setup", typeof( SetupGame ) );
|
||||
|
||||
AddDestination( "/lobby/list", typeof( LobbyBrowser ) );
|
||||
AddDestination( "/lobby/active", typeof( ActiveLobby ) );
|
||||
|
||||
BindClass( "ingame", () => Game.InGame );
|
||||
}
|
||||
|
||||
[GameEvent.Menu.ServerJoined]
|
||||
public void OnServerJoined() => Navigate( "/" );
|
||||
|
||||
[GameEvent.Menu.ServerLeave]
|
||||
public void OnServerLeave() => Navigate ("/" );
|
||||
|
||||
protected override int BuildHash()
|
||||
{
|
||||
return HashCode.Combine( Game.InGame, Game.Menu.Lobby, Game.Menu.Lobby?.Map );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user