Пример #1
0
        public override void Initialize()
        {
            //AddBackground("settingsmenu");
            ButtonArea returnButton = new ButtonArea();

            returnButton.AddImage("return");
            returnButton.Position = new Vector2(83, 390);
            returnButton.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <StartMenuScreen>()));
            returnButton.HasShortcutWithGoBackButton = true;
            AddButtonArea(returnButton);
            ButtonArea graphicsMenuButton = new ButtonArea();

            graphicsMenuButton.AddImage("settingsmenu_graphics");
            graphicsMenuButton.Position = new Vector2(83, 540);
            graphicsMenuButton.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <GraphicsMenuScreen>()));
            AddButtonArea(graphicsMenuButton);
            ButtonArea soundMenuButton = new ButtonArea();

            soundMenuButton.AddImage("settingsmenu_sound");
            soundMenuButton.Position = new Vector2(83, 690);
            soundMenuButton.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <SoundMenuScreen>()));
            AddButtonArea(soundMenuButton);
            ButtonArea controlsMenuButton = new ButtonArea();

            controlsMenuButton.AddImage("settingsmenu_controls");
            controlsMenuButton.Position = new Vector2(83, 840);
            controlsMenuButton.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <ControlsMenuScreen>()));
            AddButtonArea(controlsMenuButton);
            SetFocusedButtonArea(returnButton);
            base.Initialize();
        }
Пример #2
0
        public virtual ButtonArea GetPreviousButtonArea()
        {
            ButtonArea previousButton = null;

            //Find the last button from the start before the selected one
            for (int i = 0; i < _buttonAreaList.Count; i++)
            {
                if (_buttonAreaList[i].Status == ButtonStatusEnum.Focused || _buttonAreaList[i].Status == ButtonStatusEnum.Selected)
                {
                    break;
                }
                else if (_buttonAreaList[i].Visible && !_buttonAreaList[i].Disabled)
                {
                    previousButton = _buttonAreaList[i];
                }
            }
            if (previousButton == null)
            {
                //Reset offset
                ScrollCurrentOffset = new Vector2(0, 0);
                //Find the first button from the end that´s visible and enabled
                for (int i = _buttonAreaList.Count - 1; i >= 0; i--)
                {
                    if (_buttonAreaList[i].Visible && !_buttonAreaList[i].Disabled)
                    {
                        previousButton = _buttonAreaList[i];
                        break;
                    }
                }
            }
            return(previousButton);
        }
Пример #3
0
 public virtual void SetStatusButtonArea(ButtonArea actualButton, ButtonStatusEnum newStatus)
 {
     foreach (ButtonArea button in _buttonAreaList)
     {
         if (button == actualButton && button.Visible && !button.Disabled)
         {
             button.Status = newStatus;
         }
         else
         {
             button.Status = ButtonStatusEnum.Idle;
         }
     }
     if (Scrollable)
     {
         if (_scrollUpButtonArea == actualButton && _scrollUpButtonArea.Visible && !_scrollUpButtonArea.Disabled)
         {
             _scrollUpButtonArea.Status = newStatus;
         }
         if (_scrollDownButtonArea == actualButton && _scrollDownButtonArea.Visible && !_scrollDownButtonArea.Disabled)
         {
             _scrollDownButtonArea.Status = newStatus;
         }
     }
 }
