class MediaDeviceStatus extends BaseDeviceStatus
{

	public override function SetProperties( const deviceRef : ScriptableDeviceComponentPS )
	{
		var statusValue : Int32;
		super.SetProperties( deviceRef );
		statusValue = ( ( Int32 )( deviceRef.GetDeviceState() ) );
		prop.second = ( ( MediaDeviceControllerPS )( deviceRef ) ).GetActiveStationName();
		prop = DeviceActionPropertyFunctions.SetUpProperty_MediaStatus( 'MediaStatus', statusValue, ( ( MediaDeviceControllerPS )( deviceRef ) ).GetActiveStationName() );
	}

	public const override function GetCurrentDisplayString() : String
	{
		var str : String;
		var channelName : String;
		var baseStateValue : Int32;
		if( DeviceActionPropertyFunctions.GetProperty_MediaStatus( prop, baseStateValue, channelName ) )
		{
			if( baseStateValue > 1 )
			{
				baseStateValue = 1;
			}
			if( baseStateValue > 0 )
			{
				str = "LocKey#2256";
				return str;
			}
			else
			{
				return super.GetCurrentDisplayString();
			}
		}
		else
		{
		}
		return str;
	}

	public static function IsDefaultConditionMet( device : ScriptableDeviceComponentPS, const context : ref< GetActionsContext > ) : Bool
	{
		if( IsAvailable( device ) && IsClearanceValid( context.clearance ) )
		{
			return true;
		}
		return false;
	}

	public static function IsAvailable( device : ScriptableDeviceComponentPS ) : Bool
	{
		return BaseDeviceStatus.IsAvailable( device );
	}

	public static function IsClearanceValid( clearance : Clearance ) : Bool
	{
		return BaseDeviceStatus.IsClearanceValid( clearance );
	}

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

}

class NextStation extends ActionBool
{

	public function SetProperties()
	{
		actionName = 'NextStation';
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( 'Next Station', true, 'LocKey#252', 'LocKey#252' );
	}

	public static function IsDefaultConditionMet( device : ScriptableDeviceComponentPS, const context : ref< GetActionsContext > ) : Bool
	{
		if( IsAvailable( device ) && IsClearanceValid( context.clearance ) )
		{
			return true;
		}
		return false;
	}

	public static function IsAvailable( device : ScriptableDeviceComponentPS ) : Bool
	{
		return BasicAvailabilityTest( device );
	}

	public static function IsClearanceValid( clearance : Clearance ) : Bool
	{
		if( Clearance.IsInRange( clearance, DefaultActionsParametersHolder.GetInteractiveClearance() ) )
		{
			return true;
		}
		return false;
	}

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

}

class QuestNextStation extends ActionBool
{

	public function SetProperties()
	{
		actionName = 'QuestNextStation';
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( actionName, true, 'QuestNextStation', 'QuestNextStation' );
	}

}

class PreviousStation extends ActionBool
{

	public function SetProperties()
	{
		actionName = 'PreviousStation';
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( 'Previous Station', true, 'LocKey#253', 'LocKey#253' );
	}

	public static function IsDefaultConditionMet( device : ScriptableDeviceComponentPS, const context : ref< GetActionsContext > ) : Bool
	{
		if( IsAvailable( device ) && IsClearanceValid( context.clearance ) )
		{
			return true;
		}
		return false;
	}

	public static function IsAvailable( device : ScriptableDeviceComponentPS ) : Bool
	{
		return BasicAvailabilityTest( device );
	}

	public static function IsClearanceValid( clearance : Clearance ) : Bool
	{
		if( Clearance.IsInRange( clearance, DefaultActionsParametersHolder.GetInteractiveClearance() ) )
		{
			return true;
		}
		return false;
	}

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

}

class QuestPreviousStation extends ActionBool
{

	public function SetProperties()
	{
		actionName = 'QuestPreviousStation';
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( actionName, true, 'QuestPreviousStation', 'QuestPreviousStation' );
	}

}

class QuestDefaultStation extends ActionBool
{

