Beispiel #1
0
 public MiFactoryMenu(Micycle game, float center_x, float center_y, MicycleGameSystem system, MiInGameMenu inGameMenu)
     : base(game, center_x, center_y, system, inGameMenu)
 {
     miceWorkersOverCapactiyBar = Stat1Bar;
     robotWorkersOverCapacityBar = Stat1Bar;
     workerWageBar = Stat2Bar;
 }
Beispiel #2
0
 public MiSchoolMenu(Micycle game, float center_x, float center_y, MicycleGameSystem system, MiInGameMenu inGameMenu)
     : base(game, center_x, center_y, system, inGameMenu)
 {
     educationBudgetBar = Stat1Bar;
     teacherStudentRatioBar = Stat2Bar;
     studentsOverCapacityBar = Stat3Bar;
 }
Beispiel #3
0
        public MiInGameMenu(Micycle game, MicycleGameSystem system)
            : base(game, WIDTH, HEIGHT)
        {
            this.system = system;

            //
            // Resume Button
            //
            resumeButton = new MiButton();
            resumeButton.Pressed += new MiScript(
                delegate
                {
                    Game.ToUpdate.Pop();
                    Game.ToDraw.RemoveLast();
                    system.Enabled = true;
                    return null;
                });

            //
            // Quit Button
            //
            quitGameButton = new MiButton();
            quitGameButton.Pressed += new MiScript(
                delegate
                {
                    Game.Exit();
                    return null;
                });

            //
            // Go To Main Menu Button
            //
            goToMainMenuButton = new MiButton();
            goToMainMenuButton.Pressed += new MiScript(
                delegate
                {
                    Game.ToUpdate.Pop();

                    if (Game.ToUpdate.Peek() is MiBuildingMenu)
                    {
                        Game.ToUpdate.Pop();
                        Game.ToDraw.RemoveLast();
                    }

                    Game.ToUpdate.Pop();
                    Game.ToDraw.RemoveLast();
                    Game.ToDraw.RemoveLast();
                    Game.ToUpdate.Push(game.StartScreen);
                    Game.ToDraw.AddLast(game.StartScreen);
                    Game.ScriptEngine.ExecuteScript(game.StartScreen.EntrySequence);
                    return null;
                });
        }
Beispiel #4
0
        public MiBuildingMenu(Micycle game, float center_x, float center_y, MicycleGameSystem system, MiInGameMenu inGameMenu)
            : base(game)
        {
            centerX = center_x;
            centerY = center_y;
            this.system = system;
            this.inGameMenu = inGameMenu;

            backgroundRectangle = new Rectangle((int)center_x, (int)center_y, BACKGROUND_RECTANGLE_WIDTH, BACKGROUND_RECTANGLE_HEIGHT);

            stat1TextPosition = new Vector2(center_x - BACKGROUND_RECTANGLE_WIDTH / 2 + LEFT_PADDING, center_y - BACKGROUND_RECTANGLE_HEIGHT / 2 + TOP_PADDING);
            stat2TextPosition = stat1TextPosition + new Vector2(0, TEXT_HEIGHT + BAR_THICKNESS);
            stat3TextPosition = stat2TextPosition + new Vector2(0, TEXT_HEIGHT + BAR_THICKNESS);
            stat1Bar = new Rectangle((int)stat1TextPosition.X, (int)stat1TextPosition.Y + TEXT_HEIGHT, BACKGROUND_RECTANGLE_WIDTH - LEFT_PADDING - RIGHT_PADDING, BAR_THICKNESS);
            stat2Bar = new Rectangle((int)stat2TextPosition.X, (int)stat2TextPosition.Y + TEXT_HEIGHT, stat1Bar.Width, stat1Bar.Height);
            stat3Bar = new Rectangle((int)stat3TextPosition.X, (int)stat3TextPosition.Y + TEXT_HEIGHT, stat2Bar.Width, stat2Bar.Height);

            cursor = new MiAnimatingComponent(game, CANCEL_BUTTON_X, CANCEL_BUTTON_Y, 0.5f, 0, 0, 0);
            upButtonGraphic = new MiAnimatingComponent(game, UP_BUTTON_X, UP_BUTTON_Y, UP_BUTTON_SCALE, 0, 0, 0);
            downButtonGraphic = new MiAnimatingComponent(game, DOWN_BUTTON_X, DOWN_BUTTON_Y, DOWN_BUTTON_SCALE, 0, 0, 0);
            leftButtonGraphic = new MiAnimatingComponent(game, LEFT_BUTTON_X, LEFT_BUTTON_Y, LEFT_BUTTON_SCALE, 0, 0, 0);
            rightButtonGraphic = new MiAnimatingComponent(game, RIGHT_BUTTON_X, RIGHT_BUTTON_Y, RIGHT_BUTTON_SCALE, 0, 0, 0);

            upButton = new MiButton();
            downButton = new MiButton();
            leftButton = new MiButton();
            rightButton = new MiButton();
            cancelButton = new MiButton();
            cancelButton.Pressed += new MiScript(
                delegate
                {
                    Game.ToUpdate.Pop();
                    Game.ToDraw.RemoveLast();
                    return null;
                });

            cursor.Visible = false;
            ActiveButton = cancelButton;
        }