diff options
author | Eugene Sandulenko | 2014-04-20 22:41:00 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2014-04-20 23:03:44 +0300 |
commit | 4f05fa6586f2d8784c6fcac9210c215805073910 (patch) | |
tree | a419eb1c81c13631fa514220d1260c7d3a519d00 | |
parent | 1d41a9ccf4651e6c3e9f36b9bd4b69a85c1ab6b1 (diff) | |
download | scummvm-rg350-4f05fa6586f2d8784c6fcac9210c215805073910.tar.gz scummvm-rg350-4f05fa6586f2d8784c6fcac9210c215805073910.tar.bz2 scummvm-rg350-4f05fa6586f2d8784c6fcac9210c215805073910.zip |
FULLPIPE: Implement ModalQuery::create()
-rw-r--r-- | engines/fullpipe/constants.h | 9 | ||||
-rw-r--r-- | engines/fullpipe/modal.cpp | 48 | ||||
-rw-r--r-- | engines/fullpipe/modal.h | 10 |
3 files changed, 56 insertions, 11 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index c0b7ed906c..8f3f587714 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -267,7 +267,6 @@ namespace Fullpipe { #define TrubaUp 680 // Main Menu -#define PIC_MEX_BGR 5300 #define PIC_MNU_AUTHORS_L 4624 #define PIC_MNU_CONTINUE_L 4626 #define PIC_MNU_DEBUG_L 4632 @@ -280,6 +279,14 @@ namespace Fullpipe { #define PIC_MNU_SLIDER_D 4913 #define PIC_MNU_SLIDER_L 4912 +// Query dialog +#define PIC_MEX_BGR 5300 +#define PIC_MEX_CANCEL 5302 +#define PIC_MEX_OK 5301 +#define PIC_MOV_BGR 5343 +#define PIC_MOV_CANCEL 5345 +#define PIC_MOV_OK 5344 + // Intro #define ANI_IN1MAN 5110 #define MSG_INTR_ENDINTRO 5139 diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index a85dc57a62..563e0f9950 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -21,13 +21,13 @@ */ #include "fullpipe/fullpipe.h" -#include "fullpipe/modal.h" #include "fullpipe/messages.h" #include "fullpipe/constants.h" #include "fullpipe/motion.h" #include "fullpipe/scenes.h" #include "fullpipe/gameloader.h" #include "fullpipe/statics.h" +#include "fullpipe/modal.h" #include "fullpipe/constants.h" @@ -920,7 +920,7 @@ bool ModalMainMenu::init(int counterdiff) { g_fp->_modalObject = mq; mq->_parentObj = this; - mq->create(_scene, PIC_MEX_BGR); + mq->create(_scene, &_scene->_picObjList, PIC_MEX_BGR); _hoverAreaId = 0; @@ -1322,15 +1322,53 @@ void ModalHelp::launch() { } ModalQuery::ModalQuery() { - _field_8 = 0; + _picObjList = 0; _bg = 0; _okBtn = 0; _cancelBtn = 0; _queryResult = -1; } -void ModalQuery::create(Scene *sc, int picId) { - warning("STUB: ModalQuery::create()"); +bool ModalQuery::create(Scene *sc, PtrList *picObjList, int id) { + if (id == PIC_MEX_BGR) { + _bg = sc->getPictureObjectById(PIC_MEX_BGR, 0); + + if (!_bg) + return false; + + _okBtn = sc->getPictureObjectById(PIC_MEX_OK, 0); + + if (!_okBtn) + return false; + + _cancelBtn = sc->getPictureObjectById(PIC_MEX_CANCEL, 0); + + if (!_cancelBtn) + return 0; + } else { + if (id != PIC_MOV_BGR) + return false; + + _bg = sc->getPictureObjectById(PIC_MOV_BGR, 0); + + if (!_bg) + return false; + + _okBtn = sc->getPictureObjectById(PIC_MOV_OK, 0); + + if (!_okBtn) + return false; + + _cancelBtn = sc->getPictureObjectById(PIC_MOV_CANCEL, 0); + + if (!_cancelBtn) + return false; + } + + _queryResult = -1; + _picObjList = picObjList; + + return true; } void ModalSaveGame::setScene(Scene *sc) { diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h index de6f1c1482..14b64f27a3 100644 --- a/engines/fullpipe/modal.h +++ b/engines/fullpipe/modal.h @@ -224,13 +224,13 @@ public: virtual void update() {} virtual void saveload() {} - void create(Scene *sc, int picId); + bool create(Scene *sc, PtrList *picObjList, int picId); private: - int _field_8; - int _bg; - int _okBtn; - int _cancelBtn; + PtrList *_picObjList; + PictureObject *_bg; + PictureObject *_okBtn; + PictureObject *_cancelBtn; int _queryResult; }; |