@using Sandbox.Modals @using Sandbox @using Sandbox.UI @using Sandbox.Menu @using MenuProject.MenuUI.Components @namespace MenuProject.Modals @inherits MenuProject.Modals.BaseModal
@if(game is not null) {
@game.Title
@game.Summary
}
@if ( game is not null ) { @if ( Networking.IsActive && game.GetValue( "ShowPlayerList", true ) ) { } @if ( CanChangeMap ) { } }
@code { bool CanChangeMap { get { if ( Networking.IsActive && !Networking.IsHost ) return false; return game.GetValue( "ShowChangeMap", false ); } } Package game; void OnCreateGame( CreateGameResults x ) { if ( Networking.IsActive && !Networking.IsHost ) return; if ( !string.IsNullOrEmpty( x.MapIdent ) ) { LaunchArguments.Map = x.MapIdent; } Game.Load( Game.Ident, true ); this.CloseModal( true ); } void ChangeMap() { Game.Overlay.CreateGame( new CreateGameOptions( game, OnCreateGame ) ); } public PauseMenuModal() : base() { game = MenuUtility.GamePackage; } }