Beispiel #1
0
        public override void OnRender(RenderTarget target)
        {
            BurntimeClassic classic = app as BurntimeClassic;
            int             city    = classic.InfoCity;

            TextHelper txt = new TextHelper(app, "burn");

            Location loc = classic.Game.World.Locations[city];

            titleFont.DrawText(target, new Vector2(193, 7), txt[city], TextAlignment.Center, VerticalTextAlignment.Top);

            if (itemCount[0] != -1)
            {
                font.DrawText(target, new Vector2(188, 120), itemCount[0].ToString());
            }
            if (itemCount[1] != -1)
            {
                font.DrawText(target, new Vector2(188, 160), itemCount[1].ToString());
            }

            // render npc info
            font.DrawText(target, new Vector2(100, 33), txt[396], TextAlignment.Left, VerticalTextAlignment.Top);
            font.DrawText(target, new Vector2(100, 51), txt[397], TextAlignment.Left, VerticalTextAlignment.Top);
            font.DrawText(target, new Vector2(100, 69), txt[398], TextAlignment.Left, VerticalTextAlignment.Top);

            int max = System.Math.Max(font.GetWidth(txt[396]), font.GetWidth(txt[397]));

            max = System.Math.Max(font.GetWidth(txt[398]), max);

            RenderNPCLine(target, new Vector2(110 + max, 29), fighter, fighterImage);
            RenderNPCLine(target, new Vector2(110 + max, 47), technicians, technicianImage);
            RenderNPCLine(target, new Vector2(110 + max, 65), doctors, doctorImage);

            // render resources
            font.DrawText(target, new Vector2(137, 86), txt[399], TextAlignment.Left, VerticalTextAlignment.Top);

            font.DrawText(target, new Vector2(229, 86), txt[406], TextAlignment.Left, VerticalTextAlignment.Top);

            txt.AddArgument("|J", loc.GetFoodProductionValue());
            txt.AddArgument("|D", loc.Source.Water);

            font.DrawText(target, new Vector2(270, 117), txt[421], TextAlignment.Left, VerticalTextAlignment.Top);
            font.DrawText(target, new Vector2(270, 152), txt[422], TextAlignment.Left, VerticalTextAlignment.Top);

            if (loc.Danger != null)
            {
                font.DrawText(target, new Vector2(251, 68), loc.Danger.InfoString, TextAlignment.Center, VerticalTextAlignment.Top);
            }

            txt.ClearArguments();
        }
Beispiel #2
0
        public override void OnRender(RenderTarget Target)
        {
            base.OnRender(Target);

            Target.RenderRect(new Vector2(0, 0), new Vector2(16, Size.y - 40), new PixelColor(0, 0, 0));
            Target.RenderRect(new Vector2(Size.x - 16, 0), new Vector2(16, Size.y - 40), new PixelColor(0, 0, 0));
            Target.RenderRect(new Vector2(0, Size.y - 40), new Vector2(Size.x, 40), new PixelColor(0, 0, 0));

            Target.Layer++;
            ClassicGame game = app.GameState as ClassicGame;

            Vector2 health    = new Vector2(Size.x / 2 + 64, Size.y - 30);
            int     fullBar   = 75;
            int     healthBar = fullBar * game.World.ActivePlayerObj.Character.Health / 100;

            Target.RenderRect(health, new Vector2(healthBar, 5), new PixelColor(240, 64, 56));

            Vector2 timebar = new Vector2(Target.Width / 2 - 30, 2);
            int     dayTime = (int)(game.World.Time * 60);

            Target.RenderRect(timebar, new Vector2(dayTime, 3), new PixelColor(240, 64, 56));

            Vector2 name = new Vector2(Size.x / 2 - 97, Size.y - 30);

            playerColor.DrawText(Target, name, this.name, TextAlignment.Center, VerticalTextAlignment.Top);

            Vector2    day = new Vector2(Size.x / 2 + 100, Size.y - 15);
            TextHelper txt = new TextHelper(app, "burn");

            txt.AddArgument("|A", game.World.Day);
            font.DrawText(Target, day, txt[404], TextAlignment.Center, VerticalTextAlignment.Top);
        }
        void UpdateText()
        {
            restaurantText = new String[3];
            int baseLine = 0;
            int value    = grid.GetEatValue();

            //if (restaurantType == RestaurantType.Water)
            //    baseLine += 20;

            if (eatLastAmount == 0)
            {
                baseLine += 6;
            }
            else if (eatLastAmount > 0)
            {
                baseLine += 3;
            }
            else if (value == 0)
            {
                baseLine += 9;
            }

            TextHelper txt = new TextHelper(app, "burn");

            txt.AddArgument("|E", value);
            restaurantText[0] = txt[530 + baseLine];
            restaurantText[1] = txt[531 + baseLine];
            restaurantText[2] = txt[532 + baseLine];
        }
Beispiel #4
0
        void UpdateText()
        {
            restaurantText = new String[3];
            int baseLine = 0;
            int value    = grid.GetDrinkValue();

            if (drinkLastAmount == 0)
            {
                baseLine += 6;
            }
            else if (drinkLastAmount > 0)
            {
                baseLine += 3;
            }
            else if (value == 0)
            {
                baseLine += 9;
            }

            TextHelper txt = new TextHelper(app, "burn");

            txt.AddArgument("|E", value);
            restaurantText[0] = txt[550 + baseLine];
            restaurantText[1] = txt[551 + baseLine];
            restaurantText[2] = txt[552 + baseLine];
        }
Beispiel #5
0
        public override void OnRender(RenderTarget target)
        {
            base.OnRender(target);

            if (txtlines != 0)
            {
                TextHelper txt = new TextHelper(app, "burn");
                txt.AddArgument("|A", name);
                string line = txt[txtoffset + (int)txtline];
                font.DrawText(target, new Vector2(160, 200 - 15), line, TextAlignment.Center, VerticalTextAlignment.Top);
            }
        }
Beispiel #6
0
        public override void OnRender(RenderTarget target)
        {
            base.OnRender(target);

            target.Layer += 10;

            BurntimeClassic classic = app as BurntimeClassic;

            if (classic.InventoryRoom != null && classic.InventoryRoom.IsWaterSource)
            {
                TextHelper txt = new TextHelper(app, "burn");
                txt.AddArgument("|C", classic.Game.World.ActiveLocationObj.Source.Reserve);
                waterSourceFont.DrawText(target, target.Size, txt[423]);

                Vector2 bar = new Vector2(14, classic.Game.World.ActiveLocationObj.Source.Reserve * 2);

                target.RenderRect(target.Size - new Vector2(2, 10) - bar, bar, new PixelColor(240, 64, 56));
            }

            target.Layer -= 10;
        }
Beispiel #7
0
        public override void OnUpdate(float Elapsed)
        {
            base.OnUpdate(Elapsed);

            if (player != null)
            {
                nameField.Progress  = player.Character.Health / 100.0f;
                foodField.Progress  = player.Character.Food / (float)player.Character.MaxFood;
                foodField.Text      = player.Character.Food.ToString();
                waterField.Progress = player.Character.Water / (float)player.Character.MaxWater;
                waterField.Text     = player.Character.Water.ToString();
            }

            ClassicGame game = app.GameState as ClassicGame;

            timeField.Progress = game.World.Time;

            TextHelper txt = new TextHelper(app, "burn");

            txt.AddArgument("|A", game.World.Day);
            timeField.Text = txt[404];
        }
