GUI: U32: SCUMM: Make variables in help to use U32

Make titles and other translation dependent variables to use u32
This commit is contained in:
aryanrawlani28 2020-07-02 04:54:57 +05:30 committed by Eugene Sandulenko
parent bd19eaa5bf
commit ffc89d1a2b
2 changed files with 19 additions and 16 deletions

View File

@ -23,6 +23,7 @@
#include "common/str.h"
#include "common/ustr.h"
#include "common/util.h"
#include "scumm/help.h"
@ -65,9 +66,9 @@ int ScummHelp::numPages(byte gameId) {
#define ADD_LINE ADD_BIND("","")
void ScummHelp::updateStrings(byte gameId, byte version, Common::Platform platform,
int page, String &title, String *&key, String *&dsc) {
key = new String[HELP_NUM_LINES];
dsc = new String[HELP_NUM_LINES];
int page, U32String &title, U32String *&key, U32String *&dsc) {
key = new U32String[HELP_NUM_LINES];
dsc = new U32String[HELP_NUM_LINES];
int i = 0;
switch (page) {
case 1:
@ -77,14 +78,14 @@ void ScummHelp::updateStrings(byte gameId, byte version, Common::Platform platfo
ADD_BIND(".", _("Skip line of text"));
ADD_BIND(_("Esc"), _("Skip cutscene"));
ADD_BIND(_("Space"), _("Pause game"));
ADD_BIND(String(_("Ctrl")) + " 0-9", _("Load saved game 1-10"));
ADD_BIND(String(_("Alt")) + " 0-9", _("Save game 1-10"));
ADD_BIND(_("Ctrl") + U32String(" 0-9"), _("Load saved game 1-10"));
ADD_BIND(_("Alt") + U32String(" 0-9"), _("Save game 1-10"));
#ifdef MACOSX
ADD_BIND("Cmd q", _("Quit"));
#else
ADD_BIND(String(_("Alt")) + " x, " + _("Ctrl").encode() + " z", _("Quit").encode());
ADD_BIND(_("Alt") + U32String(" x, ") + _("Ctrl") + U32String(" z"), _("Quit"));
#endif
ADD_BIND(String(_("Alt")) + " " + _("Enter").encode(), _("Toggle fullscreen"));
ADD_BIND(_("Alt") + U32String(" ") + _("Enter"), _("Toggle fullscreen"));
ADD_BIND("[, ]", _("Music volume up / down"));
ADD_BIND("-, +", _("Text speed slower / faster"));
ADD_BIND(_("Enter"), _("Simulate left mouse button"));
@ -93,14 +94,14 @@ void ScummHelp::updateStrings(byte gameId, byte version, Common::Platform platfo
case 2:
title = _("Special keyboard commands:");
ADD_BIND("~, #", _("Show / Hide console"));
ADD_BIND(String(_("Ctrl")) + " d", _("Start the debugger"));
ADD_BIND(String(_("Ctrl")) + " s", _("Show memory consumption"));
ADD_BIND(String(_("Ctrl")) + " f", _("Run in fast mode (*)"));
ADD_BIND(String(_("Ctrl")) + " g", _("Run in really fast mode (*)"));
ADD_BIND(String(_("Ctrl")) + " m", _("Toggle mouse capture"));
ADD_BIND(String(_("Ctrl")) + " " + _("Alt").encode() + " 1-8", _("Switch between graphics filters"));
ADD_BIND(String(_("Ctrl")) + " " + _("Alt").encode() + " +, -", _("Increase / Decrease scale factor"));
ADD_BIND(String(_("Ctrl")) + " " + _("Alt").encode() + " a", _("Toggle aspect-ratio correction"));
ADD_BIND(_("Ctrl") + U32String(" d"), _("Start the debugger"));
ADD_BIND(_("Ctrl") + U32String(" s"), _("Show memory consumption"));
ADD_BIND(_("Ctrl") + U32String(" f"), _("Run in fast mode (*)"));
ADD_BIND(_("Ctrl") + U32String(" g"), _("Run in really fast mode (*)"));
ADD_BIND(_("Ctrl") + U32String(" m"), _("Toggle mouse capture"));
ADD_BIND(_("Ctrl") + U32String(" ") + _("Alt") + U32String(" 1-8"), _("Switch between graphics filters"));
ADD_BIND(_("Ctrl") + U32String(" ") + _("Alt") + U32String(" +, -"), _("Increase / Decrease scale factor"));
ADD_BIND(_("Ctrl") + U32String(" ") + _("Alt") + U32String(" a"), _("Toggle aspect-ratio correction"));
ADD_LINE;
ADD_LINE;
// FIXME: This should use word-wrapping, and should not assume

View File

@ -24,6 +24,7 @@
#define SCUMM_HELP_H
#include "common/str.h"
#include "common/ustr.h"
#include "common/platform.h"
namespace Scumm {
@ -33,11 +34,12 @@ namespace Scumm {
class ScummHelp {
protected:
typedef Common::String String;
typedef Common::U32String U32String;
public:
static int numPages(byte gameId);
static void updateStrings(byte gameId, byte version, Common::Platform platform,
int page, String &title, String *&key, String *&dsc);
int page, U32String &title, U32String *&key, U32String *&dsc);
};
} // End of namespace Scumm