Пример #4
0
        public virtual void Update(ScreenManager manager, GameTime gameTime, GameSettings gameSettings, GameStatus gameStatus)
        {
            if (!_inputChecker.ButtonForSelectIsCurrentlyPressed(gameSettings) && !_inputChecker.ButtonForSelectMouseIsCurrentlyPressed(gameSettings) && !_inputChecker.GoBackButtonIsCurrentlyPressed(gameSettings) && !_inputChecker.MouseWheelUpIsCurrentlyTurned() && !_inputChecker.MouseWheelDownIsCurrentlyTurned())
            {
                manager.ButtonForSelectIsHeldDown = false;
            }
            if (!_inputChecker.ButtonForAlternateSelectIsCurrentlyPressed(gameSettings) && !_inputChecker.ButtonForAlternateSelectMouseIsCurrentlyPressed(gameSettings))
            {
                manager.ButtonForAlternateSelectIsHeldDown = false;
            }
            if (!manager.ButtonForSelectIsHeldDown && !manager.ButtonForAlternateSelectIsHeldDown && _anyButtonScreen != null && _inputChecker.AnyButtonIsCurrentlyPressed(gameSettings))
            {
                manager.ChangeScreen(gameTime, gameSettings, _anyButtonScreen);
            }
            if (_timeoutScreen != null & gameTime.TotalGameTime.TotalSeconds - _totalGameTimeEnter.TotalSeconds > _timeoutSeconds)
            {
                manager.ChangeScreen(gameTime, gameSettings, _timeoutScreen);
            }
            if (_inputChecker.PreviousVerticalButtonIsCurrentlyPressed(gameSettings))
            {
                _buttonPreviousVerticalAction.DoAction(manager, this, gameTime, gameSettings, gameStatus);
            }
            else if (_inputChecker.NextVerticalButtonIsCurrentlyPressed(gameSettings))
            {
                _buttonNextVerticalAction.DoAction(manager, this, gameTime, gameSettings, gameStatus);
            }
            else
            {
                _totalGameTimeFocusChange = new TimeSpan(0, 0, 0);
            }

            if (_inputChecker.PreviousHorizontalButtonIsCurrentlyPressed(gameSettings))
            {
                _buttonPreviousHorizontalAction.DoAction(manager, this, gameTime, gameSettings, gameStatus);
            }
            else if (_inputChecker.NextHorizontalButtonIsCurrentlyPressed(gameSettings))
            {
                _buttonNextHorizontalAction.DoAction(manager, this, gameTime, gameSettings, gameStatus);
            }

            if (!manager.ButtonForSelectIsHeldDown && _inputChecker.ButtonForSelectIsCurrentlyPressed(gameSettings))
            {
                SelectFocusedButtonArea(gameTime);
            }

            _buttonAreaList.Update(manager, this, gameTime, gameSettings, gameStatus);
            if (_inputChecker.HasMouseMoved(gameTime, gameSettings) || _inputChecker.HasMouseWheelMoved())
            {
                ButtonArea mouseOverButtonArea = _buttonAreaList.GetMouseOverButtonArea(gameTime, gameSettings, _resolutionFactory.GetResolution());
                if (mouseOverButtonArea != null)
                {
                    SetFocusedButtonArea(mouseOverButtonArea);
                }
                else
                {
                    _buttonAreaList.SetAllButtonAreasIdle();
                }
            }
        }
Пример #5
0
 public virtual void AddScrollDown(ButtonArea buttonArea)
 {
     buttonArea.SetContentManager(_contentManager);
     buttonArea.SetInputChecker(_inputChecker);
     buttonArea.SetButtonSelectAction(new ScrollDownAction());
     buttonArea.HasShortcutWithMouseWheelDown = true;
     _buttonAreaList.AddScrollDown(buttonArea);
 }
        public virtual bool MouseIsCurrentlyOverButtonArea(ButtonArea buttonArea, Vector2 offset, IResolution resolution)
        {
            Point   mouseScreenPosition = _currentMousePosition;
            Vector2 mousePosition       = resolution.ScreenToGameCoord(new Vector2(mouseScreenPosition.X, mouseScreenPosition.Y));
            Vector2 buttonAreaSize      = buttonArea.GetSize();

            return(mousePosition.X >= buttonArea.Position.X + offset.X && mousePosition.X <= buttonArea.Position.X + offset.X + buttonAreaSize.X && mousePosition.Y >= buttonArea.Position.Y + offset.Y && mousePosition.Y <= buttonArea.Position.Y + offset.Y + buttonAreaSize.Y);
        }
Пример #7
0
        public override void DoAction(ScreenManager manager, Screen screen, GameTime gameTime, GameSettings gameSettings, GameStatus gameStatus)
        {
            ButtonArea buttonArea = screen.GetSelectedOrFocusedButtonArea();

            if (buttonArea != null)
            {
                buttonArea.SetCurrentHorizontalValue(buttonArea.GetCurrentHorizontalValue() + _changeHorizontalStep);
                buttonArea.SetCurrentVerticalValue(buttonArea.GetCurrentVerticalValue() + _changeVerticalStep);
            }
        }
