aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control/pet_quit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/pet_control/pet_quit.cpp')
-rw-r--r--engines/titanic/pet_control/pet_quit.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index c489fd9d5b..562a63f80c 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -21,8 +21,10 @@
*/
#include "titanic/pet_control/pet_quit.h"
+#include "titanic/pet_control/pet_control.h"
#include "titanic/pet_control/pet_real_life.h"
#include "titanic/support/rect.h"
+#include "titanic/game_manager.h"
namespace Titanic {
@@ -57,4 +59,29 @@ bool CPetQuit::reset() {
return true;
}
+void CPetQuit::draw2(CScreenManager *screenManager) {
+ _text.draw(screenManager);
+ _btnYes.draw(screenManager);
+}
+
+bool CPetQuit::proc16(const Point &pt) {
+ return !_btnYes.proc6(pt);
+}
+
+bool CPetQuit::mouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ CPetControl *pet = getPetControl();
+ if (_btnYes.MouseButtonDownMsg(msg) && pet) {
+ CGameManager *gameManager = pet->getGameManager();
+ if (gameManager)
+ gameManager->_gameState._quitGame = true;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void CPetQuit::getTooltip(CPetText *text) {
+ text->setText("Quit the game.");
+}
+
} // End of namespace Titanic