aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/dialogs.h
diff options
context:
space:
mode:
authorPaul Gilbert2015-01-02 15:25:14 -1000
committerPaul Gilbert2015-01-02 15:25:14 -1000
commit9b40bd5c6aa8110e7b3a13eec2550a4c6f201668 (patch)
treed01b3b167be8c90ef338fdb2eabfb8f682ce83f6 /engines/xeen/dialogs.h
parente1404f127d376225d0c15c43b12f59749689c731 (diff)
downloadscummvm-rg350-9b40bd5c6aa8110e7b3a13eec2550a4c6f201668.tar.gz
scummvm-rg350-9b40bd5c6aa8110e7b3a13eec2550a4c6f201668.tar.bz2
scummvm-rg350-9b40bd5c6aa8110e7b3a13eec2550a4c6f201668.zip
XEEN: More UI loading code, refactored Dialog base to ButtonContainer
Diffstat (limited to 'engines/xeen/dialogs.h')
-rw-r--r--engines/xeen/dialogs.h45
1 files changed, 26 insertions, 19 deletions
diff --git a/engines/xeen/dialogs.h b/engines/xeen/dialogs.h
index 1f8f2fb624..61ae73473d 100644
--- a/engines/xeen/dialogs.h
+++ b/engines/xeen/dialogs.h
@@ -26,36 +26,39 @@
#include "common/array.h"
#include "common/stack.h"
#include "common/rect.h"
-#include "xeen/xeen.h"
+#include "xeen/sprites.h"
namespace Xeen {
-class DialogButton {
+class XeenEngine;
+
+class UIButton {
public:
Common::Rect _bounds;
SpriteResource *_sprites;
- char _c;
+ int _value;
bool _draw;
- DialogButton(const Common::Rect &bounds, char c, SpriteResource *sprites, bool draw) :
- _bounds(bounds), _c(c), _sprites(sprites), _draw(draw) {}
+ UIButton(const Common::Rect &bounds, int value, SpriteResource *sprites, bool draw) :
+ _bounds(bounds), _value(value), _sprites(sprites), _draw(draw) {}
- DialogButton() : _c('\0'), _sprites(nullptr), _draw(false) {}
+ UIButton() : _value(0), _sprites(nullptr), _draw(false) {}
};
-class Dialog {
+class ButtonContainer {
private:
- Common::Stack< Common::Array<DialogButton> > _savedButtons;
+ Common::Stack< Common::Array<UIButton> > _savedButtons;
protected:
- XeenEngine *_vm;
- Common::Array<DialogButton> _buttons;
- char _key;
+ Common::Array<UIButton> _buttons;
+ int _buttonValue;
- void doScroll(bool drawFlag, bool doFade);
+ void doScroll(XeenEngine *vm, bool drawFlag, bool doFade);
- void checkEvents();
+ void checkEvents(XeenEngine *vm);
+
+ void drawButtons(XSurface *surface);
public:
- Dialog(XeenEngine *vm): _vm(vm), _key('\0') {}
+ ButtonContainer() : _buttonValue(0) {}
void saveButtons();
@@ -63,19 +66,23 @@ public:
void restoreButtons();
- void addButton(const Common::Rect &bounds, char c, SpriteResource *sprites, bool draw);
+ void addButton(const Common::Rect &bounds, int val, SpriteResource *sprites, bool draw);
};
-class SettingsBaseDialog : public Dialog {
+class SettingsBaseDialog : public ButtonContainer {
protected:
+ XeenEngine *_vm;
+
virtual void showContents(SpriteResource &title1, bool mode);
public:
- SettingsBaseDialog(XeenEngine *vm) : Dialog(vm) {}
+ SettingsBaseDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
};
-class CreditsScreen: public Dialog {
+class CreditsScreen: public ButtonContainer {
private:
- CreditsScreen(XeenEngine *vm) : Dialog(vm) {}
+ XeenEngine *_vm;
+
+ CreditsScreen(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
void execute();
public: