Пример #1
0
        /// <summary>
        /// Loads the content.
        /// </summary>
        public override void LoadContent()
        {
            background = new GuiImage
            {
                ContentFile   = "Interface/Backgrounds/stone-bricks",
                TextureLayout = TextureLayout.Tile
            };

            factionImage = new GuiFactionFlag
            {
                Size = new Size2D(128, 128)
            };

            factionText = new GuiText
            {
                FontName          = "SideBarFont",
                Size              = new Size2D(Size.Width * 2 / 3, 48),
                VerticalAlignment = VerticalAlignment.Left
            };

            turnText = new GuiText
            {
                FontName          = "SideBarFont",
                Size              = new Size2D(Size.Width / 3, 48),
                VerticalAlignment = VerticalAlignment.Right
            };

            StatsButton = new GuiButton
            {
                Text             = "Stats",
                ForegroundColour = ForegroundColour,
                Size             = new Size2D(GameDefines.GUI_TILE_SIZE * 3, GameDefines.GUI_TILE_SIZE)
            };
            RecruitButton = new GuiButton
            {
                Text             = "Recruit",
                ForegroundColour = ForegroundColour,
                Size             = new Size2D(GameDefines.GUI_TILE_SIZE * 3, GameDefines.GUI_TILE_SIZE)
            };
            BuildButton = new GuiButton
            {
                Text             = "Build",
                ForegroundColour = ForegroundColour,
                Size             = new Size2D(GameDefines.GUI_TILE_SIZE * 3, GameDefines.GUI_TILE_SIZE)
            };
            TurnButton = new GuiButton
            {
                Text             = "End Turn",
                ForegroundColour = ForegroundColour,
                Size             = new Size2D(GameDefines.GUI_TILE_SIZE * 7, GameDefines.GUI_TILE_SIZE),
                Style            = ButtonStyle.Narivian
            };

            Children.Add(background);
            Children.Add(factionImage);

            Children.Add(factionText);
            Children.Add(turnText);

            Children.Add(StatsButton);
            Children.Add(RecruitButton);
            Children.Add(BuildButton);
            Children.Add(TurnButton);

            base.LoadContent();
        }
Пример #2
0
        /// <summary>
        /// Loads the content.
        /// </summary>
        public override void LoadContent()
        {
            holdingTypes = Enum.GetValues(typeof(HoldingType)).Cast <HoldingType>().Where(x => x != HoldingType.Empty).ToList();

            background = new GuiImage
            {
                ContentFile   = "Interface/Backgrounds/stone-bricks",
                TextureLayout = TextureLayout.Tile
            };
            holdingBackground = new GuiImage
            {
                ContentFile   = "ScreenManager/FillImage",
                TextureLayout = TextureLayout.Tile,
                Size          = new Size2D(100, 100)
            };
            holdingImage = new GuiImage
            {
                ContentFile = $"World/Assets/{game.GetWorld().Id}/holdings/generic"
            };

            holdingText = new GuiText
            {
                Size     = new Size2D(holdingBackground.Size.Width, 18),
                FontName = "InfoBarFont"
            };
            provinceText = new GuiText
            {
                Size     = new Size2D(holdingBackground.Size.Height, 18),
                FontName = "InfoBarFont"
            };

            priceIcon = new GuiImage
            {
                ContentFile     = "Interface/game_icons",
                SourceRectangle = new Rectangle2D(16, 0, 16, 16)
            };
            priceText = new GuiText
            {
                Size = new Size2D(priceIcon.SourceRectangle.Width * 2,
                                  priceIcon.SourceRectangle.Height),
                FontName          = "InfoBarFont",
                VerticalAlignment = VerticalAlignment.Left
            };

            previousHoldingButton = new GuiButton
            {
                Text = "<",
                Size = new Size2D(GameDefines.GUI_TILE_SIZE, GameDefines.GUI_TILE_SIZE)
            };
            nextHoldingButton = new GuiButton
            {
                Text = ">",
                Size = new Size2D(GameDefines.GUI_TILE_SIZE, GameDefines.GUI_TILE_SIZE)
            };
            previouseProvinceButton = new GuiButton
            {
                Text = "<",
                Size = new Size2D(GameDefines.GUI_TILE_SIZE, GameDefines.GUI_TILE_SIZE)
            };
            nextProvinceButton = new GuiButton
            {
                Text = ">",
                Size = new Size2D(GameDefines.GUI_TILE_SIZE, GameDefines.GUI_TILE_SIZE)
            };
            buildButton = new GuiButton
            {
                Text = "Build",
                Size = new Size2D(GameDefines.GUI_TILE_SIZE * 4, GameDefines.GUI_TILE_SIZE)
            };
            cancelButton = new GuiButton
            {
                Text = "Cancel",
                Size = new Size2D(GameDefines.GUI_TILE_SIZE * 2, GameDefines.GUI_TILE_SIZE)
            };

            Children.Add(background);
            Children.Add(holdingBackground);
            Children.Add(holdingImage);

            Children.Add(holdingText);
            Children.Add(provinceText);

            Children.Add(priceIcon);
            Children.Add(priceText);

            Children.Add(nextHoldingButton);
            Children.Add(previousHoldingButton);
            Children.Add(nextProvinceButton);
            Children.Add(previouseProvinceButton);
            Children.Add(buildButton);
            Children.Add(cancelButton);

            base.LoadContent();

            UpdateProvinceList();
            SelectHolding(0);
            SelectProvince(0);
        }
