diff options
Diffstat (limited to 'engines/tsage/ringworld2')
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_dialogs.cpp | 38 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_dialogs.h | 12 |
2 files changed, 50 insertions, 0 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.cpp b/engines/tsage/ringworld2/ringworld2_dialogs.cpp index 8d4863f332..562ca4cc65 100644 --- a/engines/tsage/ringworld2/ringworld2_dialogs.cpp +++ b/engines/tsage/ringworld2/ringworld2_dialogs.cpp @@ -176,6 +176,7 @@ void RightClickDialog::execute() { break; case 4: // Change player + CharacterDialog::show(); break; case 5: // Options dialog @@ -188,6 +189,43 @@ void RightClickDialog::execute() { _gfxManager.deactivate(); } +/*--------------------------------------------------------------------------*/ + +void CharacterDialog::show() { + CharacterDialog *dlg = new CharacterDialog(); + dlg->draw(); + + GfxButton *btn = dlg->execute(&dlg->_btnCancel); + + + dlg->remove(); + delete dlg; +} + +CharacterDialog::CharacterDialog() { + // Set the element text + _msgTitle.set(CHAR_TITLE, 140, ALIGN_LEFT); + _btnQuinn.setText(CHAR_QUINN_MSG); + _btnSeeker.setText(CHAR_SEEKER_MSG); + _btnMiranda.setText(CHAR_MIRANDA_MSG); + _btnCancel.setText(CHAR_CANCEL_MSG); + + // Set position of the elements + _msgTitle._bounds.moveTo(5, 5); + _btnQuinn._bounds.moveTo(25, _msgTitle._bounds.bottom + 1); + _btnSeeker._bounds.moveTo(25, _btnQuinn._bounds.bottom + 1); + _btnMiranda._bounds.moveTo(25, _btnSeeker._bounds.bottom + 1); + _btnCancel._bounds.moveTo(25, _btnMiranda._bounds.bottom + 1); + + // Add the items to the dialog + addElements(&_msgTitle, &_btnQuinn, &_btnSeeker, &_btnMiranda, &_btnCancel, NULL); + + // Set the dialog size and position + frame(); + _bounds.collapse(-6, -6); + setCenter(160, 100); +} + } // End of namespace Ringworld2 } // End of namespace TsAGE diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.h b/engines/tsage/ringworld2/ringworld2_dialogs.h index bbc35da3ea..89e50545bf 100644 --- a/engines/tsage/ringworld2/ringworld2_dialogs.h +++ b/engines/tsage/ringworld2/ringworld2_dialogs.h @@ -59,6 +59,18 @@ public: void execute(); }; +class CharacterDialog: public GfxDialog { +private: + GfxMessage _msgTitle; + GfxButton _btnQuinn, _btnMiranda, _btnSeeker; + GfxButton _btnCancel; +public: + CharacterDialog(); + virtual ~CharacterDialog() {} + + static void show(); +}; + } // End of namespace Ringworld2 } // End of namespace TsAGE |