diff options
author | Bastien Bouclet | 2016-02-20 14:40:55 +0100 |
---|---|---|
committer | Bastien Bouclet | 2016-02-22 08:44:55 +0100 |
commit | 524d7ec5ec4e8c88cc37bbb5125383b1e3014cd6 (patch) | |
tree | 2c675f6177c3f0e119d007fe27f2a8be24c560b7 | |
parent | c3c09a1c83b24d9c0206d9cbb86a4d6d641232b1 (diff) | |
download | scummvm-rg350-524d7ec5ec4e8c88cc37bbb5125383b1e3014cd6.tar.gz scummvm-rg350-524d7ec5ec4e8c88cc37bbb5125383b1e3014cd6.tar.bz2 scummvm-rg350-524d7ec5ec4e8c88cc37bbb5125383b1e3014cd6.zip |
MOHAWK: Center the options dialog
-rw-r--r-- | engines/mohawk/dialogs.cpp | 13 | ||||
-rw-r--r-- | engines/mohawk/dialogs.h | 1 |
2 files changed, 13 insertions, 1 deletions
diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp index 492e6104d2..73b1a15300 100644 --- a/engines/mohawk/dialogs.cpp +++ b/engines/mohawk/dialogs.cpp @@ -87,7 +87,7 @@ enum { #ifdef ENABLE_MYST -MystOptionsDialog::MystOptionsDialog(MohawkEngine_Myst* vm) : GUI::Dialog(120, 120, 360, 200), _vm(vm) { +MystOptionsDialog::MystOptionsDialog(MohawkEngine_Myst* vm) : GUI::Dialog(0, 0, 360, 200), _vm(vm) { // I18N: Option for fast scene switching _zipModeCheckbox = new GUI::CheckboxWidget(this, 15, 10, 300, 15, _("~Z~ip Mode Activated"), 0, kZipCmd); _transitionsCheckbox = new GUI::CheckboxWidget(this, 15, 30, 300, 15, _("~T~ransitions Enabled"), 0, kTransCmd); @@ -135,6 +135,17 @@ void MystOptionsDialog::open() { _transitionsCheckbox->setState(_vm->_gameState->_globals.transitions); } +void MystOptionsDialog::reflowLayout() { + const int screenW = g_system->getOverlayWidth(); + const int screenH = g_system->getOverlayHeight(); + + // Center the dialog + _x = (screenW - getWidth()) / 2; + _y = (screenH - getHeight()) / 2; + + Dialog::reflowLayout(); +} + void MystOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) { switch (cmd) { case kDropCmd: diff --git a/engines/mohawk/dialogs.h b/engines/mohawk/dialogs.h index c017cb22fb..da8909061f 100644 --- a/engines/mohawk/dialogs.h +++ b/engines/mohawk/dialogs.h @@ -76,6 +76,7 @@ public: ~MystOptionsDialog(); void open(); + virtual void reflowLayout() override; virtual void handleCommand(GUI::CommandSender*, uint32, uint32); private: MohawkEngine_Myst *_vm; |