diff options
author | Eugene Sandulenko | 2016-01-21 11:09:29 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-02-14 17:12:49 +0100 |
commit | 936609fb11e9a75f7cb5b2f0d5e22c94a7e0ff80 (patch) | |
tree | 6d77aafda7145d305a5ed419954080cf4fbd86c7 /engines/wage/dialog.cpp | |
parent | c7eed7f0ad4b3c23694c1b97578a4b8b86be54f9 (diff) | |
download | scummvm-rg350-936609fb11e9a75f7cb5b2f0d5e22c94a7e0ff80.tar.gz scummvm-rg350-936609fb11e9a75f7cb5b2f0d5e22c94a7e0ff80.tar.bz2 scummvm-rg350-936609fb11e9a75f7cb5b2f0d5e22c94a7e0ff80.zip |
WAGE: Implemented saveDialog()
Diffstat (limited to 'engines/wage/dialog.cpp')
-rw-r--r-- | engines/wage/dialog.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/engines/wage/dialog.cpp b/engines/wage/dialog.cpp index a02058c331..b58e4af680 100644 --- a/engines/wage/dialog.cpp +++ b/engines/wage/dialog.cpp @@ -56,24 +56,23 @@ namespace Wage { enum { - kDialogWidth = 199, kDialogHeight = 113 }; -Dialog::Dialog(Gui *gui, const char *text, DialogButtonArray *buttons) : _gui(gui), _text(text), _buttons(buttons) { +Dialog::Dialog(Gui *gui, int width, const char *text, DialogButtonArray *buttons, int defaultButton) : + _gui(gui), _text(text), _buttons(buttons), _defaultButton(defaultButton) { assert(_gui->_engine); assert(_gui->_engine->_world); _font = getDialogFont(); - _tempSurface.create(kDialogWidth, kDialogHeight, Graphics::PixelFormat::createFormatCLUT8()); + _tempSurface.create(width, kDialogHeight, Graphics::PixelFormat::createFormatCLUT8()); - _bbox.left = (_gui->_screen.w - kDialogWidth) / 2; + _bbox.left = (_gui->_screen.w - width) / 2; _bbox.top = (_gui->_screen.h - kDialogHeight) / 2; - _bbox.right = (_gui->_screen.w + kDialogWidth) / 2; + _bbox.right = (_gui->_screen.w + width) / 2; _bbox.bottom = (_gui->_screen.h + kDialogHeight) / 2; - _defaultButton = -1; _pressedButton = -1; _mouseOverPressedButton = false; @@ -81,9 +80,6 @@ Dialog::Dialog(Gui *gui, const char *text, DialogButtonArray *buttons) : _gui(gu // Adjust button positions for (int i = 0; i < _buttons->size(); i++) _buttons->operator[](i)->bounds.translate(_bbox.left, _bbox.top); - - if (_buttons->size() == 1) - _defaultButton = 0; } Dialog::~Dialog() { @@ -151,8 +147,11 @@ void Dialog::run() { while (_gui->_engine->_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_QUIT: + _gui->_engine->_shouldQuit = true; shouldQuit = true; break; + case Common::EVENT_MOUSEMOVE: + default: break; } |