コード例 #1
0
            /*
             * private static void Prefix(Skills __instance, Skills.SkillType skillType, float factor = 1f)
             * {
             *
             *
             * }*/

            private static void Postfix(Skills __instance, Skills.SkillType skillType, float factor = 1f)
            {
                if (Settings.isEnabled("Player") && Settings.getBool("Player", "experienceGainedNotifications"))
                {
                    Skills.Skill skill   = __instance.GetSkill(skillType);
                    float        percent = skill.m_accumulator / (skill.GetNextLevelRequirement() / 100);
                    __instance.m_player.Message(MessageHud.MessageType.TopLeft, skill.m_info.m_skill + " [" + Helper.tFloat(skill.m_accumulator, 2) + "/" + Helper.tFloat(skill.GetNextLevelRequirement(), 2) + "] (" + Helper.tFloat(percent, 0) + "%)", 0, skill.m_info.m_icon);
                }
            }
コード例 #2
0
 private static void Postfix(Skills __instance, Skills.SkillType skillType, float factor = 1f)
 {
     if (Configuration.Current.Hud.IsEnabled && Configuration.Current.Hud.experienceGainedNotifications)
     {
         Skills.Skill skill   = __instance.GetSkill(skillType);
         float        percent = skill.m_accumulator / (skill.GetNextLevelRequirement() / 100);
         __instance.m_player.Message(MessageHud.MessageType.TopLeft, skill.m_info.m_skill + " [" + Helper.tFloat(skill.m_accumulator, 2) + "/" + Helper.tFloat(skill.GetNextLevelRequirement(), 2) + "] (" + Helper.tFloat(percent, 0) + "%)", 0, skill.m_info.m_icon);
     }
 }
コード例 #3
0
        public static void Show(Skills.Skill skill, float factor)
        {
            //Debug.Log($"skill level: {skill.m_level}");
            if (skill.m_level >= 100)
            {
                return;
            }

            string notif_str = $"$skill_{ skill.m_info.m_skill.ToString().ToLower()}: {skill.GetLevelPercentage():P2}";

            if (Main.extendedXPNotification.Value)
            {
                float acc = (float)Math.Round(skill.m_accumulator * 100f) / 100f;
                float max = (float)Math.Round(skill.GetNextLevelRequirement() * 100f) / 100f;
                notif_str += $" (+{ skill.m_info.m_increseStep* factor})\n[{acc}/{max}]";
            }

            string str = Localization.instance.Localize(notif_str);

            MessageHud.instance.ShowMessage(MessageHud.MessageType.TopLeft, $"<size={Main.notificationTextSize.Value}>{str}</size>");
        }