class ShowUIWarningEffector extends Effector
{
	var m_duration : Float;
	var m_primaryText : String;
	var m_secondaryText : String;
	var m_owner : weak< GameObject >;

	protected override function Initialize( record : TweakDBID, game : GameInstance, parentRecord : TweakDBID )
	{
		m_duration = TweakDBInterface.GetFloat( record + T".duration", 2.0 );
		m_primaryText = TweakDBInterface.GetString( record + T".primaryText", "" );
		m_secondaryText = TweakDBInterface.GetString( record + T".secondaryText", "" );
	}

	protected override function ActionOn( owner : GameObject )
	{
		var finalString : String;
		var warningMsg : SimpleScreenMessage;
		finalString = ( GetLocalizedText( m_primaryText ) + " " ) + GetLocalizedText( m_secondaryText );
		warningMsg.isShown = true;
		warningMsg.duration = m_duration;
		warningMsg.message = finalString;
		GameInstance.GetBlackboardSystem( owner.GetGame() ).Get( GetAllBlackboardDefs().UI_Notifications ).SetVariant( GetAllBlackboardDefs().UI_Notifications.WarningMessage, warningMsg, true );
	}

}

