Beispiel #1
0
        /// <summary>
        /// Initialises a new instance of this class.
        /// </summary>
        public IngameMenu()
        {
            this.buttonList = new UIButtonList();
            this.buttonList.ScrollThrough = true;

            this.continueGameButton = new UIButton("DefaultButton", "SelectedButton");
            this.continueGameButton.Text = "Continue";
            this.continueGameButton.OnAction += new ButtonActionDelegate(ContinueGame);
            this.continueGameButton.Position = new Vector2(200.0f, 200.0f);

            this.saveGameButton = new UIButton("DefaultButton", "SelectedButton");
            this.saveGameButton.Text = "Save Game";
            this.saveGameButton.OnAction += new ButtonActionDelegate(SaveGame);
            this.saveGameButton.Position = new Vector2(200.0f, 270.0f);

            this.exitButton = new UIButton("DefaultButton", "SelectedButton");
            this.exitButton.Text = "Exit";
            this.exitButton.OnAction += new ButtonActionDelegate(Exit);
            this.exitButton.Position = new Vector2(200.0f, 340.0f);

            this.buttonList.Buttons.Add(this.continueGameButton);
            this.buttonList.Buttons.Add(this.saveGameButton);
            this.buttonList.Buttons.Add(this.exitButton);

            this.Children.Add(this.buttonList);
        }
Beispiel #2
0
        /// <summary>
        /// Initialises a new instance of this class.
        /// </summary>
        public LoadScreen()
            : base("MainMenu")
        {
            this.buttonList = new UIButtonList();
            this.buttonList.ScrollThrough = true;

            this.slot1 = new UIButton("DefaultButton", "SelectedButton");
            this.slot1.Text = "Empty";
            this.slot1.OnAction += new ButtonActionDelegate(Slot1Action);
            this.slot1.Position = new Vector2(200.0f, 250.0f);

            this.slot2 = new UIButton("DefaultButton", "SelectedButton");
            this.slot2.Text = "Empty";
            this.slot2.OnAction += new ButtonActionDelegate(Slot2Action);
            this.slot2.Position = new Vector2(200.0f, 320.0f);

            this.slot3 = new UIButton("DefaultButton", "SelectedButton");
            this.slot3.Text = "Empty";
            this.slot3.OnAction += new ButtonActionDelegate(Slot3Action);
            this.slot3.Position = new Vector2(200.0f, 390.0f);

            this.slot4 = new UIButton("DefaultButton", "SelectedButton");
            this.slot4.Text = "Empty";
            this.slot4.OnAction += new ButtonActionDelegate(Slot4Action);
            this.slot4.Position = new Vector2(200.0f, 460.0f);

            this.buttonList.Buttons.Add(this.slot1);
            this.buttonList.Buttons.Add(this.slot2);
            this.buttonList.Buttons.Add(this.slot3);
            this.buttonList.Buttons.Add(this.slot4);

            this.Children.Add(this.buttonList);
        }
Beispiel #3
0
        /// <summary>
        /// Initialises a new instance of this class.
        /// </summary>
        public GameOverScreen()
            : base("GameOver")
        {
            this.buttonList = new UIButtonList();
            this.buttonList.ScrollThrough = true;

            this.mainMenuButton = new UIButton("DefaultButton", "SelectedButton");
            this.mainMenuButton.Text = "Main Menu";
            this.mainMenuButton.OnAction += new ButtonActionDelegate(mainMenuButton_OnAction);
            this.mainMenuButton.Position = new Vector2(200.0f, 320.0f);

            this.exitButton = new UIButton("DefaultButton", "SelectedButton");
            this.exitButton.Text = "Exit";
            this.exitButton.OnAction += new ButtonActionDelegate(exitButton_OnAction);
            this.exitButton.Position = new Vector2(200.0f, 390.0f);

            this.buttonList.Buttons.Add(this.mainMenuButton);
            this.buttonList.Buttons.Add(this.exitButton);

            this.Children.Add(this.buttonList);
        }
Beispiel #4
0
 private void mainMenuButton_OnAction(UIButton sender)
 {
     FSEGame.Singleton.OpenMainMenu();
 }
Beispiel #5
0
 private void exitButton_OnAction(UIButton sender)
 {
     GameBase.Singleton.Exit();
 }
Beispiel #6
0
 void ContinueGame(UIButton sender)
 {
     FSEGame.Singleton.CloseIngameMenu();
 }
Beispiel #7
0
 void SaveGame(UIButton sender)
 {
     FSEGame.Singleton.OpenSaveScreen();
 }
Beispiel #8
0
 void Exit(UIButton sender)
 {
     FSEGame.Singleton.CloseIngameMenu();
     FSEGame.Singleton.OpenMainMenu();
 }
Beispiel #9
0
 /// <summary>
 /// Attempts to load the game in slot 1.
 /// </summary>
 /// <param name="sender"></param>
 private void Slot4Action(UIButton sender)
 {
     if (this.DoesSaveFilExist(4))
         FSEGame.Singleton.LoadGame(4);
 }
Beispiel #10
0
 /// <summary>
 /// Attempts to load the game in slot 1.
 /// </summary>
 /// <param name="sender"></param>
 private void Slot4Action(UIButton sender)
 {
     FSEGame.Singleton.SaveGame(4);
     FSEGame.Singleton.CloseIngameMenu();
 }