mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-28 15:26:12 +00:00
MM: MM1: Support alt map strings in enhanced mode
This commit is contained in:
parent
d895f5c509
commit
63625e14f0
@ -1292,7 +1292,7 @@ maps:
|
||||
levitation1: "Luckily,your levitation spell saved you!"
|
||||
levitation2: "Levitation saved you."
|
||||
remains: "Smashed remains of stone statues\nseem suspiciously lifelike."
|
||||
map13e:
|
||||
emap13:
|
||||
levitation1: "Luckily, your levitation spell saved you!"
|
||||
|
||||
map14:
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "engines/engine.h"
|
||||
#include "graphics/fonts/ttf.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/mm1.h"
|
||||
#include "mm/shared/utils/engine_data.h"
|
||||
#include "graphics/fontman.h"
|
||||
|
||||
@ -95,6 +96,20 @@ bool Globals::load(bool isEnhanced) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const Common::String &Globals::operator[](const Common::String &name) {
|
||||
if (g_engine->isEnhanced() && name.hasPrefix("maps.map")) {
|
||||
// Map strings support having alternate versions in Enhanced version
|
||||
Common::String altName = Common::String::format("maps.emap%s",
|
||||
name.c_str() + 8);
|
||||
if (_strings.contains(altName))
|
||||
return _strings[altName];
|
||||
}
|
||||
|
||||
assert(_strings.contains(name));
|
||||
return _strings[name];
|
||||
}
|
||||
|
||||
|
||||
void Globals::synchronize(Common::Serializer &s) {
|
||||
s.syncAsByte(_startingTown);
|
||||
|
||||
|
@ -85,10 +85,7 @@ public:
|
||||
/**
|
||||
* Returns a string
|
||||
*/
|
||||
const Common::String &operator[](const Common::String &name) {
|
||||
assert(_strings.contains(name));
|
||||
return _strings[name];
|
||||
}
|
||||
const Common::String &operator[](const Common::String &name);
|
||||
|
||||
/**
|
||||
* Saves global data to/from savegames
|
||||
|
Loading…
x
Reference in New Issue
Block a user