diff options
author | Paul Gilbert | 2018-03-03 22:15:50 -0500 |
---|---|---|
committer | Paul Gilbert | 2018-03-04 22:40:42 -0500 |
commit | 50630efde6d0f42f4d5f371d6818afac64ba86f5 (patch) | |
tree | 034029b8f90e94daaca83e6ff9413b4508c7dc97 /engines/xeen/worldofxeen/worldofxeen_menu.h | |
parent | 92c49a857161b1650ca197c71668ee189d667e48 (diff) | |
download | scummvm-rg350-50630efde6d0f42f4d5f371d6818afac64ba86f5.tar.gz scummvm-rg350-50630efde6d0f42f4d5f371d6818afac64ba86f5.tar.bz2 scummvm-rg350-50630efde6d0f42f4d5f371d6818afac64ba86f5.zip |
XEEN: Fix loading saves from main menus and launcher
Diffstat (limited to 'engines/xeen/worldofxeen/worldofxeen_menu.h')
-rw-r--r-- | engines/xeen/worldofxeen/worldofxeen_menu.h | 179 |
1 files changed, 139 insertions, 40 deletions
diff --git a/engines/xeen/worldofxeen/worldofxeen_menu.h b/engines/xeen/worldofxeen/worldofxeen_menu.h index 39d309c751..3495f08923 100644 --- a/engines/xeen/worldofxeen/worldofxeen_menu.h +++ b/engines/xeen/worldofxeen/worldofxeen_menu.h @@ -29,82 +29,181 @@ namespace Xeen { namespace WorldOfXeen { -class WorldOfXeenMenu : public SettingsBaseDialog { +class MainMenuDialog; + +class MainMenuContainer { private: - void execute(); -protected: - WorldOfXeenMenu(XeenEngine *vm) : SettingsBaseDialog(vm) {} + int _animateCtr; + SpriteResource _backgroundSprites; + MainMenuDialog *_dialog; protected: - virtual void startup(Common::String &title1, Common::String &title2) = 0; + /** + * Draws the main menu background + */ + void draw(); - virtual void setBackground(bool doFade) {} + /** + * Load the background + */ + virtual void loadBackground() = 0; - virtual void showTitles1(SpriteResource &sprites); + /** + * Shows the main menu dialog + */ + virtual void showMenuDialog() = 0; +public: + /** + * Show the main menu for the correct game + */ + static void show(); +public: + /** + * Constructor + */ + MainMenuContainer(const Common::String &spritesName); - virtual void showTitles2(); + /** + * Destructor + */ + virtual ~MainMenuContainer(); - virtual void setupButtons(SpriteResource *buttons); + /** + * Execute the menu + */ + void execute(); /** - * Opens the menu window + * Sets the dialog being displayed in the menu */ - virtual void openWindow() {} + void setOwner(MainMenuDialog *dlalog) { + _dialog = dlalog; + } +}; +class CloudsMainMenuContainer : public MainMenuContainer { +protected: /** - * Closes the menu window + * Load the background */ - virtual void closeWindow() {} -public: - virtual ~WorldOfXeenMenu() {} + virtual void loadBackground(); - static void show(XeenEngine *vm); + /** + * Shows the main menu dialog + */ + virtual void showMenuDialog(); +public: + CloudsMainMenuContainer(); }; -class CloudsOptionsMenu : public WorldOfXeenMenu { +class DarkSideMainMenuContainer : public MainMenuContainer { protected: - virtual void startup(Common::String &title1, Common::String &title2); -public: - CloudsOptionsMenu(XeenEngine *vm) : WorldOfXeenMenu(vm) {} + /** + * Load the background + */ + virtual void loadBackground(); - virtual ~CloudsOptionsMenu() {} + /** + * Shows the main menu dialog + */ + virtual void showMenuDialog(); +public: + DarkSideMainMenuContainer(); }; -class DarkSideOptionsMenu : public WorldOfXeenMenu { +class WorldOfXeenMainMenuContainer : public MainMenuContainer { protected: - virtual void startup(Common::String &title1, Common::String &title2); -public: - DarkSideOptionsMenu(XeenEngine *vm) : WorldOfXeenMenu(vm) {} + /** + * Load the background + */ + virtual void loadBackground(); - virtual ~DarkSideOptionsMenu() {} + /** + * Shows the main menu dialog + */ + virtual void showMenuDialog(); +public: + WorldOfXeenMainMenuContainer(); }; -class WorldOptionsMenu : public DarkSideOptionsMenu { +class MenuContainerDialog : public ButtonContainer { private: - int _bgFrame; -protected: - virtual void startup(Common::String &title1, Common::String &title2); + MainMenuContainer *_owner; +public: + /** + * Constructor + */ + MenuContainerDialog(MainMenuContainer *owner) : ButtonContainer(g_vm), _owner(owner) {} - virtual void setBackground(bool doFade); + /** + * Destructor + */ + virtual ~MenuContainerDialog() { + _owner->setOwner(nullptr); + } + + /** + * Draws the dialog + */ + virtual void draw() = 0; - virtual void showTitles2() {} + /** + * Handles events + */ + virtual bool handleEvents() = 0; +}; - virtual void setupButtons(SpriteResource *buttons); +class MainMenuDialog : public MenuContainerDialog { +public: + /** + * Constructor + */ + MainMenuDialog(MainMenuContainer *owner) : MenuContainerDialog(owner) {} /** - * Opens the menu window + * Destructor */ - virtual void openWindow(); + virtual ~MainMenuDialog() {} /** - * Closes the menu window + * Draws the dialog */ - virtual void closeWindow(); + virtual void draw() = 0; - virtual void showContents(SpriteResource &title1, bool mode); + /** + * Handles events + */ + virtual bool handleEvents(); + +}; + +class CloudsMenuDialog : public MainMenuDialog { +private: + SpriteResource _buttonSprites; +private: + /** + * Loads buttons for the dialog + */ + void loadButtons(); public: - WorldOptionsMenu(XeenEngine *vm) : DarkSideOptionsMenu(vm), _bgFrame(0) {} + /** + * Constructor + */ + CloudsMenuDialog(MainMenuContainer *owner); - virtual ~WorldOptionsMenu() {} + /** + * Destructor + */ + virtual ~CloudsMenuDialog(); + + /** + * Draws the dialog + */ + virtual void draw(); + + /** + * Handles events + */ + virtual bool handleEvents(); }; } // End of namespace WorldOfXeen |