예제 #1
0
        private void DrawInfoPanel(TransformationDefinition def)
        {
            DBTPlayer dbtPlayer = Main.LocalPlayer.GetModPlayer <DBTPlayer>();


            bool hasOverload = false;

            if (!InfoPanelOpened)
            {
                InfoPanelOpened = true;
                InfoPanel       = InitializeImage(InfoPanelTexture, -12, 294, BackPanel);
                InfoPanel.Width.Set(InfoPanelTexture.Width, 0f);
                InfoPanel.Height.Set(InfoPanelTexture.Height, 0f);

                if (def.GetUnmasteredOverloadGrowthRate(dbtPlayer) > 0)
                {
                    hasOverload = true;
                }

                formName = InitializeText(def.DisplayName, 12, 8, 0.8f, def.Appearance.GeneralColor.Value, InfoPanel);

                if (def.GetMasteredKiDrain(dbtPlayer) <= 0 && def.GetUnmasteredKiDrain(dbtPlayer) != 0)
                {
                    formStats = InitializeText("Stats: \nDamage: " + (def.GetDamageMultiplier(dbtPlayer) - 1f) * 100 + "% \nSpeed: "
                                               + (def.GetSpeedMultiplier(dbtPlayer) - 1f) * 100 + "% \nKi Drain: " + def.GetUnmasteredKiDrain(dbtPlayer) * 60 + "/s"
                                               + (hasOverload ? "\nOverload: While Unmastered = " + def.GetUnmasteredOverloadGrowthRate(dbtPlayer) * 60
                                                  + "/s + While Mastered = " + def.GetMasteredOverloadGrowthRate(dbtPlayer) * 60 + "/s" : null), 12, 28, 0.6f, Color.White, InfoPanel);
                }
                else
                {
                    if (def.GetUnmasteredKiDrain(dbtPlayer) <= 0)
                    {
                        formStats = InitializeText("Stats: \nDamage: " + (def.GetDamageMultiplier(dbtPlayer) - 1f) * 100 + "% \nSpeed: " +
                                                   (def.GetSpeedMultiplier(dbtPlayer) - 1f) * 100 + "%" + (hasOverload ? "\nOverload: While Unmastered = " +
                                                                                                           def.GetUnmasteredOverloadGrowthRate(dbtPlayer) * 60 + "/s + While Mastered = " +
                                                                                                           def.GetMasteredOverloadGrowthRate(dbtPlayer) * 60 + "/s" : null), 12, 28, 0.6f, Color.White, InfoPanel);
                    }
                    else
                    {
                        formStats = InitializeText("Stats: \nDamage: " + (def.GetDamageMultiplier(dbtPlayer) - 1f) * 100 + "% \nSpeed: "
                                                   + (def.GetSpeedMultiplier(dbtPlayer) - 1f) * 100 + "% \nKi Drain: While Unmastered = " + def.GetUnmasteredKiDrain(dbtPlayer) * 60
                                                   + "/s + While Mastered = " + def.GetMasteredKiDrain(dbtPlayer) * 60 + "/s" + (hasOverload ? "\nOverload: While Unmastered = "
                                                                                                                                 + def.GetUnmasteredOverloadGrowthRate(dbtPlayer) * 60 + "/s + While Mastered = " + def.GetMasteredOverloadGrowthRate(dbtPlayer) * 60
                                                                                                                                 + "/s" : null), 12, 28, 0.6f, Color.White, InfoPanel);
                    }
                }
                formUnlock = InitializeText(def.DisplayName, 30, 16, 0f, Color.White, InfoPanel);
            }
            else
            {
                InfoPanel  = null;
                formName   = null;
                formStats  = null;
                formUnlock = null;

                InfoPanelOpened = false;
                DrawInfoPanel(def);
            }
        }