protected sealed override void LoadContent()
        {
            this.mayorMenu        = this.Game.Components.OfType <MayorMenu>().ElementAt(0);
            this.countersToScreen = new Func <Int16>[6] {
                mayorMenu.GetBuildersCounter, mayorMenu.GetLumberjacksCounter,
                mayorMenu.GetMinersCounter, mayorMenu.GetFarmersCounter,
                mayorMenu.GetBankersCounter, mayorMenu.GetSellersCounter
            };

            this.spriteBatch = new SpriteBatch(this.GraphicsDevice);
            this.font        = this.Game.Content.Load <SpriteFont>("Fonts/Castellar_HUD");

            this.CancelBtn = new Button <AssignmentMayorMenu>(this.Game, this)
            {
                BtnTexture = this.Game.Content.Load <Texture2D>("Textures/exitBtn"),
                Height     = BTN_HEIGHT,
                Width      = BTN_WIDTH,
                Tag        = "CANCEL_BTN",
                Position   = new Vector2(this.GraphicsDevice.Viewport.Width - BTN_WIDTH - 10.0f,
                                         this.GraphicsDevice.Viewport.Height - 10.0f - BTN_HEIGHT)
            };
            this.CancelBtn.OnButtonClicked += new Button <AssignmentMayorMenu> .ButtonClicked(CancelBtn_OnButtonClicked);

            this.backgroundTex = this.Game.Content.Load <Texture2D>("Textures/Mayor/mayor_menu_background");
            this.addTex        = this.Game.Content.Load <Texture2D>("Textures/Mayor/add");
            this.removeTex     = this.Game.Content.Load <Texture2D>("Textures/Mayor/remove");

            this.CreateButtons();
            this.FillTextPositions();
            this.UpdateText();
            this.freeCounter = "Available workers: " + this.mayorMenu.GetFreeCounter();

            base.LoadContent();
        }
Beispiel #2
0
        protected override void LoadContent()
        {
            this.mayorMenu = this.Game.Components.OfType <MayorMenu>().ElementAt(0);
            counters       = new Func <Int16>[3] {
                this.mayorMenu.GetSwordsmenCounter,
                this.mayorMenu.GetArchersCounter,
                this.mayorMenu.GetBatteringRamCounter
            };
            this.CreateButtons();
            this.FillTxtPositions();

            this.spriteBatch   = new SpriteBatch(this.GraphicsDevice);
            this.font          = this.Game.Content.Load <SpriteFont>("Fonts/Castellar_HUD");
            this.backgroundTex = this.Game.Content.Load <Texture2D>("Textures/Mayor/mayor_menu_background");
            this.UpdateText();

            base.LoadContent();
        }