class MenuScenario_E3EndMenu extends MenuScenario_BaseMenu
{

	protected event OnEnterScenario( prevScenario : CName, userData : IScriptable )
	{
		GetMenusState().OpenMenu( 'pause_menu_background' );
		SwitchMenu( 'e3_end_screen' );
	}

	protected event OnSwitchToLoadGame()
	{
		SwitchMenu( 'load_game' );
	}

	protected event OnCloseDeathMenu()
	{
		SwitchToScenario( 'MenuScenario_Idle' );
	}

	protected event OnMainMenuBack()
	{
		SwitchMenu( 'e3_end_screen' );
	}

	protected override function GotoIdleState() {}
}

class E3EndMenuGameController extends gameuiMenuItemListGameController
{

	protected event OnInitialize()
	{
		var uiSystem : UISystem;
		var evt : inkMenuLayer_SetCursorVisibility;
		uiSystem = GameInstance.GetUISystem( GetPlayerControlledObject().GetGame() );
		uiSystem.PushGameContext( UIGameContext.Default );
		uiSystem.RequestNewVisualState( 'inkPauseMenuState' );
		evt = new inkMenuLayer_SetCursorVisibility;
		evt.Init( false );
		QueueEvent( evt );
		RegisterToGlobalInputCallback( 'OnPostOnRelease', this, 'OnAnyKeyPress' );
	}

	protected event OnUninitialize()
	{
		var evt : inkMenuLayer_SetCursorVisibility;
		UnregisterFromGlobalInputCallback( 'OnPostOnRelease', this, 'OnAnyKeyPress' );
		evt = new inkMenuLayer_SetCursorVisibility;
		evt.Init( true );
		QueueEvent( evt );
	}

	protected event OnAnyKeyPress( e : inkPointerEvent )
	{
		e.Handle();
		if( e.IsAction( 'UI_Skip' ) )
		{
			GetSystemRequestsHandler().GotoMainMenu();
		}
	}

	protected event OnSetMenuEventDispatcher( menuEventDispatcher : weak< inkMenuEventDispatcher > )
	{
		m_menuEventDispatcher = menuEventDispatcher;
	}

}

