From 97d29debeb008bf75ed4bda1ec884fd17e49a8bc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 18 Jul 2014 20:20:18 -0400 Subject: MADS: Beginnings of work on Rex Nebular main menu --- engines/mads/nebular/dialogs_nebular.h | 64 +++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 9 deletions(-) (limited to 'engines/mads/nebular/dialogs_nebular.h') diff --git a/engines/mads/nebular/dialogs_nebular.h b/engines/mads/nebular/dialogs_nebular.h index 44412797a1..46973cc497 100644 --- a/engines/mads/nebular/dialogs_nebular.h +++ b/engines/mads/nebular/dialogs_nebular.h @@ -107,7 +107,35 @@ enum DialogTextAlign { ALIGN_NONE = 0, ALIGN_CENTER = -1, ALIGN_AT_CENTER = -2, enum DialogState { DLGSTATE_UNSELECTED = 0, DLGSTATE_SELECTED = 1, DLGSTATE_FOCUSED = 2 }; -class ScreenDialog { +class FullScreenDialog { +protected: + /** + * Engine reference + */ + MADSEngine *_vm; + + /** + * Used to store the original screen background + */ + MSurface _savedSurface; + + /** + * Screen/scene to show background from + */ + int _screenId; + + /** + * Handles displaying the screen background and dialog + */ + virtual void display(); +public: + /** + * Constructor + */ + FullScreenDialog(MADSEngine *vm); +}; + +class GameDialog: public FullScreenDialog { struct DialogLine { bool _active; DialogState _state; @@ -116,22 +144,25 @@ class ScreenDialog { Common::String _msg; Font *_font; int _widthAdjust; - + DialogLine(); DialogLine(const Common::String &s); }; protected: - MADSEngine *_vm; Common::Array _lines; int _tempLine; bool _movedFlag; bool _redrawFlag; int _selectedLine; bool _dirFlag; - int _screenId; int _menuSpritesIndex; int _lineIndex; int _textLineCount; + + /** + * Display the dialog + */ + virtual void display(); /** * Reset the lines list for the dialog @@ -181,12 +212,12 @@ public: /** * Constructor */ - ScreenDialog(MADSEngine *vm); + GameDialog(MADSEngine *vm); /** * Destructor */ - virtual ~ScreenDialog(); + virtual ~GameDialog(); /** * Show the dialog @@ -194,7 +225,7 @@ public: virtual void show(); }; -class DifficultyDialog : public ScreenDialog { +class DifficultyDialog : public GameDialog { private: /** * Set the lines for the dialog @@ -203,13 +234,18 @@ private: public: DifficultyDialog(MADSEngine *vm); + /** + * Display the dialog + */ + virtual void display(); + /** * Show the dialog */ virtual void show(); }; -class GameMenuDialog : public ScreenDialog { +class GameMenuDialog : public GameDialog { private: /** * Set the lines for the dialog @@ -218,13 +254,18 @@ private: public: GameMenuDialog(MADSEngine *vm); + /** + * Display the dialog + */ + virtual void display(); + /** * Show the dialog */ virtual void show(); }; -class OptionsDialog : public ScreenDialog { +class OptionsDialog : public GameDialog { private: /** * Set the lines for the dialog @@ -238,6 +279,11 @@ private: public: OptionsDialog(MADSEngine *vm); + /** + * Display the dialog + */ + virtual void display(); + /** * Show the dialog */ -- cgit v1.2.3