import enum UIGameContext
{
	Default,
	QuickHack,
	Scanning,
	DeviceZoom,
	BraindanceEditor,
	BraindancePlayback,
	VehicleMounted,
	ModalPopup,
	RadialWheel,
	VehicleRace,
	Berserk,
}

import enum gameuiPatchIntro
{
	Patch1500_NextGen,
	Patch1600,
	Patch2000,
	Patch2000_EP1,
	Patch2100,
}

import struct gameuiPatchIntroPackage
{
	import var patchIntrosNeeded : array< gameuiPatchIntro >;
}

import enum gameuiOneTimeMessage
{
	XboxCompatibilityLimitation,
}

importonly class PushUIGameContextEvent extends Event
{
	import var context : UIGameContext;
}

importonly class PopUIGameContextEvent extends Event
{
	import var context : UIGameContext;
	import var invalidate : Bool;
}

importonly class SwapUIGameContextEvent extends Event
{
	import var oldContext : UIGameContext;
	import var newContext : UIGameContext;
}

importonly class ResetUIGameContextEvent extends Event
{
}

importonly class VisualStateChangeEvent extends Event
{
	import var visualState : CName;
}

importonly class VisualStateRestorePreviousEvent extends Event
{
	import var visualState : CName;
}

importonly abstract class IUISystem extends IGameSystem
{
}

import final class UISystem extends IUISystem
{
	private import const function GetGameInstance() : GameInstance;
	public import function QueueEvent( evt : Event );
	public import function QueueMenuEvent( eventName : CName, optional userData : IScriptable );

	public function PushGameContext( context : UIGameContext )
	{
		var evt : PushUIGameContextEvent;
		evt = new PushUIGameContextEvent;
		evt.context = context;
		QueueEvent( evt );
	}

	public function PopGameContext( context : UIGameContext, optional invalidate : Bool )
	{
		var evt : PopUIGameContextEvent;
		evt = new PopUIGameContextEvent;
		evt.context = context;
		evt.invalidate = invalidate;
		QueueEvent( evt );
	}

	public function SwapGameContext( oldContext : UIGameContext, newContext : UIGameContext )
	{
		var evt : SwapUIGameContextEvent;
		evt = new SwapUIGameContextEvent;
		evt.oldContext = oldContext;
		evt.newContext = newContext;
		QueueEvent( evt );
	}

	public function ResetGameContext()
	{
		QueueEvent( new ResetUIGameContextEvent );
	}

	public function RequestNewVisualState( newVisualState : CName )
	{
		var evt : VisualStateChangeEvent;
		evt = new VisualStateChangeEvent;
		evt.visualState = newVisualState;
		QueueEvent( evt );
	}

	public function RestorePreviousVisualState( popVisualState : CName )
	{
		var evt : VisualStateRestorePreviousEvent;
		evt = new VisualStateRestorePreviousEvent;
		evt.visualState = popVisualState;
		QueueEvent( evt );
	}

	public import function RequestVendorMenu( data : VendorPanelData, optional scenarioName : CName );
	public import function RequestFastTravelMenu();

	private function GetFastTravelSystem() : FastTravelSystem
	{
		return ( ( FastTravelSystem )( GameInstance.GetScriptableSystemsContainer( GetGameInstance() ).Get( 'FastTravelSystem' ) ) );
	}

	private function NotifyFastTravelSystem( menuEnabled : Bool )
	{
		var request : FastTravelMenuToggledEvent;
		request = new FastTravelMenuToggledEvent;
		request.isEnabled = menuEnabled;
		GetFastTravelSystem().QueueRequest( request );
	}

	protected event OnEnterFastTravelMenu()
	{
		NotifyFastTravelSystem( true );
	}

	protected event OnExitFastTravelMenu()
	{
		NotifyFastTravelSystem( false );
	}

	public import function NotifyFastTravelStart();
	public import function ShowTutorialBracket( data : TutorialBracketData );
	public import function HideTutorialBracket( bracketID : CName );
	public import function ShowTutorialOverlay( data : TutorialOverlayData );
	public import function HideTutorialOverlay( data : TutorialOverlayData );
	public import function SetGlobalThemeOverride( themeID : CName );
	public import function ClearGlobalThemeOverride();
	public import function GetNeededPatchIntroPackage() : gameuiPatchIntroPackage;
	public import function IsPatchIntroNeeded( patchIntro : gameuiPatchIntro ) : Bool;
	public import function MarkPatchIntroAsSeen( patchIntro : gameuiPatchIntro );
	public import function ResetPatchIntro( patchIntro : gameuiPatchIntro );
	public import function SetOneTimeMessageSeen( message : gameuiOneTimeMessage, seen : Bool );
	public import function GetOneTimeMessageSeen( message : gameuiOneTimeMessage ) : Bool;
	public import function GetCurrentWindowSize() : Vector2;
	public import function GetInverseUIScale() : Float;
	public import function GetBlackBarsSizes() : Vector2;
	public import function GetHudScalingOverride() : Float;
	public import function SetHudEntryForcedVisibility( entryName : CName, visibility : worlduiEntryVisibility );
	public import function GetHudEntryForcedVisibility( entryName : CName ) : worlduiEntryVisibility;
	public import function SetNavigationOppositeAxisDistanceCost( cost : Float );
	public import function ResetNavigationOppositeAxisDistanceCost();
	public import function GetInteractableWidgetUnderCursor() : weak< inkWidget >;
}

