From 6b774d228495e2dc9de08520a3064889d439335d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 22 Feb 2014 18:21:18 -0500 Subject: MADS: Copy protection dialog is starting to be displayed --- engines/mads/nebular/dialogs_nebular.cpp | 21 ++++++++++++++------- engines/mads/nebular/dialogs_nebular.h | 12 ++++++------ engines/mads/nebular/game_nebular.cpp | 3 +-- 3 files changed, 21 insertions(+), 15 deletions(-) (limited to 'engines/mads/nebular') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 76b6162d14..95a485d170 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -31,13 +31,6 @@ namespace MADS { namespace Nebular { -bool CopyProtectionDialog::show(MADSEngine *vm) { - CopyProtectionDialog *dlg = new CopyProtectionDialog(vm, false); - - delete dlg; - return true; -} - CopyProtectionDialog::CopyProtectionDialog(MADSEngine *vm, bool priorAnswerWrong): TextDialog(vm, FONT_INTERFACE, Common::Point(-1, -1), 32) { getHogAnusEntry(_hogEntry); @@ -76,6 +69,20 @@ CopyProtectionDialog::CopyProtectionDialog(MADSEngine *vm, bool priorAnswerWrong wordWrap(" "); wordWrap("\n"); + // TODO: Rest of setup +} + +bool CopyProtectionDialog::show() { + draw(); + _vm->_events->showCursor(); + + // TODO: Replace with text input + while (!_vm->shouldQuit() && !_vm->_events->_keyPressed && + !_vm->_events->_mouseClicked) { + _vm->_events->delay(1); + } + + return true; } bool CopyProtectionDialog::getHogAnusEntry(HOGANUS &entry) { diff --git a/engines/mads/nebular/dialogs_nebular.h b/engines/mads/nebular/dialogs_nebular.h index 7a63397603..53f377ae0a 100644 --- a/engines/mads/nebular/dialogs_nebular.h +++ b/engines/mads/nebular/dialogs_nebular.h @@ -43,20 +43,20 @@ class CopyProtectionDialog: public TextDialog { private: HOGANUS _hogEntry; - /** - * Constructor - */ - CopyProtectionDialog(MADSEngine *vm, bool priorAnswerWrong); - /** * Get a random copy protection entry from the HOGANUS resource */ bool getHogAnusEntry(HOGANUS &entry); public: + /** + * Constructor + */ + CopyProtectionDialog(MADSEngine *vm, bool priorAnswerWrong); + /** * Show the dialog */ - static bool show(MADSEngine *vm); + bool show(); }; } // End of namespace Nebular diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index dc2b1450ec..bf52af3733 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -41,11 +41,10 @@ bool GameNebular::checkCopyProtection() { if (!ConfMan.getBool("copy_protection")) return true; - MessageDialog *dlg = new MessageDialog(_vm, 40, "Line 1", "Line 2", nullptr); + CopyProtectionDialog *dlg = new CopyProtectionDialog(_vm, false); dlg->show(); delete dlg; - //CopyProtectionDialog::show(_vm); return false; } -- cgit v1.2.3