Example #1
0
        public static void LevelPane(Rect inRect, CompVampire compVampire)
        {
            Rect rectLevelBar = new Rect(inRect.x, inRect.y, inRect.width, HeaderSize * 0.6f);

            DrawLevelBar(rectLevelBar, compVampire);

            //rectPointsAvail.yMax + 3f
            //[||||||||||||||||||||||||||||||||||||||||||||||||||||||||||]

            string levelText       = "ROMV_Level".Translate().CapitalizeFirst() + " " + compVampire.Level.ToString();
            float  levelTextLength = Text.CalcSize(levelText).x;
            Rect   rectLevel       = new Rect(inRect.x + (inRect.width / 2) - (levelTextLength / 2), rectLevelBar.yMax + 3, inRect.width, TextSize);

            Text.Font = GameFont.Tiny;
            Widgets.Label(rectLevel, levelText);
            Text.Font = GameFont.Small;
            //                           Level 1


            string pointsAvailableText       = compVampire.AbilityPoints + " " + "ROMV_PointsAvailable".Translate();
            float  pointsAvailableTextLength = Text.CalcSize(pointsAvailableText).x;
            Rect   rectPointsAvail           = new Rect(inRect.x + (inRect.width / 2) - (pointsAvailableTextLength / 2), rectLevel.yMax, inRect.width, TextSize);

            Text.Font = GameFont.Tiny;
            Widgets.Label(rectPointsAvail, pointsAvailableText);
            Text.Font = GameFont.Small;

            //0 points available

            if (DebugSettings.godMode)
            {
                Rect rectDebugPlus = new Rect(rectLevelBar.xMax - 30, rectLevelBar.yMin, inRect.width * 0.1f, TextSize);
                if (Widgets.ButtonText(rectDebugPlus, "+"))
                {
                    compVampire.Notify_LevelUp(false);
                }
                if (compVampire.Level > 0)
                {
                    Rect rectDebugReset = new Rect(rectDebugPlus.x, rectDebugPlus.yMax + 1, rectDebugPlus.width, TextSize);
                    if (Widgets.ButtonText(rectDebugReset, "~"))
                    {
                        compVampire.Notify_ResetAbilities();
                    }
                }
            }
        }
        public static void LevelPane(Rect inRect, CompVampire compVampire)
        {
            Rect rectLevel = new Rect(inRect.x, inRect.y, inRect.width * 0.7f, TextSize);

            Text.Font = GameFont.Small;
            Widgets.Label(rectLevel, "ROMV_Level".Translate().CapitalizeFirst() + " " + compVampire.Level.ToString());
            Text.Font = GameFont.Small;

            if (DebugSettings.godMode)
            {
                Rect rectDebugPlus = new Rect(rectLevel.xMax, inRect.y, inRect.width * 0.3f, TextSize);
                if (Widgets.ButtonText(rectDebugPlus, "+"))
                {
                    compVampire.Notify_LevelUp(false);
                }
                if (compVampire.Level > 0)
                {
                    Rect rectDebugReset = new Rect(rectDebugPlus.x, rectDebugPlus.yMax + 1, rectDebugPlus.width, TextSize);
                    if (Widgets.ButtonText(rectDebugReset, "~"))
                    {
                        compVampire.Notify_ResetAbilities();
                    }
                }
            }

            //Level 0

            Rect rectPointsAvail = new Rect(inRect.x, rectLevel.yMax, inRect.width, TextSize);

            Text.Font = GameFont.Tiny;
            Widgets.Label(rectPointsAvail, compVampire.AbilityPoints + " " + "ROMV_PointsAvailable".Translate());
            Text.Font = GameFont.Small;

            //0 points available

            Rect rectLevelBar = new Rect(rectPointsAvail.x, rectPointsAvail.yMax + 3f, inRect.width - 10f, HeaderSize * 0.6f);

            DrawLevelBar(rectLevelBar, compVampire);

            //[|||||||||||||]
        }