コード例 #1
0
        public LevelDifficultyIcons GetDifficultyIconsNew(int playerLevel, int targetLevel)
        {
            LevelDifficultyIcons levelDifficultyIconSettings = null;

            // Original condition: re-enable to hide level difficulty icons when level scaling is on
            // if (GameState.Option.LevelScaling == LevelScalingOption.None && !GameState.Option.ShowDifficultyIndicators)
            if (!GameState.Option.ShowDifficultyIndicators)
            {
                return(null);
            }

            int num  = int.MinValue;
            int num1 = targetLevel - playerLevel;

            for (int i = 0; i < this.LevelDifficultyIconSettings.Length; i++)
            {
                int levelDifference = this.LevelDifficultyIconSettings[i].LevelDifference;
                if (num1 >= levelDifference && levelDifference > num)
                {
                    num = levelDifference;
                    levelDifficultyIconSettings = this.LevelDifficultyIconSettings[i];
                }
            }

            return(levelDifficultyIconSettings);
        }
コード例 #2
0
        public static string GetLevelDifficultySpriteNew(object arg)
        {
            if (arg == null)
            {
                return(string.Empty);
            }
            int            characterLevel = ((IHasCharacterClasses)arg).GetCharacterLevel();
            CharacterStats component      = ComponentUtils.GetComponent <CharacterStats>(GameState.PlayerCharacter);

            if (component)
            {
                //Game.Console.AddMessage("Level diff is: Enemy: " + characterLevel + " and Player: " + component.Level);
                LevelDifficultyIcons difficultyIcons = GlobalGameSettingsGameData.Instance.CombatSettingsComponent.GetDifficultyIcons(component.Level, characterLevel);
                if (difficultyIcons != null)
                {
                    return(difficultyIcons.IconName);
                }
            }
            return(string.Empty);
        }
コード例 #3
0
        public LevelDifficultyIcons GetDifficultyIconsNew(int playerLevel, int targetLevel)
        {
            if (!ConfigHasBeenInit)
            {
                ConfigHasBeenInit = true;
                UseMod            = UserConfig.GetValueAsBool("DifficultyIconsMod", "enableQuestIcons");
            }

            LevelDifficultyIcons levelDifficultyIconSettings = null;

            // Original condition: re-enable to hide level difficulty icons when level scaling is on
            if (!UseMod)
            {
                if (GameState.Option.LevelScaling == LevelScalingOption.None &&
                    !GameState.Option.ShowDifficultyIndicators)
                {
                    return(null);
                }
            }

            if (!GameState.Option.ShowDifficultyIndicators)
            {
                return(null);
            }

            int num  = int.MinValue;
            int num1 = targetLevel - playerLevel;

            for (int i = 0; i < this.LevelDifficultyIconSettings.Length; i++)
            {
                int levelDifference = this.LevelDifficultyIconSettings[i].LevelDifference;
                if (num1 >= levelDifference && levelDifference > num)
                {
                    num = levelDifference;
                    levelDifficultyIconSettings = this.LevelDifficultyIconSettings[i];
                }
            }

            return(levelDifficultyIconSettings);
        }