Пример #8
0
        internal static bool MapPage_receiveLeftClick_Prefix(int x, int y, bool playSound)
        {
            if (ButtonArea.Contains(x, y))
            {
                RSVWorldMap.Open(Game1.activeClickableMenu);
                return(false);
            }

            return(true);
        }
Пример #9
0
        protected virtual void SelectFocusedButtonArea(GameTime gameTime)
        {
            ButtonArea focusedButton = null;

            focusedButton = _buttonAreaList.GetFocusedButtonArea(focusedButton);
            if (focusedButton != null)
            {
                SetSelectedButtonArea(focusedButton);
            }
        }
Пример #10
0
        public virtual ButtonArea GetFocusedButtonArea(ButtonArea focusedButton)
        {
            int selectedIndex = GetFocusedButtonAreaIndex(false);

            if (selectedIndex >= 0)
            {
                focusedButton = _buttonAreaList[selectedIndex];
            }
            return(focusedButton);
        }
Пример #11
0
        public virtual ButtonArea GetSelectedOrFocusedButtonArea(ButtonArea selectedButton)
        {
            int selectedIndex = GetFocusedButtonAreaIndex(true);

            if (selectedIndex >= 0)
            {
                selectedButton = _buttonAreaList[selectedIndex];
            }
            return(selectedButton);
        }
Пример #12
0
        protected virtual void ChangeSelectedButtonAreaToFocused(GameTime gameTime)
        {
            ButtonArea selectedButton = null;

            selectedButton = _buttonAreaList.GetSelectedOrFocusedButtonArea(selectedButton);
            if (selectedButton != null)
            {
                SetFocusedButtonArea(selectedButton);
            }
        }
Пример #13
0
 public override void Initialize()
 {
     AddBackground("controlsmenu");
     ButtonArea returnButton = new ButtonArea();
     returnButton.AddImage("return");
     returnButton.Position = new Vector2(83, 390);
     returnButton.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen<SettingsMenuScreen>()));
     returnButton.HasShortcutWithGoBackButton = true;
     AddButtonArea(returnButton);
     base.Initialize();
 }
Пример #14
0
        internal static void MapPage_draw_Postfix(ref MapPage __instance, SpriteBatch b)
        {
            Game1.drawDialogueBox(ButtonArea.X - 92 + 60, ButtonArea.Y - 16 - 80, 250 - 42, 232, false, true);
            b.Draw(RSVIcon, new Vector2(EventDetection.ButtonArea.X, EventDetection.ButtonArea.Y), null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.1f);
            Point mouseCoords = Game1.getMousePosition(true);

            if (ButtonArea.Contains(mouseCoords.X, mouseCoords.Y))
            {
                IClickableMenu.drawHoverText(b, Helper.Translation.Get("RSV.MapIconName"), Game1.smallFont);
            }
            __instance.drawMouse(b);
        }
Пример #15
0
 public AirNoteButton(int noteType, NoteButtonEventHandler handler) : base(noteType, handler)
 {
     isMouseEnter           = false;
     buttonArea             = ButtonArea.None;
     previewBox.MouseEnter += PreviewBox_MouseEnter;
     previewBox.MouseLeave += PreviewBox_MouseLeave;
     previewBox.MouseMove  += PreviewBox_MouseMove;
     //
     VirtualButtonRect.Left   = new RectangleF(0, 0, virtualButtonWeight, previewBox.Height);
     VirtualButtonRect.Center = new RectangleF(
         virtualButtonWeight, 0, previewBox.Width - virtualButtonWeight * 2, previewBox.Height);
     VirtualButtonRect.Right = new RectangleF(
         previewBox.Width - virtualButtonWeight, 0, virtualButtonWeight, previewBox.Height);
 }