Пример #3
0
        /// <summary>
        /// Loads the content.
        /// </summary>
        public override void LoadContent()
        {
            units = game.GetUnits().OrderBy(u => u.Price).ToList();

            background = new GuiImage
            {
                ContentFile   = "Interface/Backgrounds/stone-bricks",
                TextureLayout = TextureLayout.Tile
            };
            unitBackground = new GuiImage
            {
                ContentFile   = "ScreenManager/FillImage",
                TextureLayout = TextureLayout.Tile,
                Size          = new Size2D(100, 100)
            };
            unitImage = new GuiImage
            {
                ContentFile     = $"World/Assets/{game.GetWorld().Id}/units/{units[currentUnitIndex].Id}",
                SourceRectangle = new Rectangle2D(0, 0, 64, 64)
            };

            unitText = new GuiText
            {
                Size     = new Size2D(unitBackground.Size.Width, 18),
                FontName = "InfoBarFont"
            };

            healthIcon = new GuiImage
            {
                ContentFile     = "Interface/game_icons",
                SourceRectangle = new Rectangle2D(64, 0, 16, 16)
            };
            powerIcon = new GuiImage
            {
                ContentFile     = "Interface/game_icons",
                SourceRectangle = new Rectangle2D(80, 0, 16, 16)
            };
            priceIcon = new GuiImage
            {
                ContentFile     = "Interface/game_icons",
                SourceRectangle = new Rectangle2D(16, 0, 16, 16)
            };
            maintenanceIcon = new GuiImage
            {
                ContentFile     = "Interface/game_icons",
                SourceRectangle = new Rectangle2D(96, 0, 16, 16)
            };

            healthText = new GuiText
            {
                Size              = new Size2D(healthIcon.SourceRectangle.Width * 2, healthIcon.SourceRectangle.Height),
                FontName          = "InfoBarFont",
                VerticalAlignment = VerticalAlignment.Left
            };
            powerText = new GuiText
            {
                Size              = new Size2D(powerIcon.SourceRectangle.Width * 2, powerIcon.SourceRectangle.Height),
                FontName          = "InfoBarFont",
                VerticalAlignment = VerticalAlignment.Left
            };
            priceText = new GuiText
            {
                Size              = new Size2D(priceIcon.SourceRectangle.Width * 2, priceIcon.SourceRectangle.Height),
                FontName          = "InfoBarFont",
                VerticalAlignment = VerticalAlignment.Left
            };
            maintenanceText = new GuiText
            {
                Size              = new Size2D(maintenanceIcon.SourceRectangle.Width * 2, maintenanceIcon.SourceRectangle.Height),
                FontName          = "InfoBarFont",
                VerticalAlignment = VerticalAlignment.Left
            };
            troopsText = new GuiText
            {
                Size     = new Size2D(unitBackground.Size.Height, 18),
                FontName = "InfoBarFont"
            };

            nextUnitButton = new GuiButton
            {
                Text = ">",
                Size = new Size2D(GameDefines.GUI_TILE_SIZE, GameDefines.GUI_TILE_SIZE)
            };
            previousUnitButton = new GuiButton
            {
                Text = "<",
                Size = new Size2D(GameDefines.GUI_TILE_SIZE, GameDefines.GUI_TILE_SIZE)
            };
            addUnitButton = new GuiButton
            {
                Text = "+",
                Size = new Size2D(GameDefines.GUI_TILE_SIZE, GameDefines.GUI_TILE_SIZE)
            };
            substractUnitButton = new GuiButton
            {
                Text = "-",
                Size = new Size2D(GameDefines.GUI_TILE_SIZE, GameDefines.GUI_TILE_SIZE)
            };
            recruitButton = new GuiButton
            {
                Text = "Recruit",
                Size = new Size2D(GameDefines.GUI_TILE_SIZE * 4, GameDefines.GUI_TILE_SIZE)
            };
            cancelButton = new GuiButton
            {
                Text = "Cancel",
                Size = new Size2D(GameDefines.GUI_TILE_SIZE * 2, GameDefines.GUI_TILE_SIZE)
            };

            Children.Add(background);
            Children.Add(unitBackground);
            Children.Add(unitImage);

            Children.Add(unitText);
            Children.Add(troopsText);

            Children.Add(healthIcon);
            Children.Add(powerIcon);
            Children.Add(priceIcon);
            Children.Add(maintenanceIcon);

            Children.Add(healthText);
            Children.Add(powerText);
            Children.Add(priceText);
            Children.Add(maintenanceText);

            Children.Add(nextUnitButton);
            Children.Add(previousUnitButton);
            Children.Add(addUnitButton);
            Children.Add(substractUnitButton);
            Children.Add(recruitButton);
            Children.Add(cancelButton);

            base.LoadContent();
        }