diff options
author | Eugene Sandulenko | 2015-12-21 12:19:27 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2015-12-27 15:40:58 +0100 |
commit | 5b957c4b06b3b1160b97d17ab78d86d7e78c46c1 (patch) | |
tree | 5119f901dc9344a52242e106bea45e9f0b986e44 /engines/wage | |
parent | bb46957defcc1dc5182af6b8efe91086e572e991 (diff) | |
download | scummvm-rg350-5b957c4b06b3b1160b97d17ab78d86d7e78c46c1.tar.gz scummvm-rg350-5b957c4b06b3b1160b97d17ab78d86d7e78c46c1.tar.bz2 scummvm-rg350-5b957c4b06b3b1160b97d17ab78d86d7e78c46c1.zip |
WAGE: Implementing loading service dialog strings
Diffstat (limited to 'engines/wage')
-rw-r--r-- | engines/wage/world.cpp | 45 | ||||
-rw-r--r-- | engines/wage/world.h | 6 |
2 files changed, 51 insertions, 0 deletions
diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp index ec1d894f7a..776d5df80a 100644 --- a/engines/wage/world.cpp +++ b/engines/wage/world.cpp @@ -60,6 +60,11 @@ World::World() { _storageScene._name = STORAGESCENE; _orderedScenes.push_back(&_storageScene); _scenes[STORAGESCENE] = &_storageScene; + + _gameOverMessage = nullptr; + _saveBeforeQuitMessage = nullptr; + _saveBeforeCloseMessage = nullptr; + _revertMessage = nullptr; } bool World::loadWorld(Common::MacResManager *resMan) { @@ -106,6 +111,28 @@ bool World::loadWorld(Common::MacResManager *resMan) { delete res; } + Common::String *message; + if ((message = loadStringFromDITL(resMan, 2910, 1)) != NULL) { + message->trim(); + warning("_gameOverMessage: %s", message->c_str()); + _gameOverMessage = message; + } + if ((message = loadStringFromDITL(resMan, 2480, 3)) != NULL) { + message->trim(); + warning("_saveBeforeQuitMessage: %s", message->c_str()); + _saveBeforeQuitMessage = message; + } + if ((message = loadStringFromDITL(resMan, 2490, 3)) != NULL) { + message->trim(); + warning("_saveBeforeCloseMessage: %s", message->c_str()); + _saveBeforeCloseMessage = message; + } + if ((message = loadStringFromDITL(resMan, 2940, 2)) != NULL) { + message->trim(); + warning("_revertMessage: %s", message->c_str()); + _revertMessage = message; + } + // Load scenes resArray = resMan->getResIDArray(MKTAG('A','S','C','N')); debug(3, "Loading %d scenes", resArray.size()); @@ -221,4 +248,22 @@ void World::loadExternalSounds(String fname) { } } +Common::String *World::loadStringFromDITL(Common::MacResManager *resMan, int resourceId, int itemIndex) { + Common::SeekableReadStream *res = resMan->getResource(MKTAG('D','I','T','L'), resourceId); + if (res) { + int itemCount = res->readSint16BE(); + for (int i = 0; i <= itemCount; i++) { + // int placeholder; short rect[4]; byte flags; pstring str; + res->skip(13); + Common::String message = readPascalString(res); + if (i == itemIndex) { + Common::String *msg = new Common::String(message); + return msg; + } + } + } + + return NULL; +} + } // End of namespace Wage diff --git a/engines/wage/world.h b/engines/wage/world.h index 1b1bc73e9f..1514b57b20 100644 --- a/engines/wage/world.h +++ b/engines/wage/world.h @@ -59,6 +59,7 @@ public: bool loadWorld(Common::MacResManager *resMan); void loadExternalSounds(String fname); + Common::String *loadStringFromDITL(Common::MacResManager *resMan, int resourceId, int itemIndex); String _name; String _aboutMessage; @@ -80,6 +81,11 @@ public: Chr *_player; //List<MoveListener> moveListeners; + Common::String *_gameOverMessage; + Common::String *_saveBeforeQuitMessage; + Common::String *_saveBeforeCloseMessage; + Common::String *_revertMessage; + void addScene(Scene *room) { if (room->_name.size() != 0) { String s = room->_name; |