class UIMenuNotificationViewData extends GenericNotificationViewData
{
	var animContainer : weak< inGameMenuAnimContainer >;
	var notificationType : UIMenuNotificationType;

	public override function CanMerge( data : GenericNotificationViewData ) : Bool
	{
		return ( ( notificationType == ( ( UIMenuNotificationViewData )( data ) ).notificationType ) ? ( ( ( animContainer ) ? ( animContainer.m_animProxy.IsPlaying() ) : ( true ) ) ) : ( false ) );
	}

	public override function OnRemoveNotification( data : IScriptable ) : Bool
	{
		return true;
	}

}

class UIMenuNotificationQueue extends gameuiGenericNotificationGameController
{
	private editable var m_duration : Float;
	default m_duration = 5.0f;

	public override function GetShouldSaveState() : Bool
	{
		return false;
	}

	public override function GetID() : Int32
	{
		return ( ( Int32 )( GenericNotificationType.VendorNotification ) );
	}

	protected event OnUINotification( evt : UIMenuNotificationEvent )
	{
		var notificationData : gameuiGenericNotificationData;
		var userData : UIMenuNotificationViewData;
		var requirement : SItemStackRequirementData;
		userData = new UIMenuNotificationViewData;
		switch( evt.m_notificationType )
		{
			case UIMenuNotificationType.VendorNotEnoughMoney:
				userData.title = "LocKey#54028";
			break;
			case UIMenuNotificationType.VNotEnoughMoney:
				userData.title = "LocKey#54029";
			break;
			case UIMenuNotificationType.VendorRequirementsNotMet:
				requirement = ( ( SItemStackRequirementData )( ( ( VendorRequirementsNotMetNotificationData )evt.m_additionalInfo ).m_data ) );
			userData.title = ( ( ( GetLocalizedText( "UI-Notifications-RequirementNotMet" ) + " " ) + IntToString( RoundF( requirement.requiredValue ) ) ) + " " ) + GetLocalizedText( UILocalizationHelper.GetStatNameLockey( RPGManager.GetStatRecord( requirement.statType ) ) );
			break;
			case UIMenuNotificationType.InventoryActionBlocked:
				userData.title = "UI-Notifications-ActionBlocked";
			break;
			case UIMenuNotificationType.CraftingNoPerks:
				break;
			case UIMenuNotificationType.CraftingNotEnoughMaterial:
				userData.title = "UI-Notifications-CraftingNotEnoughMaterials";
			break;
			case UIMenuNotificationType.CraftingAmmoCap:
				userData.title = "LocKey#81496";
			break;
			case UIMenuNotificationType.UpgradingLevelToLow:
				userData.title = "LocKey#52451";
			break;
			case UIMenuNotificationType.NoPerksPoints:
				userData.title = "UI-Notifications-NoPerksPoint";
			break;
			case UIMenuNotificationType.PerksLocked:
				userData.title = "UI-Notifications-PerksLocked";
			break;
			case UIMenuNotificationType.MaxLevelPerks:
				userData.title = "UI-Notifications-MaxPerks";
			break;
			case UIMenuNotificationType.NoAttributePoints:
				userData.title = "UI-Notifications-NoAttributesPoint";
			break;
			case UIMenuNotificationType.InCombat:
				userData.title = "LocKey#50792";
			break;
			case UIMenuNotificationType.InCombatExplicit:
				userData.title = "LocKey#95062";
			break;
			case UIMenuNotificationType.CraftingQuickhack:
				userData.title = "LocKey#78498";
			break;
			case UIMenuNotificationType.PlayerReqLevelToLow:
				userData.title = "LocKey#87106";
			break;
			case UIMenuNotificationType.InventoryNoFreeSlot:
				userData.title = "LocKey#94263";
			break;
			case UIMenuNotificationType.FaceUnequipBlocked:
				userData.title = "LocKey#94072";
			break;
			case UIMenuNotificationType.TutorialUnequipBlocked:
				userData.title = "LocKey#94073";
			break;
			case UIMenuNotificationType.NoJunkToDisassemble:
				userData.title = "LocKey#96058";
			break;
		}
		userData.soundEvent = 'QuestSuccessPopup';
		userData.soundAction = 'OnOpen';
		userData.animContainer = evt.m_animContainer;
		userData.notificationType = evt.m_notificationType;
		notificationData.time = m_duration;
		notificationData.widgetLibraryItemName = 'popups_side';
		notificationData.notificationData = userData;
		AddNewNotificationData( notificationData );
	}

	protected event OnUINotificationRemove( evt : UINotificationRemoveEvent )
	{
		RemoveNotification( evt );
	}

}

class UINotificationRemoveEvent extends Event
{
}

class UINotification extends GenericNotificationController
{

	public override function SetNotificationData( notificationData : GenericNotificationViewData )
	{
		var menuNotificationData : UIMenuNotificationViewData;
		super.SetNotificationData( notificationData );
		menuNotificationData = ( ( UIMenuNotificationViewData )( notificationData ) );
		menuNotificationData.animContainer.m_animProxy = PlayLibraryAnimationOnAutoSelectedTargets( 'notification_intro', GetRootWidget() );
	}

}

class UIMenuNotificationEvent extends Event
{
	var m_notificationType : UIMenuNotificationType;
	var m_additionalInfo : Variant;
	var m_animContainer : weak< inGameMenuAnimContainer >;
}

class VendorRequirementsNotMetNotificationData
{
	var m_data : SItemStackRequirementData;
}

enum UIMenuNotificationType
{
	VendorNotEnoughMoney = 0,
	VNotEnoughMoney = 1,
	VendorRequirementsNotMet = 2,
	InventoryActionBlocked = 3,
	CraftingNoPerks = 4,
	CraftingNotEnoughMaterial = 5,
	UpgradingLevelToLow = 6,
	NoPerksPoints = 7,
	PerksLocked = 8,
	MaxLevelPerks = 9,
	NoAttributePoints = 10,
	InCombat = 11,
	InCombatExplicit = 12,
	CraftingQuickhack = 13,
	CraftingAmmoCap = 14,
	PlayerReqLevelToLow = 15,
	InventoryNoFreeSlot = 16,
	FaceUnequipBlocked = 17,
	TutorialUnequipBlocked = 18,
	NoJunkToDisassemble = 19,
}

