aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/dreamweb/dreamweb.h1
-rw-r--r--engines/dreamweb/monitor.cpp105
2 files changed, 84 insertions, 22 deletions
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index eb35a73f66..c13a6995bf 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -513,6 +513,7 @@ public:
void dirCom();
void useMon();
bool execCommand();
+ int findCommand(const char* cmdList[]);
// from newplace.cpp
void getUnderCentre();
diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp
index b6922cba51..3bcb38d074 100644
--- a/engines/dreamweb/monitor.cpp
+++ b/engines/dreamweb/monitor.cpp
@@ -104,6 +104,26 @@ void DreamWebEngine::useMon() {
redrawMainScrn();
workToScreenM();
}
+
+int DreamWebEngine::findCommand(const char* cmdList[]) {
+ // Loop over all commands in the list and see if we get a match
+ int cmd = 0;
+ while (cmdList[cmd] != NULL) {
+ const char *cmdStr = cmdList[cmd];
+ const char *inputStr = _inputLine;
+ // Compare the command, char by char, to see if we get a match.
+ // We only care about the prefix matching, though.
+ char inputChar, cmdChar;
+ do {
+ inputChar = *inputStr; inputStr += 2;
+ cmdChar = *cmdStr++;
+ if (cmdChar == 0)
+ return cmd;
+ } while (inputChar == cmdChar);
+ ++cmd;
+ }
+ return -1;
+}
bool DreamWebEngine::execCommand() {
static const char *comlist[] = {
@@ -112,7 +132,38 @@ bool DreamWebEngine::execCommand() {
"LIST",
"READ",
"LOGON",
- "KEYS"
+ "KEYS",
+ NULL
+ };
+
+ static const char *comlistFR[] = {
+ "SORTIR",
+ "AIDE",
+ "LISTE",
+ "LIRE",
+ "CONNEXION",
+ "TOUCHES", // should be CLES but it is translated as TOUCHES in the game...
+ NULL
+ };
+
+ static const char *comlistDE[] = {
+ "ENDE",
+ "HILFE",
+ "LISTE",
+ "LIES",
+ "ZUGRIFF",
+ "DATEN",
+ NULL
+ };
+
+ static const char *comlistIT[] = {
+ "ESCI",
+ "AIUTO",
+ "ELENCA",
+ "LEGGI",
+ "ACCEDI",
+ "CHIAVI",
+ NULL
};
if (_inputLine[0] == 0) {
@@ -121,26 +172,23 @@ bool DreamWebEngine::execCommand() {
return false;
}
- int cmd;
- bool done = false;
- // Loop over all commands in the list and see if we get a match
- for (cmd = 0; cmd < ARRAYSIZE(comlist); ++cmd) {
- const char *cmdStr = comlist[cmd];
- const char *inputStr = _inputLine;
- // Compare the command, char by char, to see if we get a match.
- // We only care about the prefix matching, though.
- char inputChar, cmdChar;
- do {
- inputChar = *inputStr; inputStr += 2;
- cmdChar = *cmdStr++;
- if (cmdChar == 0) {
- done = true;
- break;
- }
- } while (inputChar == cmdChar);
-
- if (done)
+ int cmd = findCommand(comlist);
+ if (cmd == -1) {
+ // This did not match an english command. Try to find a localized one.
+ switch (getLanguage()) {
+ case Common::FR_FRA:
+ cmd = findCommand(comlistFR);
+ break;
+ case Common::DE_DEU:
+ cmd = findCommand(comlistDE);
break;
+ case Common::IT_ITA:
+ cmd = findCommand(comlistIT);
+ break;
+ case Common::ES_ESP:
+ default:
+ break;
+ }
}
// Execute the selected command
@@ -154,7 +202,21 @@ bool DreamWebEngine::execCommand() {
// this extra text is wrapped around the common copy protection check,
// to keep it faithful to the original, if requested.
if (!_copyProtection) {
- monPrint("VALID COMMANDS ARE EXIT, HELP, LIST, READ, LOGON, KEYS");
+ switch (getLanguage()) {
+ case Common::FR_FRA:
+ monPrint("LES COMMANDES VALIDES SONT SORTIR, AIDE, LISTE, LIRE, CONNEXION, TOUCHES");
+ break;
+ case Common::DE_DEU:
+ monPrint("G\232LTIGE BEFEHLE SIND ENDE, HILFE, LISTE, LIES, ZUGRIFF, DATEN");
+ break;
+ case Common::IT_ITA:
+ monPrint("I COMANDI VALIDI SONO ESCI, AIUTO, ELENCA, LEGGI, ACCEDI, CHIAVI");
+ break;
+ case Common::ES_ESP:
+ default:
+ monPrint("VALID COMMANDS ARE EXIT, HELP, LIST, READ, LOGON, KEYS");
+ break;
+ }
}
break;
case 2:
@@ -177,7 +239,6 @@ bool DreamWebEngine::execCommand() {
}
-
void DreamWebEngine::monitorLogo() {
if (_logoNum != _oldLogoNum) {
_oldLogoNum = _logoNum;