/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "common/config-manager.h" #include "graphics/font.h" #include "graphics/managed_surface.h" #include "audio/mixer.h" #include "vcruise/menu.h" #include "vcruise/runtime.h" #include "vcruise/vcruise.h" namespace VCruise { class ReahSchizmMenuPage : public MenuPage { public: explicit ReahSchizmMenuPage(bool isSchizm); bool run() override; void start() override; protected: virtual void onButtonClicked(uint button, bool &outChangedState); virtual void onCheckboxClicked(uint button, bool &outChangedState); virtual void onSliderMoved(uint slider); virtual void onKeymappedEvent(VCruise::KeymappedEvent evt, bool &outChangedState); virtual void eraseSlider(uint sliderIndex) const; protected: enum ButtonState { kButtonStateDisabled, kButtonStateIdle, kButtonStateHighlighted, kButtonStatePressed, }; enum CheckboxState { kCheckboxStateOff, kCheckboxStateOffHighlighted, kCheckboxStateOn, kCheckboxStateOnHighlighted, }; enum InteractionState { kInteractionStateNotInteracting, kInteractionStateOverButton, kInteractionStateClickingOnButton, kInteractionStateClickingOffButton, kInteractionStateOverSlider, kInteractionStateDraggingSlider, kInteractionStateOverCheckbox, kInteractionStateClickingOnCheckbox, kInteractionStateClickingOffCheckbox, }; struct Button { Button(); Button(Graphics::ManagedSurface *graphic, const Common::Rect &graphicRect, const Common::Rect &screenRect, const Common::Rect &interactiveRect, const Common::Point &stateOffset, bool enabled); Button(Graphics::ManagedSurface *graphic, const Common::Rect &graphicRect, const Common::Rect &screenRect, const Common::Rect &interactiveRect, const Common::Point &stateOffset, bool enabled, const Common::String (&states)[4]); Button(Graphics::ManagedSurface *graphic, const Common::Rect &graphicRect, const Common::Rect &screenAndInteractiveRect, const Common::Point &stateOffset, bool enabled); Button(Graphics::ManagedSurface *graphic, const Common::Rect &graphicRect, const Common::Rect &screenAndInteractiveRect, const Common::Point &stateOffset, bool enabled, const Common::String (&states)[4]); Graphics::ManagedSurface *_graphic; Common::Rect _graphicRect; Common::Rect _screenRect; Common::Rect _interactiveRect; Common::Point _stateOffset; bool _enabled; Common::String _buttonStates[4]; }; struct Slider { Slider(); Slider(Graphics::ManagedSurface *graphic, const Common::Rect &baseRect, int value, int maxValue); Graphics::ManagedSurface *_graphic; Common::Rect _baseRect; int _value; int _maxValue; }; protected: void drawButtonInState(uint buttonIndex, ButtonState state) const; void drawCheckboxInState(uint buttonIndex, CheckboxState state) const; void drawSlider(uint sliderIndex) const; void drawButtonFromListInState(const Common::Array