コード例 #1
0
        public override void ParseForInfo()
        {
            base.ParseForInfo();
            DisplayName = DisplayName.ToUpperInvariant();

            if (Object.TryGetValue(out FName accoladeType, "AccoladeType") &&
                accoladeType.Text.Equals("EFortAccoladeType::Medal", StringComparison.OrdinalIgnoreCase))
            {
                _screenLayer = false;
            }

            if (Object.TryGetValue(out FGameplayTagContainer poiLocations, "POILocations") &&
                Utils.TryLoadObject("FortniteGame/Content/Quests/QuestIndicatorData.QuestIndicatorData", out UObject uObject) &&
                uObject.TryGetValue(out FStructFallback[] challengeMapPoiData, "ChallengeMapPoiData"))
            {
                foreach (var location in poiLocations)
                {
                    var locationName = "Unknown";
                    foreach (var poi in challengeMapPoiData)
                    {
                        if (!poi.TryGetValue(out FStructFallback locationTag, "LocationTag") || !locationTag.TryGetValue(out FName tagName, "TagName") ||
                            !tagName.Text.Equals(location.Text, StringComparison.OrdinalIgnoreCase) || !poi.TryGetValue(out FText text, "Text"))
                        {
                            continue;
                        }

                        locationName = text.Text;
                        break;
                    }

                    _statistics.Add(new IconStat(Utils.GetLocalizedResource("", "B0C091D7409B1657423C5F97E9CF4C77", "LOCATION NAME"), locationName.ToUpper()));
                }
            }

            if (Object.TryGetValue(out FStructFallback maxStackSize, "MaxStackSize"))
            {
                if (maxStackSize.TryGetValue(out float v, "Value") && v > -1)
                {
                    _statistics.Add(new IconStat("Max Stack", v));
                }
                else if (TryGetCurveTableStat(maxStackSize, out var s))
                {
                    _statistics.Add(new IconStat("Max Stack", s));
                }
            }
コード例 #2
0
        /// <summary>
        /// Checks the specified value whether or not can be completed by this item.
        /// </summary>
        /// <param name="value">The target value.</param>
        /// <param name="matchingOption">The option to specify matching rule.</param>
        /// <returns>True if the specified value can be completed by this item, otherwise false.</returns>
        public bool IsMatch(string value, MatchingOption matchingOption)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            if (matchingOption == null)
            {
                matchingOption = new MatchingOption();
            }

            if (matchingOption.Mode == MatchingMode.Partial)
            {
                return(DisplayName.ToUpperInvariant().Contains(value.ToUpperInvariant()));
            }
            else
            {
                return(DisplayName.ToUpperInvariant().StartsWith(value.ToUpperInvariant(), StringComparison.OrdinalIgnoreCase));
            }
        }