Beispiel #8
0
        public override void OnRender(RenderTarget Target)
        {
            if (side)
            {
                for (int i = pages.Count - 1; i >= 0; i--)
                {
                    Target.DrawSprite(basePos + new Vector2(3, -2) * i, back);
                }
            }
            else
            {
                for (int i = pages.Count - 1; i >= 0; i--)
                {
                    Target.DrawSprite(basePos + -3 * i, back);
                }
            }

            TextHelper txt = new TextHelper(app, "burn");

            txt.AddArgument("|B", activePage.Character.Health);
            txt.AddArgument("|A", activePage.Character.Experience);
            txt.AddArgument("|C", activePage.Character.Water);
            txt.AddArgument("|D", activePage.Character.Food);

            txt.AddArgument("{attack}", (int)activePage.Character.AttackValue);
            txt.AddArgument("{defense}", (int)activePage.Character.DefenseValue);

            int fontSpacing = 10;

            Vector2 textPos = new Vector2();

            textPos.x = basePos.x + (side ? 11 : 73);
            textPos.y = basePos.y + 11;
            font.DrawText(Target, textPos, txt[40 + (int)activePage.Character.Class], TextAlignment.Left, VerticalTextAlignment.Top);
            textPos.y += fontSpacing;
            font.DrawText(Target, textPos, txt[380], TextAlignment.Left, VerticalTextAlignment.Top);
            textPos.y += fontSpacing;
            font.DrawText(Target, textPos, txt[381], TextAlignment.Left, VerticalTextAlignment.Top);
            textPos.y += fontSpacing;

            if (activePage.Character.Class != CharClass.Trader)
            {
                font.DrawText(Target, textPos, txt[403], TextAlignment.Left, VerticalTextAlignment.Top);
                textPos.y += fontSpacing;
                font.DrawText(Target, textPos, txt[402], TextAlignment.Left, VerticalTextAlignment.Top);
                textPos.y += fontSpacing;

                font.DrawText(Target, textPos, txt.Get("newburn?100"), TextAlignment.Left, VerticalTextAlignment.Top);
                textPos.x = basePos.x + 20;
                font.DrawText(Target, textPos, txt.Get("newburn?99"), TextAlignment.Left, VerticalTextAlignment.Top);
                textPos.y += fontSpacing;

                if (activePage.Character.Protection != null)
                {
                    string text = "";
                    foreach (var protection in activePage.Character.Protection.Type.Protection)
                    {
                        var p = protection.Object;
                        text += (int)(System.Math.Round(p.Rate * 100));
                        if (p.Type == "gas")
                        {
                            text += app.ResourceManager.GetString("newburn?101");
                        }
                        else
                        {
                            text += app.ResourceManager.GetString("newburn?102");
                        }
                    }
                    font.DrawText(Target, textPos, text, TextAlignment.Left, VerticalTextAlignment.Top);
                }
                textPos.y += fontSpacing;
            }

            pageName = "";
            for (int i = 0; i < pageButtons.Length; i++)
            {
                if (pageButtons[i].IsHover && pageIndices[i] >= 0)
                {
                    namePosition = pageButtons[i].Position + new Vector2(6, -9);
                    pageName     = pages[pageIndices[i]].Character.Name;
                }
            }

            Target.Layer += 5;

            if (pageName != "")
            {
                nameFont.DrawText(Target, namePosition, pageName, TextAlignment.Center, VerticalTextAlignment.Top);
            }

            Target.Layer -= 5;
        }
        public override void OnRender(RenderTarget Target)
        {
            int y = -1;

            TextHelper txt = new TextHelper(app, "burn");

            txt.AddArgument("|J", (app as BurntimeClassic).Game.World.Day);
            txt.AddArgument("|B", fighter);
            txt.AddArgument("|G", technician);
            txt.AddArgument("|H", doctor);
            txt.AddArgument("|C", maggots);
            txt.AddArgument("|D", rats);
            txt.AddArgument("|E", snakes);
            txt.AddArgument("|F", meat);
            txt.AddArgument("|A", locations);
            txt.AddArgument("|I", controlledCities);
            txt.AddArgument("|K", cities);

            for (int i = 0; i < 16; i++)
            {
                String str = txt[569 + i];

                int x = Target.Width / 2 - font.GetWidth(str) / 2 - 10;
                font.DrawText(Target, new Vector2(x, y), str, TextAlignment.Left, VerticalTextAlignment.Top);
                y += 11;
            }
        }