Пример #16
0
 public SizableNoteButton(int noteType, NoteButtonEventHandler handler) : base(noteType, handler)
 {
     NoteSize               = Status.NoteSize;
     isMouseEnter           = false;
     isMousePressed         = false;
     pressedLocation        = new Point();
     sizeDelta              = 0;
     buttonArea             = ButtonArea.None;
     previewBox.MouseEnter += PreviewBox_MouseEnter;
     previewBox.MouseLeave += PreviewBox_MouseLeave;
     previewBox.MouseMove  += PreviewBox_MouseMove;
     previewBox.MouseUp    += PreviewBox_MouseUp;
     //
     VirtualButtonRect.Top    = new RectangleF(0, 0, previewBox.Width, virtualButtonWeight);
     VirtualButtonRect.Center = new RectangleF(0, virtualButtonWeight, previewBox.Width, previewBox.Height - virtualButtonWeight * 2);
     VirtualButtonRect.Bottom = new RectangleF(0, previewBox.Height - virtualButtonWeight, previewBox.Width, virtualButtonWeight);
 }
Пример #17
0
 private void RefreshButtonArea(Point location)
 {
     if (VirtualButtonRect.Left.Contains(location))
     {
         buttonArea = ButtonArea.Left;
     }
     else if (VirtualButtonRect.Center.Contains(location))
     {
         buttonArea = ButtonArea.Center;
     }
     else if (VirtualButtonRect.Right.Contains(location))
     {
         buttonArea = ButtonArea.Right;
     }
     else
     {
         buttonArea = ButtonArea.None;
     }
 }
Пример #18
0
 protected void RefreshButtonArea(Point location)
 {
     if (VirtualButtonRect.Top.Contains(location))
     {
         buttonArea = ButtonArea.Top;
     }
     else if (VirtualButtonRect.Center.Contains(location))
     {
         buttonArea = ButtonArea.Center;
     }
     else if (VirtualButtonRect.Bottom.Contains(location))
     {
         buttonArea = ButtonArea.Bottom;
     }
     else
     {
         buttonArea = ButtonArea.None;
     }
     return;
 }
Пример #19
0
        public override void Initialize()
        {
            //AddBackground("soundmenu");
            ButtonArea returnButton = new ButtonArea();

            returnButton.AddImage("return");
            returnButton.Position = new Vector2(83, 390);
            returnButton.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <SettingsMenuScreen>()));
            returnButton.HasShortcutWithGoBackButton = true;
            AddButtonArea(returnButton);
            _masterVolumeButton.AddImage("soundmenu_mastervolume");
            _masterVolumeButton.AddImage("slider_bar", ButtonAreaImageNameTypeEnum.Actual, ButtonAreaImagePositioningEnum.ValueHorizontalSlider, ButtonAreaImageStackDirectionEnum.None);
            _masterVolumeButton.AddImage("slider");
            _masterVolumeButton.AddImage(";", ButtonAreaImageNameTypeEnum.Character);
            _masterVolumeButton.Position          = new Vector2(83, 540);
            _masterVolumeButton.SliderBorderLeft  = 24;
            _masterVolumeButton.SliderBorderRight = 24;

            //_masterVolumeButton.SetButtonSelectAction(new ChangeValueButtonAction(_masterVolumeButton, 1, 0));
            //_masterVolumeButton.SetButtonAlternateSelectAction(new ChangeValueButtonAction(_masterVolumeButton, -1, 0));
            AddButtonArea(_masterVolumeButton);
            _musicVolumeButton.AddImage("soundmenu_musicvolume");
            _musicVolumeButton.AddImage("slider_bar", ButtonAreaImageNameTypeEnum.Actual, ButtonAreaImagePositioningEnum.ValueHorizontalSlider, ButtonAreaImageStackDirectionEnum.None);
            _musicVolumeButton.AddImage("slider");
            _musicVolumeButton.AddImage(";", ButtonAreaImageNameTypeEnum.Character);
            _musicVolumeButton.Position          = new Vector2(83, 690);
            _musicVolumeButton.SliderBorderLeft  = 24;
            _musicVolumeButton.SliderBorderRight = 24;
            //_musicVolumeButton.SetButtonSelectAction(new ChangeValueButtonAction(_musicVolumeButton, 1, 0));
            //_musicVolumeButton.SetButtonAlternateSelectAction(new ChangeValueButtonAction(_musicVolumeButton, -1, 0));
            AddButtonArea(_musicVolumeButton);
            ButtonArea applyButton = new ButtonArea();

            applyButton.AddImage("apply_settings");
            applyButton.Position = new Vector2(83, 840);
            //applyButton.SetButtonAction(new ApplySettingFromRollingStateButtonAction(_fullscreenButton, _resolutionButton));
            AddButtonArea(applyButton);
            SetFocusedButtonArea(returnButton);
            base.Initialize();
        }
