class ToggleShow extends ActionBool
{

	public function SetProperties( isShown : Bool )
	{
		actionName = 'ToggleShow';
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( 'Show', isShown, 'LocKey#17833', 'LocKey#17834' );
	}

}

class WallScreenController extends TVController
{

	public const override function GetPS() : WallScreenControllerPS
	{
		return ( ( WallScreenControllerPS )( GetBasePS() ) );
	}

}

class WallScreenControllerPS extends TVControllerPS
{
	default m_tweakDBRecord = T"Devices.WallScreen";
	default m_tweakDBDescriptionRecord = T"device_descriptions.WallScreen";
	private persistent var m_isShown : Bool;

	protected event OnInstantiated()
	{
		super.OnInstantiated();
		if( !( IsStringValid( m_deviceName ) ) )
		{
			m_deviceName = "Gameplay-Devices-DisplayNames-WallScreen";
		}
	}

	protected override function Initialize()
	{
		super.Initialize();
	}

	private function ActionToggleShow() : ToggleShow
	{
		var action : ToggleShow;
		action = new ToggleShow;
		action.clearanceLevel = DefaultActionsParametersHolder.GetInteractiveClearance();
		action.SetUp( this );
		action.SetProperties( m_isShown );
		action.AddDeviceName( m_deviceName );
		return action;
	}

	public override function GetActions( out actions : array< DeviceAction >, context : GetActionsContext ) : Bool
	{
		super.GetActions( actions, context );
		if( !( IsUserAuthorized( context.processInitiatorObject.GetEntityID() ) ) )
		{
			return false;
		}
		if( Clearance.IsInRange( context.clearance, DefaultActionsParametersHolder.GetInteractiveClearance() ) )
		{
			actions.PushBack( ActionToggleShow() );
		}
		SetActionIllegality( actions, m_illegalActions.regularActions );
		return true;
	}

	public function OnToggleShow( evt : ToggleShow ) : EntityNotificationType
	{
		UseNotifier( evt );
		if( IsUnpowered() || IsDisabled() )
		{
			return EntityNotificationType.DoNotNotifyEntity;
		}
		m_isShown = !( m_isShown );
		return EntityNotificationType.SendThisEventToEntity;
	}

	public const function IsShown() : Bool
	{
		return m_isShown;
	}

	public override function GetDeviceIconPath() : String
	{
		return "";
	}

}

