Пример #1
0
 public ItemAlertSettings()
 {
     Enable          = true;
     ShowItemOnMap   = true;
     Crafting        = true;
     ShowText        = true;
     HideOthers      = false;
     PlaySound       = true;
     SoundVolume     = new RangeNode <int>(20, 0, 100);
     TextSize        = new RangeNode <int>(16, 10, 50);
     Rares           = true;
     Uniques         = true;
     Maps            = true;
     Currency        = true;
     DivinationCards = true;
     Jewels          = true;
     Rgb             = true;
     MinLinks        = new RangeNode <int>(5, 0, 6);
     MinSockets      = new RangeNode <int>(6, 0, 6);
     QualityItems    = new QualityItemsSettings();
     BorderSettings  = new BorderSettings();
     WithBorder      = true;
     WithSound       = false;
     Alternative     = true;
     //FilePath = string.Empty;
     FilePath = "config/thisBest.filter";
 }
Пример #2
0
 public ItemAlertSettings()
 {
     Enable = true;
     ShowItemOnMap = true;
     Crafting = true;
     ShowText = true;
     HideOthers = false;
     PlaySound = true;
     TextSize = new RangeNode<int>(16, 10, 50);
     Rares = true;
     Uniques = true;
     Maps = true;
     Currency = true;
     DivinationCards = true;
     Jewels = true;
     Rgb = true;
     MinLinks = new RangeNode<int>(5, 0, 6);
     MinSockets = new RangeNode<int>(6, 0, 6);
     QualityItems = new QualityItemsSettings();
     BorderSettings = new BorderSettings();
     WithBorder = false;
     WithSound = false;
     Alternative = true;
     FilePath = string.Empty;
 }
Пример #3
0
 public ItemAlertSettings()
 {
     Enable                  = true;
     ShowItemOnMap           = true;
     Crafting                = false;
     ShowText                = true;
     HideOthers              = true;
     PlaySound               = true;
     SoundVolume             = new RangeNode <int>(40, 0, 100);
     TextSize                = new RangeNode <int>(16, 10, 50);
     Rares                   = true;
     Uniques                 = true;
     Maps                    = true;
     Currency                = true;
     DivinationCards         = true;
     Jewels                  = true;
     Talisman                = true;
     Rgb                     = true;
     MinLinks                = new RangeNode <int>(5, 0, 6);
     MinSockets              = new RangeNode <int>(6, 0, 6);
     LootIcon                = new RangeNode <int>(7, 1, 14);
     DimOtherByPercent       = new RangeNode <int>(100, 1, 100);
     DimOtherByPercentToggle = true;
     LootIconBorderColor     = false;
     QualityItems            = new QualityItemsSettings();
     BorderSettings          = new BorderSettings();
     WithBorder              = true;
     WithSound               = false;
     ShouldUseFilterFile     = true;
     FilePath                = "config/NeverSink-SEMI-STRICT.filter";
 }
Пример #4
0
        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);
        }
Пример #5
0
 public ItemAlertSettings()
 {
     Enable         = true;
     ShowItemOnMap  = true;
     Crafting       = true;
     ShowText       = true;
     PlaySound      = true;
     TextSize       = new RangeNode <int>(25, 10, 50);
     Rares          = true;
     Uniques        = true;
     Maps           = true;
     Currency       = true;
     Rgb            = true;
     MinLinks       = new RangeNode <int>(5, 0, 6);
     MinSockets     = new RangeNode <int>(6, 0, 6);
     QualityItems   = new QualityItemsSettings();
     BorderSettings = new BorderSettings();
 }
        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);
        }
Пример #7
0
        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
        }