1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 06:27:17 +00:00

more XLAT refactoring, and preparation for gentrans.cpp

This commit is contained in:
Zeno Rogue 2021-05-23 15:47:45 +02:00
parent 087c815372
commit 8f4a0935b9
11 changed files with 37 additions and 34 deletions

View File

@ -1841,8 +1841,6 @@ EX void projectionDialog() {
XLAT("HyperRogue uses the Minkowski hyperboloid model internally. "
"Klein and Poincaré models can be obtained by perspective, "
"and the Gans model is obtained by orthogonal projection. "
// "This parameter specifies the distance from the hyperboloid center "
// "to the eye. "
"See also the conformal mode (in the special modes menu) "
"for more models."));
dialog::extra_options = [] () {
@ -2222,7 +2220,7 @@ EX void show3D() {
else if(GDIM == 2 && !spatial_graphics)
dialog::addInfo(XLAT("set 3D monsters or walls in basic config first"));
else if(geom3::invalid != "")
dialog::addInfo(XLAT("error: "+geom3::invalid), 0xC00000);
dialog::addInfo(XLAT("error: ")+geom3::invalid, 0xC00000);
else
dialog::addInfo(XLAT("parameters set correctly"));
dialog::addBreak(50);

View File

@ -409,12 +409,12 @@ string expansion_analyzer::approximate_descendants(int d, int max_length) {
}
enum eDistanceFrom { dfPlayer, dfStart, dfWorld };
string dfnames[3] = { "player", "start", "land" };
EX string dfnames[3] = { "player", "start", "land" };
eDistanceFrom distance_from = dfPlayer;
enum eNumberCoding { ncNone, ncDistance, ncType, ncDebug };
string ncnames[4] = { "NO", "distance", "type", "debug" };
EX string ncnames[4] = { "NO", "distance", "type", "debug" };
eNumberCoding number_coding = ncDistance;
bool mod_allowed() {

View File

@ -261,7 +261,7 @@ EX geometry_filter gf_quotient = {"interesting quotient spaces", [] {
return forced_quotient() && !elliptic;
}};
vector<geometry_filter*> available_filters = { &gf_hyperbolic, &gf_spherical, &gf_euclidean, &gf_other, &gf_regular_2d, &gf_regular_3d, &gf_quotient };
EX vector<geometry_filter*> available_filters = { &gf_hyperbolic, &gf_spherical, &gf_euclidean, &gf_other, &gf_regular_2d, &gf_regular_3d, &gf_quotient };
void ge_select_filter() {
cmode = sm::SIDE | sm::MAYDARK;
@ -674,7 +674,7 @@ EX void menuitem_binary_width(char key) {
}
EX void menuitem_nilwidth(char key) {
dialog::addSelItem(XLAT("nil width"), fts(nilv::nilwidth), key);
dialog::addSelItem(XLAT("Nil width"), fts(nilv::nilwidth), key);
dialog::add_action([] {
dialog::editNumber(nilv::nilwidth, 0.01, 2, 0.1, 1, XLAT("Nil width"), "");
dialog::reaction = ray::reset_raycaster;

View File

@ -820,16 +820,16 @@ EX namespace geom3 {
pconf.alpha = tan_auto(vid.depth) / tan_auto(vid.camera);
else if(vid.tc_depth < vid.tc_alpha && vid.tc_depth < vid.tc_camera) {
ld v = pconf.alpha * tan_auto(vid.camera);
if(hyperbolic && (v<1e-6-12 || v>1-1e-12)) invalid = "cannot adjust depth", vid.depth = vid.camera;
if(hyperbolic && (v<1e-6-12 || v>1-1e-12)) invalid = XLAT("cannot adjust depth"), vid.depth = vid.camera;
else vid.depth = atan_auto(v);
}
else {
ld v = tan_auto(vid.depth) / pconf.alpha;
if(hyperbolic && (v<1e-12-1 || v>1-1e-12)) invalid = "cannot adjust camera", vid.camera = vid.depth;
if(hyperbolic && (v<1e-12-1 || v>1-1e-12)) invalid = XLAT("cannot adjust camera"), vid.camera = vid.depth;
else vid.camera = atan_auto(v);
}
if(fabs(pconf.alpha) < 1e-6) invalid = "does not work with perfect Klein";
if(fabs(pconf.alpha) < 1e-6) invalid = XLAT("does not work with perfect Klein");
if(invalid != "") {
INFDEEP = .7;

View File

@ -3215,7 +3215,7 @@ EX colortable distcolors = {
0xA0A000, 0xA000A0, 0x00A0A0, 0xFFD500
};
const char* minetexts[8] = {
EX const char* minetexts[8] = {
"No mines next to you.",
"A mine is next to you!",
"Two mines next to you!",

View File

@ -112,6 +112,10 @@ string choose4(int g, string a, string b, string c, string d) {
set<string> warnshown;
EX bool translation_exists(const string& x) {
return findInHashTable(x, all_sentences);
}
void basicrep(string& x) {
#if CAP_TRANS

View File

@ -235,16 +235,15 @@ EX void showMainMenu() {
#if ISMOBILE
dialog::addItem(XLAT("visit the website"), 'q');
#else
q = quitsaves() ? "save" : "quit";
q = q + " the game";
dialog::addItem(XLAT(q), 'q');
q = quitsaves() ? XLAT("save the game") : XLAT("quit the game");
dialog::addItem(q, 'q');
#endif
if(canmove)
q = "review your quest";
if(canmove)
q = XLAT("review your quest");
else
q = "game over screen";
dialog::addItem(XLAT(q), SDLK_ESCAPE);
q = XLAT("game over screen");
dialog::addItem(q, SDLK_ESCAPE);
dialog::addItem(get_o_key().first, 'o');
if(inv::on)
@ -260,11 +259,11 @@ EX void showMainMenu() {
dialog::addItem("SHARE", 's'-96);
#endif
if(!canmove) q = "review the scene";
else if(turncount > 0) q = "continue game";
else q = "play the game!";
if(!canmove) q = XLAT("review the scene");
else if(turncount > 0) q = XLAT("continue game");
else q = XLAT("play the game!");
dialog::addItem(XLAT(q), ' ');
dialog::addItem(q, ' ');
dialog::display();
keyhandler = [] (int sym, int uni) {
@ -330,6 +329,10 @@ EX void editScale() {
dialog::scaleSinh();
}
EX const char *wdmodes[7] = {"ASCII", "black", "plain", "Escher", "plain/3D", "Escher/3D", "ASCII/3D"};
EX const char *mdmodes[6] = {"ASCII", "items only", "items and monsters", "3D", "?", "?"};
EX const char *hlmodes[3] = {"press Alt", "highlight", "super-highlight"};
EX void showGraphQuickKeys() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
@ -338,13 +341,10 @@ EX void showGraphQuickKeys() {
dialog::addItem("quick projection", '1');
const char *wdmodes[7] = {"ASCII", "black", "plain", "Escher", "plain/3D", "Escher/3D", "ASCII/3D"};
dialog::addSelItem(XLAT("wall display mode"), XLAT(wdmodes[vid.wallmode]), '5');
const char *mdmodes[6] = {"ASCII", "items only", "items and monsters", "3D", "?", "?"};
dialog::addSelItem(XLAT("monster display mode"), XLAT(mdmodes[vid.monmode]), '8');
const char *hlmodes[3] = {"press Alt", "highlight", "super-highlight"};
dialog::addSelItem(XLAT("highlight stuff"), XLAT(hlmodes[vid.highlightmode]), 508);
dialog::addBoolItem(XLAT("draw the grid"), (vid.grid), '6');

View File

@ -115,7 +115,7 @@ EX namespace multi {
#define SHMUPAXES_CUR ((SHMUPAXES_BASE) + 4 * playercfg)
#endif
const char* axemodes[SHMUPAXES] = {
EX const char* axemodes[SHMUPAXES] = {
"do nothing",
"rotate view",
"panning X",
@ -150,7 +150,7 @@ const char* axemodes[SHMUPAXES] = {
"player 7 spin"
};
const char* axemodes3[4] = {
EX const char* axemodes3[4] = {
"do nothing",
"camera forward",
"camera rotate X",
@ -378,6 +378,8 @@ struct joy_configurer {
};
#endif
EX const char *axmodes[7] = {"OFF", "auto", "light", "heavy", "arrows", "WASD keys", "VI keys"};
struct shmup_configurer {
void operator()() {
@ -418,7 +420,6 @@ struct shmup_configurer {
dialog::addItem(XLAT("configure player 5"), '5');
else if(!shmup::on && !multi::alwaysuse) {
if(GDIM == 2) {
const char *axmodes[7] = {"OFF", "auto", "light", "heavy", "arrows", "WASD keys", "VI keys"};
dialog::addSelItem(XLAT("help for keyboard users"), XLAT(axmodes[vid.axes]), 'h');
dialog::add_action([] {vid.axes += 70 + (shiftmul > 0 ? 1 : -1); vid.axes %= 7; } );
}

View File

@ -189,7 +189,7 @@ const orbinfo& getNativityOrbInfo(eItem orb) {
return oi;
}
EX string olrDescriptions[] = {
EX string olrDescriptions[18] = {
"forbidden to find in %the1",
"too dangerous to use in %the1",
"useless in %the1",

View File

@ -121,13 +121,13 @@ EX hint hints[] = {
0,
[]() { return in_full_game(); },
[]() {
dialog::addInfo(XLAT(
dialog::addInfo(
#if ISMOBILE
"The 'world overview' shows all the lands in HyperRogue."
XLAT("The 'world overview' shows all the lands in HyperRogue.")
#else
"Press 'o' to see all the lands in HyperRogue."
XLAT("Press 'o' to see all the lands in HyperRogue.")
#endif
));
);
dialog::addBreak(50);
dialog::addItem(XLAT("world overview"), 'z');
},

View File

@ -729,7 +729,7 @@ enum eMagicParameter {
mpMAX
};
vector<string> mpnames = {
EX vector<string> mpnames = {
"affect model scale",
"affect model projection",
"affect model central point",