class PlayRecordedSessionMenuGameController extends PreGameSubMenuGameController
{
	private var m_recordsSelector : weak< SelectorController >;
	private var m_records : array< String >;

	protected event OnInitialize()
	{
		var selectorsList : weak< inkVerticalPanel >;
		super.OnInitialize();
		selectorsList = ( ( inkVerticalPanel )( GetWidget( 'Data/Selectors' ) ) );
		m_records = GetSystemRequestsHandler().GetRecords();
		m_recordsSelector = AddSelector( selectorsList, "Record:", m_records );
	}

	public override function InitializeMenuName( menuName : weak< inkText > )
	{
		menuName.SetText( "UI-Cyberpunk-Fullscreen-Pregame-PLAY_RECORDED_SESSION" );
	}

	public override function InitializeButtons( buttonsList : weak< inkVerticalPanel > )
	{
		AddButton( buttonsList, "PLAY", 'OnPlay' );
		AddButton( buttonsList, "BACK", 'OnBack' );
	}

	protected event OnPlay( e : inkPointerEvent )
	{
		var index : Int32;
		if( e.IsAction( 'click' ) )
		{
			index = m_recordsSelector.GetCurrIndex();
			if( ( index >= 0 ) && ( index < m_records.Size() ) )
			{
				GetSystemRequestsHandler().PlayRecord( m_records[ index ] );
			}
		}
	}

	protected event OnBack( e : inkPointerEvent )
	{
		if( e.IsAction( 'click' ) )
		{
			m_menuEventDispatcher.SpawnEvent( 'OnBack' );
		}
	}

}