	public function SetProperties()
	{
		actionName = 'QuestDefaultStation';
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( actionName, true, 'QuestDefaultStation', 'QuestDefaultStation' );
	}

}

class QuestToggleInteractivity extends ActionBool
{

	public function SetProperties( enable : Bool )
	{
		if( enable )
		{
			actionName = 'QuestEnableInteractivity';
		}
		else
		{
			actionName = 'QuestDisableInteractivity';
		}
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( actionName, enable, 'QuestToggleInteractivity', 'QuestToggleInteractivity' );
	}

}

class QuestMuteSounds extends ActionBool
{

	public function SetProperties( mute : Bool )
	{
		if( mute )
		{
			actionName = 'QuestMuteSounds';
		}
		else
		{
			actionName = 'QuestUnMuteSounds';
		}
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( actionName, mute, 'QuestMuteSounds', 'QuestMuteSounds' );
	}

}

class QuestSetChannel extends ActionInt
{

	public function SetProperties( channel : Int32 )
	{
		actionName = 'SetChannel';
		prop = DeviceActionPropertyFunctions.SetUpProperty_Int( 'SetChannel', channel );
	}

}

class QuickHackDistraction extends ActionBool
{

	public function SetProperties()
	{
		actionName = 'QuickHackDistraction';
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( 'QuickHackDistraction', true, 'LocKey#6990', 'LocKey#6990' );
	}

	public function SetProperties( interaction : CName )
	{
		actionName = interaction;
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( interaction, true, interaction, interaction );
	}

	public const override function GetInteractionIcon() : weak< ChoiceCaptionIconPart_Record >
	{
		return TweakDBInterface.GetChoiceCaptionIconPartRecord( T"ChoiceCaptionParts.DistractIcon" );
	}

}

class QuickHackAoeDamage extends ActionBool
{

	public function SetProperties()
	{
		actionName = 'QuickHackAoeDamage';
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( actionName, true, actionName, actionName );
	}

}

class QuickHackHighPitchNoise extends ActionBool
{

	public function SetProperties()
	{
		actionName = 'QuickHackHighPitchNoise';
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( actionName, true, actionName, actionName );
	}

}

class GlitchScreen extends ActionBool
{

	public function SetProperties( isGlitching : Bool, actionID : TweakDBID, programID : TweakDBID )
	{
		var currentDisplayName : CName;
		SetAttachedProgramTweakDBID( programID );
		SetObjectActionID( actionID );
		currentDisplayName = StringToName( LocKeyToString( GetObjectActionRecord().ObjectActionUI().Caption() ) );
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( 'GlitchScreen', isGlitching, currentDisplayName, currentDisplayName );
	}

	public const override function GetInteractionIcon() : weak< ChoiceCaptionIconPart_Record >
	{
		return super.GetInteractionIcon();
	}

	public static function IsDefaultConditionMet( device : ScriptableDeviceComponentPS, const context : ref< GetActionsContext > ) : Bool
	{
		if( IsAvailable( device ) && IsClearanceValid( context.clearance ) )
		{
			return true;
		}
		return false;
	}

	public static function IsAvailable( device : ScriptableDeviceComponentPS ) : Bool
	{
		if( device.IsDisabled() )
		{
			return false;
		}
		if( device.IsUnpowered() )
		{
			return false;
		}
		if( device.IsDeviceSecured() )
		{
			return false;
		}
		if( !( device.IsON() ) )
		{
			return false;
		}
		return true;
	}

	public static function IsClearanceValid( clearance : Clearance ) : Bool
	{
		if( Clearance.IsInRange( clearance, DefaultActionsParametersHolder.GetInteractiveClearance() ) )
		{
			return true;
		}
		return false;
	}

	public override function GetTweakDBChoiceRecord() : String
	{
		return super.GetTweakDBChoiceRecord();
	}

	public override function GetAttachedProgramTweakDBID() : TweakDBID
	{
		if( TDBID.IsValid( m_attachedProgram ) )
		{
			return m_attachedProgram;
		}
		else
		{
			return T"QuickHack.DeviceSuicideHack";
		}
	}

}

