[Scummvm-git-logs] scummvm master -> 61d14b94d558e25105b6d8c2620b83f6d9b53d52
dreammaster
dreammaster at scummvm.org
Tue Nov 8 03:39:37 CET 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
61d14b94d5 TITANIC: Fix entering slot name & saving using in-game PET
Commit: 61d14b94d558e25105b6d8c2620b83f6d9b53d52
https://github.com/scummvm/scummvm/commit/61d14b94d558e25105b6d8c2620b83f6d9b53d52
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-11-07T21:39:25-05:00
Commit Message:
TITANIC: Fix entering slot name & saving using in-game PET
Changed paths:
engines/titanic/pet_control/pet_real_life.h
engines/titanic/pet_control/pet_save.cpp
engines/titanic/pet_control/pet_save.h
diff --git a/engines/titanic/pet_control/pet_real_life.h b/engines/titanic/pet_control/pet_real_life.h
index b359d28..7c7101a 100644
--- a/engines/titanic/pet_control/pet_real_life.h
+++ b/engines/titanic/pet_control/pet_real_life.h
@@ -87,11 +87,6 @@ public:
virtual CGameObject *dragEnd(const Point &pt) const { return nullptr; }
/**
- * Display a message
- */
- virtual void displayMessage(const CString &msg) {}
-
- /**
* Returns true if the object is in a valid state
*/
virtual bool isValid(CPetControl *petControl);
diff --git a/engines/titanic/pet_control/pet_save.cpp b/engines/titanic/pet_control/pet_save.cpp
index d344c8c..60afa11 100644
--- a/engines/titanic/pet_control/pet_save.cpp
+++ b/engines/titanic/pet_control/pet_save.cpp
@@ -49,6 +49,16 @@ bool CPetSave::MouseButtonUpMsg(const Point &pt) {
}
}
+bool CPetSave::KeyCharMsg(int key) {
+ if (CPetLoadSave::KeyCharMsg(key))
+ return true;
+
+ if (_savegameSlotNum != -1)
+ _slotNames[_savegameSlotNum].handleKey(key);
+
+ return true;
+}
+
void CPetSave::highlightCurrent(const Point &pt) {
resetSlots();
highlightSave(_savegameSlotNum);
@@ -71,11 +81,12 @@ void CPetSave::unhighlightSave(int index) {
void CPetSave::execute() {
CPetControl *pet = getPetControl();
if (_savegameSlotNum >= 0) {
+ int slotNumber = _savegameSlotNum;
highlightSlot(-1);
CProjectItem *project = pet ? pet->getRoot() : nullptr;
if (project) {
- project->saveGame(_savegameSlotNum, _slotNames[_savegameSlotNum].getText());
+ project->saveGame(slotNumber, _slotNames[slotNumber].getText());
pet->displayMessage(BLANK);
}
} else if (pet) {
diff --git a/engines/titanic/pet_control/pet_save.h b/engines/titanic/pet_control/pet_save.h
index e5e9564..39a25eb 100644
--- a/engines/titanic/pet_control/pet_save.h
+++ b/engines/titanic/pet_control/pet_save.h
@@ -40,6 +40,11 @@ public:
virtual bool MouseButtonUpMsg(const Point &pt);
/**
+ * Handles keypresses when the glyph is focused
+ */
+ virtual bool KeyCharMsg(int key);
+
+ /**
* Unhighlight any currently highlighted element
*/
virtual void unhighlightCurrent() { unhighlightSave(_savegameSlotNum); }
More information about the Scummvm-git-logs
mailing list