Esempio n. 1
0
		void processDetectedItem(ItemInfoIdentArgs e, bool allowAutoClipboard = false)
		{
			if (virindiTankLootRuleProcessor != null)
			{
				try
				{
					if (allowAutoClipboard && Settings.SettingsManager.ItemInfoOnIdent.AutoClipboard.Value)
					{
						if (virindiTankLootRuleProcessor.GetLootRuleInfoFromItemInfo(e, processItemInfoCallbackWithAutoClipboard))
							return;
					}
					else
					{
						if (virindiTankLootRuleProcessor.GetLootRuleInfoFromItemInfo(e, processItemInfoCallback))
							return;
					}
				}
				catch (FileNotFoundException) { virindiTankLootRuleProcessor = null; /* Eat this error (Virindi Tank isn't loaded) */ }
				catch (Exception ex) { Debug.LogException(ex); }
			}

			if (!e.DontShowIfItemHasNoRule)
			{
				ItemInfo itemInfo = new ItemInfo(e.IdentifiedItem);

				CoreManager.Current.Actions.AddChatText(itemInfo.ToString(), 14, Settings.SettingsManager.Misc.OutputTargetWindow.Value);

				if (allowAutoClipboard && Settings.SettingsManager.ItemInfoOnIdent.AutoClipboard.Value)
				{
					try
					{
						System.Windows.Forms.Clipboard.SetDataObject(itemInfo.ToString());
					}
					catch
					{
					}
				}
			}
		}
Esempio n. 2
0
		void doProcessItemInfoCallback(ItemInfoIdentArgs e, bool itemPassesLootRule, bool isSalvage, string lootRuleName, bool clipboardInfo = false)
		{
			if (e.DontShowIfIsSalvageRule && isSalvage)
				return;

			if (e.DontShowIfItemHasNoRule && string.IsNullOrEmpty(lootRuleName))
				return;

			//<Tell:IIDString:221112:-2024140046>(Epics)<\\Tell>

			System.Text.StringBuilder sb = new System.Text.StringBuilder();

			sb.Append(@"<Tell:IIDString:221112:" + e.IdentifiedItem.Id + @">");

			sb.Append(itemPassesLootRule ? "+" : "-");

			if (!String.IsNullOrEmpty(lootRuleName))
				sb.Append("(" + lootRuleName + ")");

			sb.Append(@"<\\Tell>");

			sb.Append(" ");

			ItemInfo itemInfo = new ItemInfo(e.IdentifiedItem);

			sb.Append(itemInfo);

			CoreManager.Current.Actions.AddChatText(sb.ToString(), 14, Settings.SettingsManager.Misc.OutputTargetWindow.Value);

			if (clipboardInfo && Settings.SettingsManager.ItemInfoOnIdent.AutoClipboard.Value)
			{
				try
				{
					System.Text.StringBuilder clipboardBuilder = new System.Text.StringBuilder();

					clipboardBuilder.Append(itemPassesLootRule ? "+" : "-");

					if (!String.IsNullOrEmpty(lootRuleName))
						clipboardBuilder.Append("(" + lootRuleName + ")");

					clipboardBuilder.Append(" ");

					clipboardBuilder.Append(itemInfo.ToString());

					System.Windows.Forms.Clipboard.SetDataObject(clipboardBuilder.ToString());
				}
				catch
				{
				}
			}
		}