From cf5cd833fde2765668aea3b8f234388da3f9f94d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 24 Mar 2010 11:49:26 +0000 Subject: Moved new MadsView related code into Mads_Views, where it's more appropriate. Added extra logic necessary for displaying text in the game dialogs svn-id: r48378 --- engines/m4/mads_menus.h | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'engines/m4/mads_menus.h') diff --git a/engines/m4/mads_menus.h b/engines/m4/mads_menus.h index 5d3258ab46..d732723fcf 100644 --- a/engines/m4/mads_menus.h +++ b/engines/m4/mads_menus.h @@ -28,6 +28,7 @@ #include "common/str-array.h" #include "m4/viewmgr.h" +#include "m4/mads_views.h" #include "m4/font.h" namespace M4 { @@ -36,6 +37,8 @@ namespace M4 { enum MadsGameAction {START_GAME, RESUME_GAME, SHOW_INTRO, CREDITS, QUOTES, EXIT}; +enum MadsLayers {LAYER_GUI = 19}; + class RexMainMenuView : public View { private: M4Surface *_bgSurface; @@ -88,10 +91,12 @@ public: void updateState(); }; +enum DialogTextState {STATE_DESELECTED = 0, STATE_HIGHLIGHTED = 1, STATE_SELECTED = 2}; + class DialogTextEntry { public: bool in_use; - int16 field_2; + int state; Common::Point pos; char text[80]; Font *font; @@ -115,17 +120,6 @@ private: void initialiseGraphics(); void loadBackground(); void loadMenuSprites(); -protected: - int _word_8502C; - int _selectedLine; - int _lineIndex; - bool _enterFlag; - Common::StringArray _textLines; - - void setFrame(int frameNumber, int depth); - void initVars(); - void addLine(const char *msg_p, Font *font, MadsTextAlignment alignment, int left, int top); - void addQuote(Font *font, MadsTextAlignment alignment, int left, int top, int id1, int id2 = 0); protected: M4Surface *_backgroundSurface; RGBList *_bgPalData; @@ -133,9 +127,22 @@ protected: RGBList *_spritesPalData; Common::Array _dialogText; + Common::StringArray _textLines; int _totalTextEntries; int _dialogSelectedLine; Common::StringArray _saveList; + + int _word_8502C; + int _selectedLine; + int _lineIndex; + bool _enterFlag; + + void setFrame(int frameNumber, int depth); + void initVars(); + void addLine(const char *msg_p, Font *font, MadsTextAlignment alignment, int left, int top); + void addQuote(Font *font, MadsTextAlignment alignment, int left, int top, int id1, int id2 = 0); + void setClickableLines(); + void refreshText(); public: RexDialogView(); ~RexDialogView(); @@ -151,6 +158,7 @@ public: RexGameMenuDialog(); virtual void onRefresh(RectList *rects, M4Surface *destSurface); + virtual bool onEvent(M4EventType eventType, int32 param1, int x, int y, bool &captureEvents); }; } -- cgit v1.2.3