public bool IsWorthAlertingPlayer(HashSet <string> currencyNames, ItemAlertSettings settings) { if (rarity == ItemRarity.Rare && settings.Rares) { return(true); } if (rarity == ItemRarity.Unique && settings.Uniques) { return(true); } if ((mapLevel > 0 || isVaalFragment) && settings.Maps) { return(true); } if (numLinks >= settings.MinLinks) { return(true); } if (isCurrency && settings.Currency) { if (currencyNames == null) { if (!Name.Contains("Portal") && Name.Contains("Wisdom")) // TODO it's need to check { return(true); } } else if (currencyNames.Contains(Name)) { return(true); } } if (isRgb && settings.Rgb) { return(true); } if (settings.QualityItems.Enable) { QualityItemsSettings qualitySettings = settings.QualityItems; if (qualitySettings.Weapon.Enable && isWeapon && quality >= qualitySettings.Weapon.MinQuality || qualitySettings.Armour.Enable && isArmour && quality >= qualitySettings.Armour.MinQuality || qualitySettings.Flask.Enable && isFlask && quality >= qualitySettings.Flask.MinQuality || qualitySettings.SkillGem.Enable && isSkillGem && quality >= qualitySettings.SkillGem.MinQuality) { return(true); } } return(numSockets >= settings.MinSockets || isCraftingBase); }
public SettingsHub() { MenuSettings = new MenuSettings(); DpsMeterSettings = new DpsMeterSettings(); MapIconsSettings = new MapIconsSettings(); ItemAlertSettings = new ItemAlertSettings(); AdvancedTooltipSettings = new AdvancedTooltipSettings(); MonsterTrackerSettings = new MonsterTrackerSettings(); PoiTrackerSettings = new PoiTrackerSettings(); PreloadAlertSettings = new PreloadAlertSettings(); XpRateSettings = new XpRateSettings(); HealthBarSettings = new HealthBarSettings(); InventoryPreviewSettings = new InventoryPreviewSettings(); KillCounterSettings = new KillCounterSettings(); }
public bool ShouldAlert(HashSet <string> currencyNames, ItemAlertSettings settings) { Mods mods = _item.GetComponent <Mods>(); QualityItemsSettings qualitySettings = settings.QualityItems; rarity = mods.ItemRarity; if (_item.HasComponent <Quality>()) { quality = _item.GetComponent <Quality>().ItemQuality; } alertText = string.Concat(quality > 0 ? "Superior " : String.Empty, _name); if (settings.Maps && (_item.HasComponent <Map>() || _item.Path.Contains("VaalFragment"))) { borderWidth = 1; return(true); } if (settings.Currency && _item.Path.Contains("Currency")) { color = HudSkin.CurrencyColor; return(currencyNames?.Contains(_name) ?? !_name.Contains("Wisdom") && !_name.Contains("Portal")); } if (settings.DivinationCards && _item.Path.Contains("DivinationCards")) { color = HudSkin.DivinationCardColor; return(true); } if (settings.Talisman && _item.Path.Contains("Talisman")) { color = HudSkin.TalismanColor; return(true); } Sockets sockets = _item.GetComponent <Sockets>(); if (sockets.LargestLinkSize >= settings.MinLinks) { if (sockets.LargestLinkSize == 6) { alertIcon = 3; } return(true); } if (IsCraftingBase(mods.ItemLevel)) { alertIcon = 2; return(true); } if (sockets.NumberOfSockets >= settings.MinSockets) { alertIcon = 0; return(true); } if (settings.Rgb && sockets.IsRGB) { alertIcon = 1; return(true); } if (settings.Jewels && _item.Path.Contains("Jewels")) { return(true); } switch (rarity) { case ItemRarity.Rare: return(settings.Rares); case ItemRarity.Unique: return(settings.Uniques); } if (qualitySettings.Enable) { if (qualitySettings.Flask.Enable && _item.HasComponent <Flask>()) { return(quality >= qualitySettings.Flask.MinQuality); } if (qualitySettings.SkillGem.Enable && _item.HasComponent <SkillGem>()) { color = HudSkin.SkillGemColor; return(quality >= qualitySettings.SkillGem.MinQuality); } if (qualitySettings.Weapon.Enable && _item.HasComponent <Weapon>()) { return(quality >= qualitySettings.Weapon.MinQuality); } if (qualitySettings.Armour.Enable && _item.HasComponent <Armour>()) { return(quality >= qualitySettings.Armour.MinQuality); } } return(false); }
public PoeFilterVisitor(IParseTree tree, GameController gameController, ItemAlertSettings settings) { this.tree = tree; this.gameController = gameController; this.settings = settings; }
public bool ShouldAlert(HashSet <string> currencyNames, ItemAlertSettings settings) { Mods mods = _item.GetComponent <Mods>(); QualityItemsSettings qualitySettings = settings.QualityItems; rarity = mods.ItemRarity; // set rarity if (_item.HasComponent <Quality>()) { quality = _item.GetComponent <Quality>().ItemQuality; // update quality variable } alertText = string.Concat(quality > 0 ? "Superior " : String.Empty, _name); // Check if Map/Vaal Frag if (settings.Maps && (_item.HasComponent <Map>() || _item.Path.Contains("VaalFragment"))) { alertWidth = 1; return(true); } // Check if Currency if (settings.Currency && _item.Path.Contains("Currency")) { color = HudSkin.CurrencyColor; return(currencyNames != null ? currencyNames.Contains(_name): (!_name.Contains("Wisdom") && !_name.Contains("Portal"))); } // Check if DivinationCard if (settings.DivinationCards && _item.Path.Contains("DivinationCards")) { color = HudSkin.DivinationCardColor; return(true); } Sockets sockets = _item.GetComponent <Sockets>(); // Check link REQ. if (sockets.LargestLinkSize >= settings.MinLinks) { if (sockets.LargestLinkSize == 6) // If 6 link change icon { alertIcon = 3; } return(true); } // Check if Crafting Base if (IsCraftingBase(mods.ItemLevel)) { alertIcon = 2; return(true); } // Check # socket REQ. if (sockets.NumberOfSockets >= settings.MinSockets) { alertIcon = 0; return(true); } // RGB if (settings.Rgb && sockets.IsRGB) { alertIcon = 1; return(true); } // Check if Jewel if (settings.Jewels && _item.Path.Contains("Jewels")) { return(true); } // meets rarity conidtions switch (rarity) { case ItemRarity.Rare: return(settings.Rares); case ItemRarity.Unique: return(settings.Uniques); default: break; } // Other (no icon change) if (qualitySettings.Enable) { if (qualitySettings.Flask.Enable && _item.HasComponent <Flask>()) { return(quality >= qualitySettings.Flask.MinQuality); } else if (qualitySettings.SkillGem.Enable && _item.HasComponent <SkillGem>()) { color = HudSkin.SkillGemColor; return(quality >= qualitySettings.SkillGem.MinQuality); } else if (qualitySettings.Weapon.Enable && _item.HasComponent <Weapon>()) { return(quality >= qualitySettings.Weapon.MinQuality); } else if (qualitySettings.Armour.Enable && _item.HasComponent <Armour>()) { return(quality >= qualitySettings.Armour.MinQuality); } } return(false); // Meets no checks }
public bool ShouldAlert(HashSet<string> currencyNames, ItemAlertSettings settings) { Mods mods = _item.GetComponent<Mods>(); QualityItemsSettings qualitySettings = settings.QualityItems; rarity = mods.ItemRarity; // set rarity if (_item.HasComponent<Quality>()) { quality = _item.GetComponent<Quality>().ItemQuality; // update quality variable } alertText = string.Concat(quality > 0 ? "Superior " : String.Empty, _name); // Check if Map/Vaal Frag if (settings.Maps && (_item.HasComponent<Map>() || _item.Path.Contains("VaalFragment"))) { borderWidth = 1; return true; } // Check if Currency if (settings.Currency && _item.Path.Contains("Currency")) { color = HudSkin.CurrencyColor; return currencyNames?.Contains(_name) ?? (!_name.Contains("Wisdom") && !_name.Contains("Portal")); } // Check if DivinationCard if (settings.DivinationCards && _item.Path.Contains("DivinationCards")) { color = HudSkin.DivinationCardColor; return true; } Sockets sockets = _item.GetComponent<Sockets>(); // Check link REQ. if (sockets.LargestLinkSize >= settings.MinLinks) { if (sockets.LargestLinkSize == 6) // If 6 link change icon { alertIcon = 3; } return true; } // Check if Crafting Base if (IsCraftingBase(mods.ItemLevel)) { alertIcon = 2; return true; } // Check # socket REQ. if (sockets.NumberOfSockets >= settings.MinSockets) { alertIcon = 0; return true; } // RGB if (settings.Rgb && sockets.IsRGB) { alertIcon = 1; return true; } // Check if Jewel if (settings.Jewels && _item.Path.Contains("Jewels")) { return true; } // meets rarity conidtions switch (rarity) { case ItemRarity.Rare: return settings.Rares; case ItemRarity.Unique: return settings.Uniques; } // Other (no icon change) if (qualitySettings.Enable) { if (qualitySettings.Flask.Enable && _item.HasComponent<Flask>()) { return (quality >= qualitySettings.Flask.MinQuality); } else if (qualitySettings.SkillGem.Enable && _item.HasComponent<SkillGem>()) { color = HudSkin.SkillGemColor; return (quality >= qualitySettings.SkillGem.MinQuality); } else if (qualitySettings.Weapon.Enable && _item.HasComponent<Weapon>()) { return (quality >= qualitySettings.Weapon.MinQuality); } else if (qualitySettings.Armour.Enable && _item.HasComponent<Armour>()) { return (quality >= qualitySettings.Armour.MinQuality); } } return false; // Meets no checks }