aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/pet_control')
-rw-r--r--engines/titanic/pet_control/pet_control.cpp8
-rw-r--r--engines/titanic/pet_control/pet_control.h9
-rw-r--r--engines/titanic/pet_control/pet_conversations.cpp2
-rw-r--r--engines/titanic/pet_control/pet_load.cpp2
-rw-r--r--engines/titanic/pet_control/pet_save.cpp4
-rw-r--r--engines/titanic/pet_control/pet_starfield.cpp2
6 files changed, 20 insertions, 7 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 7ab76ddc1d..2ab30af5de 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -376,7 +376,13 @@ bool CPetControl::checkDragEnd(CGameObject *item) const {
return _sections[_currentArea]->checkDragEnd(item);
}
-void CPetControl::displayMessage(const CString &msg) const {
+void CPetControl::displayMessage(StringId stringId, int param) const {
+ CString msg = CString::format(_strings[stringId].c_str(), param);
+ _sections[_currentArea]->displayMessage(msg);
+}
+
+void CPetControl::displayMessage(const CString &str, int param) const {
+ CString msg = CString::format(str.c_str(), param);
_sections[_currentArea]->displayMessage(msg);
}
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 439a94e2d3..c4b65457e2 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -36,6 +36,7 @@
#include "titanic/pet_control/pet_real_life.h"
#include "titanic/pet_control/pet_remote.h"
#include "titanic/pet_control/pet_rooms.h"
+#include "titanic/support/strings.h"
#include "titanic/room_flags.h"
namespace Titanic {
@@ -67,6 +68,7 @@ private:
CRoomItem *_hiddenRoom;
Rect _drawBounds;
PetEventInfo _timers[2];
+ Strings _strings;
private:
/**
* Returns true if the control is in a valid state
@@ -232,7 +234,12 @@ public:
/**
* Display a message
*/
- void displayMessage(const CString &msg) const;
+ void displayMessage(StringId stringId, int param = 0) const;
+
+ /**
+ * Display a message
+ */
+ void displayMessage(const CString &str, int param = 0) const;
/**
* Get the first game object stored in the PET
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index dc096afcfe..173c586fc1 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -419,7 +419,7 @@ int CPetConversations::canSummonBot(const CString &name) {
void CPetConversations::summonBot(const CString &name) {
if (_petControl) {
if (_petControl->getPassengerClass() >= 4) {
- _petControl->displayMessage("Sorry, you must be at least 3rd class before you can summon for help.");
+ _petControl->displayMessage(AT_LEAST_3RD_CLASS_FOR_HELP);
} else {
_petControl->summonBot(name, 0);
}
diff --git a/engines/titanic/pet_control/pet_load.cpp b/engines/titanic/pet_control/pet_load.cpp
index 04eec54f25..8e2afc727f 100644
--- a/engines/titanic/pet_control/pet_load.cpp
+++ b/engines/titanic/pet_control/pet_load.cpp
@@ -63,7 +63,7 @@ void CPetLoad::execute() {
// WORKAROUND: Schedule the savegame to be loaded after frame rendering ends
window->loadGame(_savegameSlotNum);
} else if (pet) {
- pet->displayMessage("You must select a game to load first.");
+ pet->displayMessage(SELECT_GAME_TO_LOAD);
}
}
diff --git a/engines/titanic/pet_control/pet_save.cpp b/engines/titanic/pet_control/pet_save.cpp
index 9305759117..6d0733f534 100644
--- a/engines/titanic/pet_control/pet_save.cpp
+++ b/engines/titanic/pet_control/pet_save.cpp
@@ -76,10 +76,10 @@ void CPetSave::execute() {
if (project) {
project->saveGame(_savegameSlotNum, _slotNames[_savegameSlotNum].getText());
- pet->displayMessage("");
+ pet->displayMessage(BLANK);
}
} else if (pet) {
- pet->displayMessage("You must select a game to save first.");
+ pet->displayMessage(SELECT_GAME_TO_SAVE);
}
}
diff --git a/engines/titanic/pet_control/pet_starfield.cpp b/engines/titanic/pet_control/pet_starfield.cpp
index 34d696e09c..3287f98817 100644
--- a/engines/titanic/pet_control/pet_starfield.cpp
+++ b/engines/titanic/pet_control/pet_starfield.cpp
@@ -91,7 +91,7 @@ bool CPetStarfield::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
CPETPhotoOnOffMsg photoMsg;
photoMsg.execute(_petControl->_remoteTarget);
} else {
- _petControl->displayMessage("Please supply Galactic reference material.");
+ _petControl->displayMessage(SUPPLY_GALACTIC_REFERENCE);
}
} else if (!_btnSetDest.MouseButtonDownMsg(msg->_mousePos)) {
return elementsMouseDown(msg);