Пример #20
0
        protected virtual void CheckIfScrollUpOrDown(int focusedIndex)
        {
            if (focusedIndex >= 0)
            {
                ButtonArea focusedButton = _buttonAreaList[focusedIndex];
                if (focusedButton != null)
                {
                    if (focusedButton.Position.Y + focusedButton.GetSize().Y + ScrollCurrentOffset.Y >= _scrollDownButtonArea.Position.Y)
                    {
                        ButtonArea aboveFocusedButton = _buttonAreaList[focusedIndex - 1];
                        //Scroll down
                        ScrollCurrentOffset.Y -= focusedButton.Position.Y + focusedButton.GetSize().Y - (aboveFocusedButton.Position.Y + aboveFocusedButton.GetSize().Y);
                    }
                    else if (focusedButton.Position.Y + ScrollCurrentOffset.Y < _scrollUpButtonArea.Position.Y + _scrollUpButtonArea.GetSize().Y)
                    {
                        ButtonArea belowFocusedButton = _buttonAreaList[focusedIndex + 1];
                        //Scroll up
                        ScrollCurrentOffset.Y += belowFocusedButton.Position.Y + belowFocusedButton.GetSize().Y - (focusedButton.Position.Y + focusedButton.GetSize().Y);
                    }
                }
            }
            if (_buttonAreaList[_buttonAreaList.Count - 1].Position.Y + _buttonAreaList[_buttonAreaList.Count - 1].GetSize().Y + ScrollCurrentOffset.Y >= _scrollDownButtonArea.Position.Y)
            {
                _scrollDownButtonArea.Visible = true;
            }
            else
            {
                _scrollDownButtonArea.Visible = false;
            }

            if (_buttonAreaList[0].Position.Y + ScrollCurrentOffset.Y <= _scrollUpButtonArea.Position.Y + _scrollUpButtonArea.GetSize().Y)
            {
                _scrollUpButtonArea.Visible = true;
            }
            else
            {
                _scrollUpButtonArea.Visible = false;
            }
        }
Пример #21
0
        public virtual int HorizontalValueMouseSliderButtonArea(ButtonArea buttonArea, Vector2 offset, IResolution resolution)
        {
            Point     mouseScreenPosition  = _currentMousePosition;
            Vector2   mousePosition        = resolution.ScreenToGameCoord(new Vector2(mouseScreenPosition.X, mouseScreenPosition.Y));
            Rectangle buttonAreaSliderRect = buttonArea.GetHorizontalSliderRectangle();

            if ((int)mousePosition.X < buttonAreaSliderRect.X + (int)offset.X - buttonArea.SliderBorderLeft || (int)mousePosition.X > buttonAreaSliderRect.X + (int)offset.X + buttonAreaSliderRect.Width + buttonArea.SliderBorderRight || buttonAreaSliderRect.Width == 0)
            {
                return(-2);
            }
            else if ((int)mousePosition.X <= buttonAreaSliderRect.X + (int)offset.X)
            {
                return(-1);
            }
            else if ((int)mousePosition.X >= buttonAreaSliderRect.X + (int)offset.X + buttonAreaSliderRect.Width)
            {
                return(101);
            }
            else
            {
                return((int)((mousePosition.X - (buttonAreaSliderRect.X + offset.X)) / buttonAreaSliderRect.Width * 100f + 0.5f));
            }
        }
