Ejemplo n.º 1
0
        protected override void DisplayInternal(ISpriteManager spriteManager, IDataRogueControl control, ISystemContainer systemContainer, List <MapCoordinate> playerFov)
        {
            var display = control as MenuActionsControl;

            if (display.AvailableActions.Count > 1)
            {
                BLT.Font("text");
                BLTLayers.Set(BLTLayers.Text, display.ActivityIndex);

                BLT.Color(display.Color);

                var x = control.Position.X;
                var y = control.Position.Y;

                BLT.Print(x, y, "[[");
                x += BLT.Measure("[[").Width;

                foreach (var action in display.AvailableActions)
                {
                    if (action == display.SelectedAction)
                    {
                        BLT.Color(display.SelectedColor);
                    }
                    BLT.Print(x, y, action.ToString());
                    BLT.Color("");

                    x += BLT.Measure(action.ToString()).Width;
                    BLT.Print(x, y, "|");
                    x += BLT.Measure("|").Width;
                }

                x -= BLT.Measure("|").Width;
                BLT.Print(x, y, "]]");
            }
        }
Ejemplo n.º 2
0
        protected override void DisplayInternal(ISpriteManager spriteManager, IDataRogueControl control, ISystemContainer systemContainer, List <MapCoordinate> playerFov)
        {
            var x       = control.Position.X;
            var y       = control.Position.Y;
            var display = control as IDataRogueInfoControl;

            var player = systemContainer.PlayerSystem.Player;

            var ac           = Math.Floor(systemContainer.EventSystem.GetStat(player, "AC"));
            var ev           = Math.Floor(systemContainer.EventSystem.GetStat(player, "EV"));
            var sh           = Math.Floor(systemContainer.EventSystem.GetStat(player, "SH"));
            var currentAegis = Math.Floor(systemContainer.EventSystem.GetStat(player, "CurrentAegisLevel"));
            var aegis        = Math.Floor(systemContainer.EventSystem.GetStat(player, "Aegis"));
            var aegisText    = $"{currentAegis}/{aegis}";
            var renderAegis  = aegis > 0;
            var tiltFighter  = player.Get <TiltFighter>();
            var brokenTicks  = tiltFighter.BrokenTicks;
            var broken       = brokenTicks > 0;

            if (broken)
            {
                BLT.Font("");
                BLTLayers.Set(BLTLayers.UIElements, control.ActivityIndex);
                RenderSpriteIfSpecified(x, y, spriteManager, "defence_broken", AnimationFrame.Idle0);

                BLTLayers.Set(BLTLayers.Text, control.ActivityIndex);
                BLT.Font("text");
                BLT.Print(x + 10, y + 2, $"DEFENCE BROKEN (Recovery: {100 - brokenTicks / 200}%)");
            }
            else
            {
                BLT.Font("");
                BLTLayers.Set(BLTLayers.UIElements, control.ActivityIndex);
                RenderSpriteIfSpecified(x, y, spriteManager, "AC", AnimationFrame.Idle0);
                RenderSpriteIfSpecified(x + 10, y, spriteManager, "SH", AnimationFrame.Idle0);
                RenderSpriteIfSpecified(x + 20, y, spriteManager, "EV", AnimationFrame.Idle0);
                if (renderAegis)
                {
                    var aegisSprite = currentAegis > 0 ? "aegis" : "aegis_none";
                    RenderSpriteIfSpecified(x + 30, y, spriteManager, aegisSprite, AnimationFrame.Idle0);
                }

                BLTLayers.Set(BLTLayers.Text, control.ActivityIndex);
                BLT.Font("text");

                PrintTextCentered(ac.ToString(), x + 4, y + 2);
                PrintTextCentered(sh.ToString(), x + 4 + 10, y + 2);
                PrintTextCentered(ev.ToString(), x + 4 + 20, y + 2);
                if (renderAegis)
                {
                    PrintTextCentered(aegisText, x + 4 + 30, y + 2);
                }
            }
        }
Ejemplo n.º 3
0
        protected override void DisplayInternal(ISpriteManager spriteManager, IDataRogueControl control, ISystemContainer systemContainer, List <MapCoordinate> playerFov)
        {
            var x       = control.Position.X;
            var y       = control.Position.Y;
            var display = control as IDataRogueInfoControl;

            var skillsOnBar = GetSkillsOnBar(systemContainer);

            var previousSkills = 0;

            BLT.Font("");

            foreach (var skill in skillsOnBar)
            {
                if (SkillSelected(skill))
                {
                    RenderSpriteIfSpecified(x + previousSkills * 12, y, spriteManager, "skill_frame_selected", AnimationFrame.Idle0);
                }
                else
                {
                    RenderSpriteIfSpecified(x + previousSkills * 12, y, spriteManager, "skill_frame", AnimationFrame.Idle0);
                }

                var appearance = skill.Get <SpriteAppearance>();

                var skillSpriteBottom = "default_skill_icon";
                var skillSpriteTop    = "";

                if (appearance != null)
                {
                    skillSpriteBottom = appearance.Bottom;
                    skillSpriteTop    = appearance.Top;
                }

                BLTLayers.Set(BLTLayers.UIElements, control.ActivityIndex);
                RenderSpriteIfSpecified(x + previousSkills * 12 + 2, y + 2, spriteManager, skillSpriteBottom, AnimationFrame.Idle0);
                BLTLayers.Set(BLTLayers.UIElementPieces, control.ActivityIndex);
                RenderSpriteIfSpecified(x + previousSkills * 12 + 2, y + 2, spriteManager, skillSpriteTop, AnimationFrame.Idle0);

                previousSkills++;
            }
        }