2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2002-09-19 17:44:41 +00:00
|
|
|
*
|
2021-12-26 18:47:58 +01:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2002-09-19 17:44:41 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 18:47:58 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2014-02-18 02:34:24 +01:00
|
|
|
*
|
2002-09-19 17:44:41 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SCUMM_DIALOGS_H
|
|
|
|
#define SCUMM_DIALOGS_H
|
|
|
|
|
2002-09-28 19:25:09 +00:00
|
|
|
#include "common/str.h"
|
2020-07-02 04:53:38 +05:30
|
|
|
#include "common/ustr.h"
|
2016-04-14 13:29:08 +03:00
|
|
|
#include "common/keyboard.h"
|
2002-09-19 17:44:41 +00:00
|
|
|
#include "gui/dialog.h"
|
2010-05-26 19:54:50 +00:00
|
|
|
#include "engines/dialogs.h"
|
2002-09-19 17:44:41 +00:00
|
|
|
|
2003-11-10 23:40:48 +00:00
|
|
|
namespace GUI {
|
2011-04-25 22:29:26 +03:00
|
|
|
class CommandSender;
|
2016-04-14 13:29:08 +03:00
|
|
|
class StaticTextWidget;
|
2003-11-10 23:40:48 +00:00
|
|
|
}
|
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
|
|
|
|
namespace Scumm {
|
|
|
|
|
SCUMM: (v1-3) - improve pause/restart/quit string handling
The recent PR 4204 made me aware of some things I had kind of tried to ignore when I updated these dialogs for CJK font support.
Currently, the language for the pause/restart/quit messages is tied to the GUI/launcher language and the translation manager is used to translate the. E. g., if you start the French version of MM or ZAK and have a launcher language setting of English, you will get the English pause/restart/quit messages. If you set the launcher language to French you will get it the French ones. Also, the encodings from the translation manager aren't compatible with the game string encodings (mostly solved by PR 4204, though).
This commit now gets rid of any translation manager use here. Instead, we tie the translations for these messages to the game language.
I have included all strings for the v1/v2 language variants I found in the detection table.
I am interested in having the exact original messages here. However, I have only inserted them from the English interpreters, since those are all I have. For the other languages, for the time being, I have just used the texts from the translation manager and reencoded those with codepage 850. So, if anyone has access to an original v1/v2 interpreter in French, Italian, German, Spanish, Russian or Swedish, he/she might want to extract and replace the strings here with the correct ones...
2022-08-18 01:46:16 +02:00
|
|
|
struct ResString {
|
|
|
|
int num;
|
|
|
|
char string[80];
|
|
|
|
};
|
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
class ScummEngine;
|
2002-09-19 17:44:41 +00:00
|
|
|
|
2003-11-11 00:40:35 +00:00
|
|
|
class ScummDialog : public GUI::Dialog {
|
2002-09-19 17:44:41 +00:00
|
|
|
public:
|
2010-01-05 22:18:09 +00:00
|
|
|
ScummDialog(int x, int y, int w, int h);
|
2006-04-29 23:23:32 +00:00
|
|
|
ScummDialog(Common::String name);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2002-09-19 17:44:41 +00:00
|
|
|
protected:
|
2003-10-02 17:43:02 +00:00
|
|
|
typedef Common::String String;
|
2020-06-17 01:27:23 +05:30
|
|
|
typedef Common::U32String U32String;
|
2002-09-19 17:44:41 +00:00
|
|
|
};
|
|
|
|
|
2010-05-26 19:54:50 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
class ScummMenuDialog : public MainMenuDialog {
|
2002-09-19 17:44:41 +00:00
|
|
|
public:
|
2008-07-07 06:05:48 +00:00
|
|
|
ScummMenuDialog(ScummEngine *scumm);
|
2020-02-09 12:05:32 +01:00
|
|
|
~ScummMenuDialog() override;
|
|
|
|
void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
|
2002-09-19 17:44:41 +00:00
|
|
|
|
|
|
|
protected:
|
2003-11-11 00:40:35 +00:00
|
|
|
GUI::Dialog *_helpDialog;
|
2002-09-19 17:44:41 +00:00
|
|
|
};
|
2010-05-26 19:54:50 +00:00
|
|
|
#endif
|
2002-09-19 17:44:41 +00:00
|
|
|
|
2005-03-06 18:00:54 +00:00
|
|
|
/**
|
|
|
|
* A dialog which displays an arbitrary message to the user and returns
|
|
|
|
* ther users reply as its result value. More specifically, it returns
|
|
|
|
* the ASCII code of the key used to close the dialog (0 if a mouse
|
|
|
|
* click closed the dialog).
|
|
|
|
*/
|
2002-10-27 12:26:41 +00:00
|
|
|
class InfoDialog : public ScummDialog {
|
2006-04-29 23:23:32 +00:00
|
|
|
protected:
|
|
|
|
ScummEngine *_vm;
|
2020-06-17 01:27:23 +05:30
|
|
|
U32String _message;
|
2006-05-18 19:37:38 +00:00
|
|
|
GUI::StaticTextWidget *_text;
|
2020-10-25 01:38:05 +02:00
|
|
|
GUI::ThemeEngine::FontStyle _style;
|
2006-04-29 23:23:32 +00:00
|
|
|
|
2002-10-12 00:26:24 +00:00
|
|
|
public:
|
2002-10-27 12:26:41 +00:00
|
|
|
// arbitrary message
|
2020-06-30 03:40:13 +05:30
|
|
|
InfoDialog(ScummEngine *scumm, const U32String &message);
|
2002-10-27 12:26:41 +00:00
|
|
|
// from resources
|
2003-11-02 02:18:16 +00:00
|
|
|
InfoDialog(ScummEngine *scumm, int res);
|
2002-10-12 00:26:24 +00:00
|
|
|
|
2020-06-30 03:40:13 +05:30
|
|
|
void setInfoText(const U32String &message);
|
2007-06-02 12:01:09 +00:00
|
|
|
|
2020-02-09 12:05:32 +01:00
|
|
|
void handleMouseDown(int x, int y, int button, int clickCount) override {
|
2005-03-06 18:00:54 +00:00
|
|
|
setResult(0);
|
2003-03-06 17:58:13 +00:00
|
|
|
close();
|
|
|
|
}
|
2020-02-09 12:05:32 +01:00
|
|
|
void handleKeyDown(Common::KeyState state) override {
|
2007-06-30 12:26:59 +00:00
|
|
|
setResult(state.ascii);
|
2003-03-06 17:58:13 +00:00
|
|
|
close();
|
|
|
|
}
|
|
|
|
|
2020-02-09 12:05:32 +01:00
|
|
|
void reflowLayout() override;
|
2022-10-03 22:52:00 +02:00
|
|
|
const char *getPlainEngineString(int stringno, bool forceHardcodedString = false);
|
2006-05-18 16:44:44 +00:00
|
|
|
|
2002-10-27 12:26:41 +00:00
|
|
|
protected:
|
2006-04-29 23:23:32 +00:00
|
|
|
// Query a string from the resources
|
2020-08-29 14:59:58 +05:30
|
|
|
const U32String queryResString(int stringno);
|
SCUMM: (v1-3) - improve pause/restart/quit string handling
The recent PR 4204 made me aware of some things I had kind of tried to ignore when I updated these dialogs for CJK font support.
Currently, the language for the pause/restart/quit messages is tied to the GUI/launcher language and the translation manager is used to translate the. E. g., if you start the French version of MM or ZAK and have a launcher language setting of English, you will get the English pause/restart/quit messages. If you set the launcher language to French you will get it the French ones. Also, the encodings from the translation manager aren't compatible with the game string encodings (mostly solved by PR 4204, though).
This commit now gets rid of any translation manager use here. Instead, we tie the translations for these messages to the game language.
I have included all strings for the v1/v2 language variants I found in the detection table.
I am interested in having the exact original messages here. However, I have only inserted them from the English interpreters, since those are all I have. For the other languages, for the time being, I have just used the texts from the translation manager and reencoded those with codepage 850. So, if anyone has access to an original v1/v2 interpreter in French, Italian, German, Spanish, Russian or Swedish, he/she might want to extract and replace the strings here with the correct ones...
2022-08-18 01:46:16 +02:00
|
|
|
// Query hard coded string (copied over from the executable)
|
|
|
|
const ResString &getStaticResString(Common::Language lang, int stringno);
|
2002-10-27 12:26:41 +00:00
|
|
|
};
|
|
|
|
|
2005-03-06 18:00:54 +00:00
|
|
|
/**
|
|
|
|
* The pause dialog, visible whenever the user activates pause mode. Goes
|
|
|
|
* away uon any key or mouse button press.
|
|
|
|
*/
|
2002-10-27 12:26:41 +00:00
|
|
|
class PauseDialog : public InfoDialog {
|
|
|
|
public:
|
2004-07-20 11:30:15 +00:00
|
|
|
PauseDialog(ScummEngine *scumm, int res);
|
2020-02-09 12:05:32 +01:00
|
|
|
void handleKeyDown(Common::KeyState state) override;
|
2003-07-28 01:36:16 +00:00
|
|
|
};
|
|
|
|
|
2005-03-06 18:00:54 +00:00
|
|
|
/**
|
|
|
|
* A simple yes/no dialog, used to ask the user whether to really
|
|
|
|
* quit/restart ScummVM.
|
|
|
|
*/
|
2003-12-14 20:36:37 +00:00
|
|
|
class ConfirmDialog : public InfoDialog {
|
2003-12-14 15:04:05 +00:00
|
|
|
public:
|
2006-03-01 04:32:44 +00:00
|
|
|
ConfirmDialog(ScummEngine *scumm, int res);
|
2020-02-09 12:05:32 +01:00
|
|
|
void handleKeyDown(Common::KeyState state) override;
|
2010-09-13 23:35:55 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
char _yesKey, _noKey;
|
2003-12-14 15:04:05 +00:00
|
|
|
};
|
|
|
|
|
2005-03-06 18:00:54 +00:00
|
|
|
/**
|
|
|
|
* A dialog used to display the music volume / text speed.
|
|
|
|
* Automatically closes after a brief time passed.
|
|
|
|
*/
|
|
|
|
class ValueDisplayDialog : public GUI::Dialog {
|
|
|
|
public:
|
2020-07-21 04:24:04 +05:30
|
|
|
ValueDisplayDialog(const Common::U32String &label, int minVal, int maxVal, int val, uint16 incKey, uint16 decKey);
|
2005-03-06 18:00:54 +00:00
|
|
|
|
2020-02-09 12:05:32 +01:00
|
|
|
void open() override;
|
2018-01-07 10:39:22 +01:00
|
|
|
void drawDialog(GUI::DrawLayer layerToDraw) override;
|
2020-02-09 12:05:32 +01:00
|
|
|
void handleTickle() override;
|
|
|
|
void handleMouseDown(int x, int y, int button, int clickCount) override {
|
2005-03-06 18:00:54 +00:00
|
|
|
close();
|
|
|
|
}
|
2020-02-09 12:05:32 +01:00
|
|
|
void handleKeyDown(Common::KeyState state) override;
|
2005-03-06 18:00:54 +00:00
|
|
|
|
2020-02-09 12:05:32 +01:00
|
|
|
void reflowLayout() override;
|
2006-08-04 15:48:37 +00:00
|
|
|
|
2005-03-06 18:00:54 +00:00
|
|
|
protected:
|
|
|
|
enum {
|
|
|
|
kDisplayDelay = 1500
|
|
|
|
};
|
2020-07-02 04:53:38 +05:30
|
|
|
Common::U32String _label;
|
2005-03-06 18:00:54 +00:00
|
|
|
const int _min, _max;
|
|
|
|
const uint16 _incKey, _decKey;
|
2005-05-27 13:14:39 +00:00
|
|
|
int _percentBarWidth;
|
2005-03-06 18:00:54 +00:00
|
|
|
int _value;
|
|
|
|
uint32 _timer;
|
|
|
|
};
|
|
|
|
|
2007-06-03 17:32:42 +00:00
|
|
|
/**
|
|
|
|
* A dialog used to display and cycle subtitle settings.
|
|
|
|
* Automatically closes after a brief time has passed.
|
|
|
|
*/
|
|
|
|
class SubtitleSettingsDialog : public InfoDialog {
|
|
|
|
public:
|
|
|
|
SubtitleSettingsDialog(ScummEngine *scumm, int value);
|
|
|
|
|
2020-02-09 12:05:32 +01:00
|
|
|
void open() override;
|
|
|
|
void handleTickle() override;
|
|
|
|
void handleMouseDown(int x, int y, int button, int clickCount) override {
|
2007-06-03 17:32:42 +00:00
|
|
|
close();
|
|
|
|
}
|
2020-02-09 12:05:32 +01:00
|
|
|
void handleKeyDown(Common::KeyState state) override;
|
2007-06-03 17:32:42 +00:00
|
|
|
protected:
|
|
|
|
int _value;
|
|
|
|
uint32 _timer;
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2007-06-03 17:32:42 +00:00
|
|
|
void cycleValue();
|
|
|
|
};
|
2007-05-30 16:40:11 +00:00
|
|
|
|
|
|
|
//The Indy IQ dialog
|
|
|
|
class Indy3IQPointsDialog : public InfoDialog {
|
|
|
|
public:
|
|
|
|
Indy3IQPointsDialog(ScummEngine *scumm, char* text);
|
2020-02-09 12:05:32 +01:00
|
|
|
void handleKeyDown(Common::KeyState state) override;
|
2007-05-30 16:40:11 +00:00
|
|
|
};
|
|
|
|
|
2007-09-20 20:50:38 +00:00
|
|
|
class DebugInputDialog : public InfoDialog {
|
|
|
|
public:
|
|
|
|
DebugInputDialog(ScummEngine *scumm, char* text);
|
2020-02-09 12:05:32 +01:00
|
|
|
void handleKeyDown(Common::KeyState state) override;
|
2007-09-20 20:50:38 +00:00
|
|
|
bool done;
|
|
|
|
Common::String buffer;
|
|
|
|
Common::String mainText;
|
|
|
|
};
|
|
|
|
|
2011-12-24 21:09:46 +01:00
|
|
|
/**
|
|
|
|
* Difficulty selection dialog for Loom FM-Towns.
|
|
|
|
*/
|
|
|
|
class LoomTownsDifficultyDialog : public GUI::Dialog {
|
|
|
|
public:
|
|
|
|
LoomTownsDifficultyDialog();
|
|
|
|
|
|
|
|
int getSelectedDifficulty() const { return _difficulty; }
|
|
|
|
protected:
|
2020-02-09 12:05:32 +01:00
|
|
|
void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
|
2011-12-24 21:09:46 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
kStandardCmd = 'STDD',
|
|
|
|
kPracticeCmd = 'PRAD',
|
|
|
|
kExpertCmd = 'EXPD'
|
|
|
|
};
|
|
|
|
|
|
|
|
int _difficulty;
|
|
|
|
};
|
|
|
|
|
2022-05-28 14:14:22 +02:00
|
|
|
/**
|
|
|
|
* Common options widget stuff.
|
|
|
|
*/
|
|
|
|
class ScummOptionsContainerWidget : public GUI::OptionsContainerWidget {
|
|
|
|
public:
|
|
|
|
ScummOptionsContainerWidget(GuiObject *boss, const Common::String &name, const Common::String &dialogLayout, const Common::String &domain) :
|
|
|
|
OptionsContainerWidget(boss, name, dialogLayout, false, domain) {
|
|
|
|
}
|
|
|
|
|
|
|
|
GUI::CheckboxWidget *createEnhancementsCheckbox(GuiObject *boss, const Common::String &name);
|
2022-11-11 10:38:23 +01:00
|
|
|
GUI::CheckboxWidget *createOriginalGUICheckbox(GuiObject *boss, const Common::String &name);
|
2022-05-28 14:14:22 +02:00
|
|
|
void updateAdjustmentSlider(GUI::SliderWidget *slider, GUI::StaticTextWidget *value);
|
|
|
|
};
|
|
|
|
|
2022-02-03 16:36:00 +01:00
|
|
|
/**
|
2022-03-09 08:53:14 +01:00
|
|
|
* Options widget for EGA Loom.
|
2022-02-03 16:36:00 +01:00
|
|
|
*/
|
2022-05-28 14:14:22 +02:00
|
|
|
class LoomEgaGameOptionsWidget : public ScummOptionsContainerWidget {
|
2022-02-03 16:36:00 +01:00
|
|
|
public:
|
2022-03-09 08:53:14 +01:00
|
|
|
LoomEgaGameOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain);
|
|
|
|
~LoomEgaGameOptionsWidget() override {};
|
2022-02-03 16:36:00 +01:00
|
|
|
|
|
|
|
void load() override;
|
|
|
|
bool save() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
kOvertureTicksChanged = 'OTCH'
|
|
|
|
};
|
|
|
|
|
|
|
|
void defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const override;
|
|
|
|
void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
|
|
|
|
|
2022-05-28 14:14:22 +02:00
|
|
|
GUI::CheckboxWidget *_enableEnhancementsCheckbox;
|
2022-11-11 10:38:23 +01:00
|
|
|
GUI::CheckboxWidget *_enableOriginalGUICheckbox;
|
|
|
|
|
2022-02-03 16:36:00 +01:00
|
|
|
GUI::SliderWidget *_overtureTicksSlider;
|
2022-03-09 08:35:22 +01:00
|
|
|
GUI::StaticTextWidget *_overtureTicksValue;
|
2022-02-03 16:36:00 +01:00
|
|
|
|
2022-03-09 08:35:22 +01:00
|
|
|
void updateOvertureTicksValue();
|
2022-02-03 16:36:00 +01:00
|
|
|
};
|
|
|
|
|
2022-05-28 14:14:22 +02:00
|
|
|
/**
|
|
|
|
* Options widget for VGA Loom (DOS CD).
|
|
|
|
*/
|
|
|
|
class LoomVgaGameOptionsWidget : public ScummOptionsContainerWidget {
|
|
|
|
public:
|
|
|
|
LoomVgaGameOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain);
|
|
|
|
~LoomVgaGameOptionsWidget() override {};
|
|
|
|
|
|
|
|
void load() override;
|
|
|
|
bool save() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
kPlaybackAdjustmentChanged = 'PBAC'
|
|
|
|
};
|
|
|
|
|
|
|
|
void defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const override;
|
|
|
|
void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
|
|
|
|
|
|
|
|
GUI::CheckboxWidget *_enableEnhancementsCheckbox;
|
2022-11-11 10:38:23 +01:00
|
|
|
GUI::CheckboxWidget *_enableOriginalGUICheckbox;
|
|
|
|
|
2022-05-28 14:14:22 +02:00
|
|
|
GUI::SliderWidget *_playbackAdjustmentSlider;
|
|
|
|
GUI::StaticTextWidget *_playbackAdjustmentValue;
|
|
|
|
|
|
|
|
void updatePlaybackAdjustmentValue();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Options widget for CD Monkey Island 1.
|
|
|
|
*/
|
|
|
|
class MI1CdGameOptionsWidget : public ScummOptionsContainerWidget {
|
|
|
|
public:
|
|
|
|
MI1CdGameOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain);
|
|
|
|
~MI1CdGameOptionsWidget() override {};
|
|
|
|
|
|
|
|
void load() override;
|
|
|
|
bool save() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
kIntroAdjustmentChanged = 'IACH',
|
|
|
|
kOutlookAdjustmentChanged = 'OACH'
|
|
|
|
};
|
|
|
|
|
|
|
|
void defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const override;
|
|
|
|
void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
|
|
|
|
|
|
|
|
GUI::CheckboxWidget *_enableEnhancementsCheckbox;
|
2022-11-11 10:38:23 +01:00
|
|
|
GUI::CheckboxWidget *_enableOriginalGUICheckbox;
|
|
|
|
|
2022-05-28 14:14:22 +02:00
|
|
|
GUI::SliderWidget *_introAdjustmentSlider;
|
|
|
|
GUI::StaticTextWidget *_introAdjustmentValue;
|
|
|
|
GUI::SliderWidget *_outlookAdjustmentSlider;
|
|
|
|
GUI::StaticTextWidget *_outlookAdjustmentValue;
|
|
|
|
|
|
|
|
void updateIntroAdjustmentValue();
|
|
|
|
void updateOutlookAdjustmentValue();
|
|
|
|
};
|
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
} // End of namespace Scumm
|
|
|
|
|
2002-11-06 00:56:31 +00:00
|
|
|
#endif
|