Пример #22
0
        public override void Initialize()
        {
            //AddBackground("graphicsmenu");
            ButtonArea returnButton = new ButtonArea();

            returnButton.AddImage("return");
            returnButton.Position = new Vector2(83, 390);
            returnButton.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <SettingsMenuScreen>()));
            returnButton.HasShortcutWithGoBackButton = true;
            AddButtonArea(returnButton);
            _fullscreenButton.AddRollingState("true");
            _fullscreenButton.AddRollingState("false");
            _fullscreenButton.AddImage("graphicsmenu_fullscreen");
            _fullscreenButton.AddImage("graphicsmenu_fullscreen_true_or_false", ButtonAreaImageNameTypeEnum.RollingState);
            _fullscreenButton.Position = new Vector2(83, 540);
            _fullscreenButton.SetButtonSelectAction(new NextRollingStateButtonAction(_fullscreenButton));
            _fullscreenButton.SetButtonAlternateSelectAction(new PreviousRollingStateButtonAction(_fullscreenButton));
            AddButtonArea(_fullscreenButton);
            foreach (DisplayMode displayMode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes)
            {
                _resolutionButton.AddRollingState(string.Format("{0:D}x{1:D};", displayMode.Width, displayMode.Height));
            }
            _resolutionButton.AddImage("graphicsmenu_resolution");
            _resolutionButton.AddImage("graphicsmenu_resolution_width_x_height", ButtonAreaImageNameTypeEnum.RollingStateCharacter);
            _resolutionButton.Position = new Vector2(83, 690);
            _resolutionButton.SetButtonSelectAction(new NextRollingStateButtonAction(_resolutionButton));
            _resolutionButton.SetButtonAlternateSelectAction(new PreviousRollingStateButtonAction(_resolutionButton));
            AddButtonArea(_resolutionButton);
            ButtonArea applyButton = new ButtonArea();

            applyButton.AddImage("apply_settings");
            applyButton.Position = new Vector2(83, 840);
            applyButton.SetButtonSelectAction(new ApplySettingFromRollingStateButtonAction(_fullscreenButton, _resolutionButton));
            AddButtonArea(applyButton);
            SetFocusedButtonArea(returnButton);
            base.Initialize();
        }
        public override void Initialize()
        {
            AddBackground("startmenu");
            ButtonArea continueGameButton = new ButtonArea();

            continueGameButton.AddImage("startmenu_continue");
            continueGameButton.Position = new Vector2(83, 414);
            continueGameButton.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <GameScreen>()));
            AddButtonArea(continueGameButton);
            ButtonArea loadGameButton = new ButtonArea();

            loadGameButton.AddImage("startmenu_load");
            loadGameButton.Position = new Vector2(83, 519);
            loadGameButton.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <LoadMenuScreen>()));
            AddButtonArea(loadGameButton);
            ButtonArea newGameButton = new ButtonArea();

            newGameButton.AddImage("startmenu_new");
            newGameButton.Position = new Vector2(83, 655);
            newGameButton.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <GameScreen>()));
            AddButtonArea(newGameButton);
            ButtonArea settingsButton = new ButtonArea();

            settingsButton.AddImage("startmenu_settings");
            settingsButton.Position = new Vector2(83, 790);
            settingsButton.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <SettingsMenuScreen>()));
            AddButtonArea(settingsButton);
            ButtonArea exitButton = new ButtonArea();

            exitButton.AddImage("startmenu_exit");
            exitButton.Position = new Vector2(83, 905);
            exitButton.SetButtonSelectAction(new ExitToDesktopButtonAction());
            //exitButton.HasShortcutWithGoBackButton = true;
            AddButtonArea(exitButton);
            SetFocusedButtonArea(continueGameButton);
            base.Initialize();
        }
