[Scummvm-git-logs] scummvm master -> 4312a969134aa688e62ea894cfd153539fd91498
mduggan
noreply at scummvm.org
Tue Nov 5 11:25:31 UTC 2024
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:
4312a96913 DGDS: Update various strings for German RotD
Commit: 4312a969134aa688e62ea894cfd153539fd91498
https://github.com/scummvm/scummvm/commit/4312a969134aa688e62ea894cfd153539fd91498
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-11-05T22:19:10+11:00
Commit Message:
DGDS: Update various strings for German RotD
Some hard-coded strings needed their own version for the German version of Rise
of the Dragon.
This fixes #15456.
Changed paths:
engines/dgds/clock.cpp
engines/dgds/dgds.cpp
engines/dgds/dgds.h
engines/dgds/inventory.cpp
engines/dgds/menu.cpp
engines/dgds/request.cpp
engines/dgds/scene.cpp
diff --git a/engines/dgds/clock.cpp b/engines/dgds/clock.cpp
index ec361ab1176..9fc80b2f53c 100644
--- a/engines/dgds/clock.cpp
+++ b/engines/dgds/clock.cpp
@@ -114,7 +114,13 @@ Common::String Clock::getTimeStr() const {
month = 0;
}
- return Common::String::format("%2d/%02d %2d:%02d", month + 1, day, _hours, _mins);
+ if (DgdsEngine::getInstance()->getGameLang() == Common::EN_ANY) {
+ return Common::String::format("%2d/%02d %2d:%02d", month + 1, day, _hours, _mins);
+ } else if (DgdsEngine::getInstance()->getGameLang() == Common::DE_DEU) {
+ return Common::String::format("%2d.%d %2d.%02d", day, month + 1, _hours, _mins);
+ } else {
+ error("Unsupported language %d", DgdsEngine::getInstance()->getGameLang());
+ }
}
void Clock::draw(Graphics::ManagedSurface &surf) {
diff --git a/engines/dgds/dgds.cpp b/engines/dgds/dgds.cpp
index 96fd2e03709..c80d4c71917 100644
--- a/engines/dgds/dgds.cpp
+++ b/engines/dgds/dgds.cpp
@@ -91,6 +91,7 @@ DgdsEngine::DgdsEngine(OSystem *syst, const ADGameDescription *gameDesc)
_dragonArcade(nullptr), _chinaTank(nullptr), _chinaTrain(nullptr), _skipNextFrame(false), _gameId(GID_INVALID) {
_platform = gameDesc->platform;
+ _gameLang = gameDesc->language;
if (!strcmp(gameDesc->gameId, "rise")) {
_gameId = GID_DRAGON;
diff --git a/engines/dgds/dgds.h b/engines/dgds/dgds.h
index 0b10322bc7f..8c1aa25756d 100644
--- a/engines/dgds/dgds.h
+++ b/engines/dgds/dgds.h
@@ -116,6 +116,7 @@ enum DragonArcadeKeyEvent {
class DgdsEngine : public Engine {
public:
Common::Platform _platform;
+ Common::Language _gameLang;
Sound *_soundPlayer;
Graphics::ManagedSurface _compositionBuffer;
@@ -186,6 +187,7 @@ public:
void restartGame();
DgdsGameId getGameId() const { return _gameId; }
+ Common::Language getGameLang() const { return _gameLang; }
Common::Platform getPlatform() const { return _platform; }
Graphics::ManagedSurface &getBackgroundBuffer() { return _backgroundBuffer; }
diff --git a/engines/dgds/inventory.cpp b/engines/dgds/inventory.cpp
index f6bebf85ed0..febbaa31a35 100644
--- a/engines/dgds/inventory.cpp
+++ b/engines/dgds/inventory.cpp
@@ -107,7 +107,15 @@ void Inventory::drawHeader(Graphics::ManagedSurface &surf) {
const DgdsFont *font = RequestData::getMenuFont();
const RequestData &r = _reqData._requests[0];
- static const char *title = "INVENTORY";
+ static const char *title;
+
+ if (DgdsEngine::getInstance()->getGameLang() == Common::EN_ANY)
+ title = "INVENTORY";
+ else if (DgdsEngine::getInstance()->getGameLang() == Common::DE_DEU)
+ title = "INVENTAR";
+ else
+ error("Unsupported language %d", DgdsEngine::getInstance()->getGameLang());
+
int titleWidth = font->getStringWidth(title);
int y1 = r._rect.y + 7;
int x1 = r._rect.x + 112;
diff --git a/engines/dgds/menu.cpp b/engines/dgds/menu.cpp
index 98f42b7cc82..2c01ebe0e1d 100644
--- a/engines/dgds/menu.cpp
+++ b/engines/dgds/menu.cpp
@@ -63,6 +63,7 @@ enum MenuButtonIds {
kMenuOptionsSoundsOnOff = 137,
kMenuOptionsMusicOnOff = 140,
kMenuOptionsSoundsOnOffHoC = 175,
+ kMenuOptionsSoundsOnOffDE = 172, // German version
kMenuOptionsMusicOnOffHoC = 171,
kMenuOptionsVCR = 135,
kMenuOptionsPlay = 136,
@@ -149,24 +150,45 @@ void Menu::setScreenBuffer() {
bool Menu::updateOptionsGadget(Gadget *gadget) {
Audio::Mixer *mixer = DgdsEngine::getInstance()->_mixer;
+ const char *mouseStr, *soundStr, *musicStr, *onStr, *offStr;
+ if (DgdsEngine::getInstance()->getGameLang() == Common::EN_ANY) {
+ mouseStr = "MOUSE";
+ soundStr = "SOUND";
+ musicStr = "MUSIC";
+ onStr = "ON";
+ offStr = "OFF";
+ } else if (DgdsEngine::getInstance()->getGameLang() == Common::DE_DEU) {
+ mouseStr = "MAUS";
+ soundStr = "TON";
+ musicStr = "MUSIK";
+ onStr = "AN";
+ offStr = "AUS";
+ } else {
+ error("Unsupported language %d", DgdsEngine::getInstance()->getGameLang());
+ }
switch (gadget->_gadgetNo) {
case kMenuOptionsJoystickOnOff:
case kMenuOptionsJoystickOnOffHoC:
- gadget->_buttonName = "JOYSTICK ON";
- return false;
+ gadget->_buttonName = Common::String::format("JOYSTICK %s", onStr);
+ return true;
case kMenuOptionsMouseOnOff:
case kMenuOptionsMouseOnOffHoC:
- gadget->_buttonName = "MOUSE ON";
- return false;
+ gadget->_buttonName = Common::String::format("%s %s", mouseStr, onStr);
+ return true;
case kMenuOptionsSoundsOnOff: // same id as kMenuMaybeBetterSaveYes
- case kMenuOptionsSoundsOnOffHoC:
- gadget->_buttonName = (!mixer->isSoundTypeMuted(Audio::Mixer::kSFXSoundType)) ? "SOUNDS ON" : "SOUNDS OFF";
+ case kMenuOptionsSoundsOnOffDE:
+ case kMenuOptionsSoundsOnOffHoC: {
+ bool isMuted = mixer->isSoundTypeMuted(Audio::Mixer::kSFXSoundType);
+ gadget->_buttonName = Common::String::format("%s %s", soundStr, isMuted ? offStr : onStr);
return true;
+ }
case kMenuOptionsMusicOnOff:
- case kMenuOptionsMusicOnOffHoC:
- gadget->_buttonName = (!mixer->isSoundTypeMuted(Audio::Mixer::kMusicSoundType)) ? "MUSIC ON" : "MUSIC OFF";
+ case kMenuOptionsMusicOnOffHoC: {
+ bool isMuted = mixer->isSoundTypeMuted(Audio::Mixer::kMusicSoundType);
+ gadget->_buttonName = Common::String::format("%s %s", musicStr, isMuted ? offStr : onStr);
return true;
+ }
default:
return false;
}
@@ -562,6 +584,7 @@ void Menu::handleClickOptionsMenu(const Common::Point &mouse) {
// Do nothing - we don't toggle joystick or mouse functionality
break;
case kMenuOptionsSoundsOnOff: // same id as kMenuMaybeBetterSaveYes
+ case kMenuOptionsSoundsOnOffDE:
case kMenuOptionsSoundsOnOffHoC:
soundType = Audio::Mixer::kSFXSoundType;
// fall through
@@ -571,12 +594,12 @@ void Menu::handleClickOptionsMenu(const Common::Point &mouse) {
mixer->muteSoundType(soundType, true);
warning("TODO: Sync volume and pause music");
//midiPlayer->syncVolume();
- //midiPlayer->pause();
+ //engine->_soundPlayer->pauseMusic();
} else {
mixer->muteSoundType(soundType, false);
warning("TODO: Sync volume and resume music");
//midiPlayer->syncVolume();
- //midiPlayer->resume();
+ //engine->_soundPlayer->resumeMusic();
}
updateOptionsGadget(gadget);
diff --git a/engines/dgds/request.cpp b/engines/dgds/request.cpp
index 17b17a40024..fbf4d14482f 100644
--- a/engines/dgds/request.cpp
+++ b/engines/dgds/request.cpp
@@ -286,7 +286,7 @@ bool RequestParser::handleChunk(DgdsChunkReader &chunk, ParserData *data) {
parseREQChunk(rfdata._requests.back(), chunk, num);
} else if (chunk.getId() == ID_GAD) {
if (rfdata._requests.empty())
- error("GAD chunk before any REQ chunks in Reqeust file %s", _filename.c_str());
+ error("GAD chunk before any REQ chunks in Request file %s", _filename.c_str());
parseGADChunk(rfdata._requests.back(), chunk, num);
}
@@ -497,25 +497,44 @@ Common::String SliderGadget::dump() const {
}
// Slider labels and title are hard-coded in game, not part of data files.
-static const char *_sliderTitleForGadget(uint16 num) {
- switch (num) {
- case 0x7B: return "DIFFICULTY";
- case 0x7D: return "TEXT SPEED";
- case 0x83: return "DETAIL LEVEL";
- case 0x98: return "MOUSE SPEED";
- case 0x9C: return "BUTTON THRESHOLD";
- default: return "SLIDER";
+static const char *_sliderTitleForGadget(uint16 num, Common::Language language) {
+ if (language == Common::EN_ANY) {
+ switch (num) {
+ case 0x7B: return "DIFFICULTY";
+ case 0x7D: return "TEXT SPEED";
+ case 0x83: return "DETAIL LEVEL";
+ case 0x98: return "MOUSE SPEED";
+ case 0x9C: return "BUTTON THRESHOLD";
+ default: return "SLIDER";
+ }
+ } else if (language == Common::DE_DEU) {
+ switch (num) {
+ case 0x7B: return "SCHWIERIGKEITSGRAD";
+ case 0x7D: return "TEXT-VERWEILDAUER";
+ case 0x83: return "DETAILS";
+ case 0x98: return "GESCHWINDIGKEIT";
+ case 0x9C: return "TASTENEMPFINDLICHKEIT";
+ default: return "REGLER";
+ }
+ } else {
+ error("Unsupported language %d", language);
}
}
-static const char *_sliderLabelsForGadget(uint16 num) {
- switch (num) {
- case 0x7B: return "EASY HARD";
- case 0x7D: return "SLOW FAST";
- case 0x83: return "LOW HIGH";
- case 0x98: return "SLOW FAST";
- case 0x9C: return "LONG SHORT";
- default: return "MIN MAX";
+static const char *_sliderLabelsForGadget(uint16 num, Common::Language language) {
+ if (language == Common::EN_ANY) {
+ switch (num) {
+ case 0x7B: return "EASY HARD";
+ case 0x7D: return "SLOW FAST";
+ case 0x83: return "LOW HIGH";
+ case 0x98: return "SLOW FAST";
+ case 0x9C: return "LONG SHORT";
+ default: return "MIN MAX";
+ }
+ } else if (language == Common::DE_DEU) {
+ return "- +";
+ } else {
+ error("Unsupported language %d", language);
}
}
@@ -523,6 +542,7 @@ static const int SLIDER_HANDLE_FRAME = 28;
void SliderGadget::draw(Graphics::ManagedSurface *dst) const {
const DgdsFont *font = RequestData::getMenuFont();
+ Common::Language language = DgdsEngine::getInstance()->getGameLang();
int16 x = _x + _parentX;
int16 y = _y + _parentY;
@@ -530,8 +550,8 @@ void SliderGadget::draw(Graphics::ManagedSurface *dst) const {
int16 x2 = x + _width;
int16 y2 = (y + _height) - 1;
int16 titley = (y - font->getFontHeight()) + 1;
- const char *title = _sliderTitleForGadget(_gadgetNo);
- const char *labels = _sliderLabelsForGadget(_gadgetNo);
+ const char *title = _sliderTitleForGadget(_gadgetNo, language);
+ const char *labels = _sliderLabelsForGadget(_gadgetNo, language);
int16 titleWidth = font->getStringWidth(title);
font->drawString(dst, title, x + (_width - titleWidth) / 2, titley, titleWidth, 0);
diff --git a/engines/dgds/scene.cpp b/engines/dgds/scene.cpp
index 4b1e0955b4b..033b3388073 100644
--- a/engines/dgds/scene.cpp
+++ b/engines/dgds/scene.cpp
@@ -1424,7 +1424,14 @@ void SDSScene::addAndShowTiredDialog() {
dlg._flags = static_cast<DialogFlags>(kDlgFlagLo8 | kDlgFlagLeftJust | kDlgFlagFlatBg);
dlg._frameType = kDlgFrameThought;
dlg._time = 420;
- dlg._str = "Boy, am I tired. Better get some sleep in about an hour.";
+ if (DgdsEngine::getInstance()->getGameLang() == Common::EN_ANY) {
+ dlg._str = "Boy, am I tired. Better get some sleep in about an hour.";
+ } else if (DgdsEngine::getInstance()->getGameLang() == Common::DE_DEU) {
+ dlg._str = "Mensch, bin ich m\x81""de! Am Besten gehe ich bald mal ins Bett.";
+ } else {
+ error("Unsupported language %d", DgdsEngine::getInstance()->getGameLang());
+ }
+
_dialogs.push_back(dlg);
}
showDialog(0, TIRED_DLG_ID);
More information about the Scummvm-git-logs
mailing list