Пример #24
0
 public virtual void AddScrollDown(ButtonArea buttonArea)
 {
     _scrollDownButtonArea = buttonArea;
 }
        public override void Initialize()
        {
            //AddBackground("loadmenu");
            ButtonArea returnButton = new ButtonArea();

            returnButton.AddImage("return");
            returnButton.Position = new Vector2(83, 120);
            returnButton.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <StartMenuScreen>()));
            returnButton.HasShortcutWithGoBackButton = true;
            AddButtonArea(returnButton);
            ButtonArea filelistButton1 = new ButtonArea();

            filelistButton1.AddImage("loadmenu_snapshot");
            filelistButton1.AddImage("0");
            filelistButton1.AddImage("1");
            filelistButton1.AddImage("end_paranteses");
            filelistButton1.Position = new Vector2(83, 270);
            filelistButton1.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <GameScreen>()));
            AddButtonArea(filelistButton1);
            ButtonArea filelistButton2 = new ButtonArea();

            filelistButton2.AddImage("loadmenu_snapshot");
            filelistButton2.AddImage("0");
            filelistButton2.AddImage("2");
            filelistButton2.AddImage("end_paranteses");
            filelistButton2.Position = new Vector2(83, 420);
            filelistButton2.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <GameScreen>()));
            AddButtonArea(filelistButton2);
            ButtonArea filelistButton3 = new ButtonArea();

            filelistButton3.AddImage("loadmenu_snapshot");
            filelistButton3.AddImage("0");
            filelistButton3.AddImage("3");
            filelistButton3.AddImage("end_paranteses");
            filelistButton3.Position = new Vector2(83, 570);
            filelistButton3.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <GameScreen>()));
            AddButtonArea(filelistButton3);
            ButtonArea filelistButton4 = new ButtonArea();

            filelistButton4.AddImage("loadmenu_snapshot");
            filelistButton4.AddImage("0");
            filelistButton4.AddImage("4");
            filelistButton4.AddImage("end_paranteses");
            filelistButton4.Position = new Vector2(83, 720);
            filelistButton4.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <GameScreen>()));
            AddButtonArea(filelistButton4);
            ButtonArea filelistButton5 = new ButtonArea();

            filelistButton5.AddImage("loadmenu_snapshot");
            filelistButton5.AddImage("0");
            filelistButton5.AddImage("5");
            filelistButton5.AddImage("end_paranteses");
            filelistButton5.Position = new Vector2(83, 870);
            filelistButton5.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <GameScreen>()));
            AddButtonArea(filelistButton5);
            ButtonArea filelistButton6 = new ButtonArea();

            filelistButton6.AddImage("loadmenu_snapshot");
            filelistButton6.AddImage("0");
            filelistButton6.AddImage("6");
            filelistButton6.AddImage("end_paranteses");
            filelistButton6.Position = new Vector2(83, 1020);
            filelistButton6.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <GameScreen>()));
            AddButtonArea(filelistButton6);
            ButtonArea filelistButton7 = new ButtonArea();

            filelistButton7.AddImage("loadmenu_snapshot");
            filelistButton7.AddImage("0");
            filelistButton7.AddImage("7");
            filelistButton7.AddImage("end_paranteses");
            filelistButton7.Position = new Vector2(83, 1170);
            filelistButton7.SetButtonSelectAction(new ChangeScreenButtonAction(_screenManager.GetScreen <GameScreen>()));
            AddButtonArea(filelistButton7);

            ButtonArea scrollUpButton = new ButtonArea();

            scrollUpButton.AddImage("loadmenu_up");
            scrollUpButton.Position = new Vector2(83, 0);
            AddScrollUp(scrollUpButton);
            ButtonArea scrollDownButton = new ButtonArea();

            scrollDownButton.AddImage("loadmenu_down");
            scrollDownButton.Position = new Vector2(83, 870);
            AddScrollDown(scrollDownButton);

            SetScrollable(true);
            SetFocusedAtEnterButtonArea(returnButton);
            base.Initialize();
        }
 public PreviousRollingStateButtonAction(ButtonArea buttonArea, bool isRollingState2 = false)
 {
     _buttonArea      = buttonArea;
     _isRollingState2 = isRollingState2;
 }
Пример #27
0
 public virtual void SetFocusedAtEnterButtonArea(ButtonArea focusedButton)
 {
     _focusedAtEnterButtonArea = focusedButton;
 }
Пример #28
0
 public virtual void SetSelectedButtonArea(ButtonArea selectedButton)
 {
     _buttonAreaList.SetStatusButtonArea(selectedButton, ButtonStatusEnum.Selected);
 }
Пример #29
0
 public virtual void SetFocusedButtonArea(ButtonArea focusedButton)
 {
     _buttonAreaList.SetStatusButtonArea(focusedButton, ButtonStatusEnum.Focused);
 }
Пример #30
0
 public virtual void AddButtonArea(ButtonArea buttonArea)
 {
     buttonArea.SetContentManager(_contentManager);
     buttonArea.SetInputChecker(_inputChecker);
     _buttonAreaList.Add(buttonArea);
 }