mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-08-05 21:33:58 +00:00
refactored some XLAT calls for automated analysis, fixing some bugs on the way
This commit is contained in:
parent
b92c621112
commit
c0002da574
@ -2835,7 +2835,8 @@ EX void edit_all_settings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void list_setting::show_edit_option(char key) {
|
void list_setting::show_edit_option(char key) {
|
||||||
dialog::addSelItem(XLAT(menu_item_name), XLAT(options[get_value()].first), key);
|
string opt = options[get_value()].first;
|
||||||
|
dialog::addSelItem(XLAT(menu_item_name), XLAT(opt), key);
|
||||||
dialog::add_action_push([this] {
|
dialog::add_action_push([this] {
|
||||||
add_to_changed(this);
|
add_to_changed(this);
|
||||||
gamescreen(2);
|
gamescreen(2);
|
||||||
|
14
geom-exp.cpp
14
geom-exp.cpp
@ -178,9 +178,6 @@ EX void ge_land_selection() {
|
|||||||
|
|
||||||
dialog::init(XLAT("experiment with geometry"));
|
dialog::init(XLAT("experiment with geometry"));
|
||||||
|
|
||||||
// dialog::addSelItem(XLAT("geometry"), XLAT(bitruncnames[int(variation)]), '5');
|
|
||||||
// dialog::addBreak(50);
|
|
||||||
|
|
||||||
generateLandList([] (eLand l) { return land_validity(l).flags & lv::appears_in_geom_exp; });
|
generateLandList([] (eLand l) { return land_validity(l).flags & lv::appears_in_geom_exp; });
|
||||||
stable_sort(landlist.begin(), landlist.end(), [] (eLand l1, eLand l2) { return land_validity(l1).quality_level > land_validity(l2).quality_level; });
|
stable_sort(landlist.begin(), landlist.end(), [] (eLand l1, eLand l2) { return land_validity(l1).quality_level > land_validity(l2).quality_level; });
|
||||||
|
|
||||||
@ -391,10 +388,13 @@ void ge_select_tiling() {
|
|||||||
if(ginf[j].tiling_name == ginf[i].tiling_name)
|
if(ginf[j].tiling_name == ginf[i].tiling_name)
|
||||||
geometry = g = eGeometry(j);
|
geometry = g = eGeometry(j);
|
||||||
}
|
}
|
||||||
dialog::addBoolItem(XLAT(
|
|
||||||
(geometry == gProduct && in_2d) ? XLAT("current geometry x E") :
|
bool is_product = (geometry == gProduct && in_2d);
|
||||||
(geometry == gRotSpace && in_2d) ? XLAT("space of rotations in current geometry") :
|
bool is_rotspace = (geometry == gRotSpace && in_2d);
|
||||||
ginf[g].menu_displayed_name), on, letter++);
|
dialog::addBoolItem(
|
||||||
|
is_product ? XLAT("current geometry x E") :
|
||||||
|
is_rotspace ? XLAT("space of rotations in current geometry") :
|
||||||
|
XLAT(ginf[g].menu_displayed_name), on, letter++);
|
||||||
dialog::lastItem().value += validclasses[land_validity(specialland).quality_level];
|
dialog::lastItem().value += validclasses[land_validity(specialland).quality_level];
|
||||||
dialog::add_action([g] { set_or_configure_geometry(g); });
|
dialog::add_action([g] { set_or_configure_geometry(g); });
|
||||||
}
|
}
|
||||||
|
@ -1824,15 +1824,11 @@ EX namespace mapeditor {
|
|||||||
case sgFloor:
|
case sgFloor:
|
||||||
line1 = GDIM == 3 ? XLAT("pick something") : XLAT("floor");
|
line1 = GDIM == 3 ? XLAT("pick something") : XLAT("floor");
|
||||||
line2 = "#" + its(drawcellShapeID());
|
line2 = "#" + its(drawcellShapeID());
|
||||||
/* line2 = XLAT(ishept(drawcell) ? "heptagonal" :
|
|
||||||
ishex1(drawcell) ? "hexagonal #1" : "hexagonal"); */
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case sgWall:
|
case sgWall:
|
||||||
line1 = XLAT("statue");
|
line1 = XLAT("statue");
|
||||||
line2 = "#" + its(drawcellShapeID());
|
line2 = "#" + its(drawcellShapeID());
|
||||||
/* line2 = XLAT(ishept(drawcell) ? "heptagonal" :
|
|
||||||
ishex1(drawcell) ? "hexagonal #1" : "hexagonal"); */
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
menus.cpp
16
menus.cpp
@ -124,9 +124,10 @@ EX void showOverview() {
|
|||||||
if(items[it] >= 10) col = winf[waMirror].color; else col = BLACKISH;
|
if(items[it] >= 10) col = winf[waMirror].color; else col = BLACKISH;
|
||||||
if(displayfrZH(xr*46, i0, 1, vf-4, XLAT1(winf[waMirror].name), col, 0))
|
if(displayfrZH(xr*46, i0, 1, vf-4, XLAT1(winf[waMirror].name), col, 0))
|
||||||
getcstat = 3000+waMirror;
|
getcstat = 3000+waMirror;
|
||||||
if(getcstat == 3000+waMirror)
|
if(getcstat == 3000+waMirror) {
|
||||||
mouseovers = XLAT(
|
string olrdesc = olrDescriptions[getOLR(io, cwt.at->land)];
|
||||||
olrDescriptions[getOLR(io, cwt.at->land)], cwt.at->land, it, treasureTypeUnlock(curland, io));
|
mouseovers = XLAT(olrdesc, cwt.at->land, it, treasureTypeUnlock(curland, io));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(io) {
|
else if(io) {
|
||||||
if(lv >= 25) col = 0xFFD500;
|
if(lv >= 25) col = 0xFFD500;
|
||||||
@ -139,9 +140,10 @@ EX void showOverview() {
|
|||||||
getcstat = 2000+io;
|
getcstat = 2000+io;
|
||||||
if(displayfrZH(xr*46, i0, 1, vf-4, XLAT1(iinf[io].name), col, 0))
|
if(displayfrZH(xr*46, i0, 1, vf-4, XLAT1(iinf[io].name), col, 0))
|
||||||
getcstat = 2000+io;
|
getcstat = 2000+io;
|
||||||
if(getcstat == 2000+io)
|
if(getcstat == 2000+io) {
|
||||||
mouseovers = XLAT(
|
string olrdesc = olrDescriptions[getOLR(io, curland)];
|
||||||
olrDescriptions[getOLR(io, curland)], curland, it, treasureTypeUnlock(curland, io));
|
mouseovers = XLAT(olrdesc, curland, it, treasureTypeUnlock(curland, io));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,7 +229,7 @@ EX void showMainMenu() {
|
|||||||
else dialog::addBreak(100);
|
else dialog::addBreak(100);
|
||||||
dialog::addItem(XLAT("restart game"), 'r');
|
dialog::addItem(XLAT("restart game"), 'r');
|
||||||
|
|
||||||
dialog::addItem(XLAT(inSpecialMode() ? "reset special modes" : "back to the start menu"), 'R');
|
dialog::addItem(inSpecialMode() ? XLAT("reset special modes") : XLAT("back to the start menu"), 'R');
|
||||||
|
|
||||||
string q;
|
string q;
|
||||||
#if ISMOBILE
|
#if ISMOBILE
|
||||||
|
30
pcmove.cpp
30
pcmove.cpp
@ -666,12 +666,22 @@ bool pcmove::actual_move() {
|
|||||||
return after_escape();
|
return after_escape();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void blowaway_message(cell *c2) {
|
||||||
|
addMessage(airdist(c2) < 3 ? XLAT("The Air Elemental blows you away!") : XLAT("You cannot go against the wind!"));
|
||||||
|
}
|
||||||
|
|
||||||
|
EX void tortoise_hero_message(cell *c2) {
|
||||||
|
bool fem = playergender() == GEN_F;
|
||||||
|
playSound(c2, fem ? "heal-princess" : "heal-prince");
|
||||||
|
addMessage(fem ? XLAT("You are now a tortoise heroine!") : XLAT("You are now a tortoise hero!"));
|
||||||
|
}
|
||||||
|
|
||||||
bool pcmove::boat_move() {
|
bool pcmove::boat_move() {
|
||||||
|
|
||||||
cell *& c2 = mi.t;
|
cell *& c2 = mi.t;
|
||||||
|
|
||||||
if(againstWind(c2, cwt.at)) {
|
if(againstWind(c2, cwt.at)) {
|
||||||
if(vmsg()) addMessage(XLAT(airdist(c2) < 3 ? "The Air Elemental blows you away!" : "You cannot go against the wind!"));
|
if(vmsg()) blowaway_message(c2);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -875,14 +885,13 @@ bool pcmove::move_if_okay() {
|
|||||||
|
|
||||||
void pcmove::tell_why_impassable() {
|
void pcmove::tell_why_impassable() {
|
||||||
cell*& c2 = mi.t;
|
cell*& c2 = mi.t;
|
||||||
if(nonAdjacent(cwt.at,c2))
|
if(nonAdjacent(cwt.at,c2)) {
|
||||||
addMessage(XLAT(
|
addMessage(geosupport_football() < 2 ?
|
||||||
geosupport_football() < 2 ?
|
XLAT("You cannot move between the cells without dots here!") :
|
||||||
"You cannot move between the cells without dots here!" :
|
XLAT("You cannot move between the triangular cells here!")
|
||||||
"You cannot move between the triangular cells here!"
|
);
|
||||||
));
|
}
|
||||||
else if(againstWind(c2, cwt.at))
|
else if(againstWind(c2, cwt.at)) blowaway_message(c2);
|
||||||
addMessage(XLAT(airdist(c2) < 3 ? "The Air Elemental blows you away!" : "You cannot go against the wind!"));
|
|
||||||
else if(isAlch(c2))
|
else if(isAlch(c2))
|
||||||
addMessage(XLAT("Wrong color!"));
|
addMessage(XLAT("Wrong color!"));
|
||||||
else if(c2->wall == waRoundTable)
|
else if(c2->wall == waRoundTable)
|
||||||
@ -963,8 +972,7 @@ bool pcmove::attack() {
|
|||||||
updateHi(itBabyTortoise, items[itBabyTortoise]);
|
updateHi(itBabyTortoise, items[itBabyTortoise]);
|
||||||
c2->item = itBabyTortoise;
|
c2->item = itBabyTortoise;
|
||||||
tortoise::babymap[c2] = tortoise::seekbits;
|
tortoise::babymap[c2] = tortoise::seekbits;
|
||||||
playSound(c2, playergender() ? "heal-princess" : "heal-prince");
|
tortoise_hero_message(c2);
|
||||||
addMessage(XLAT(playergender() == GEN_F ? "You are now a tortoise heroine!" : "You are now a tortoise hero!"));
|
|
||||||
achievement_collection(itBabyTortoise);
|
achievement_collection(itBabyTortoise);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
2
quit.cpp
2
quit.cpp
@ -491,7 +491,7 @@ EX void showMission() {
|
|||||||
if(racing::on)
|
if(racing::on)
|
||||||
dialog::addItem(XLAT("racing menu"), 'o');
|
dialog::addItem(XLAT("racing menu"), 'o');
|
||||||
#if !ISMOBILE
|
#if !ISMOBILE
|
||||||
dialog::addItem(XLAT(quitsaves() ? "save" : "quit"), SDLK_F10);
|
dialog::addItem(quitsaves() ? XLAT("save") : XLAT("quit"), SDLK_F10);
|
||||||
#endif
|
#endif
|
||||||
#if CAP_ANDROIDSHARE
|
#if CAP_ANDROIDSHARE
|
||||||
dialog::addItem(XLAT("SHARE"), 's'-96);
|
dialog::addItem(XLAT("SHARE"), 's'-96);
|
||||||
|
@ -2417,7 +2417,7 @@ void moveMonster(monster *m, int delta) {
|
|||||||
if(m->type == moTortoise && tortoise::seek() && !tortoise::diff(getBits(m->torigin)) && sqdist(m->pat*C0, pc[i]->pat*C0) < SCALE2) {
|
if(m->type == moTortoise && tortoise::seek() && !tortoise::diff(getBits(m->torigin)) && sqdist(m->pat*C0, pc[i]->pat*C0) < SCALE2) {
|
||||||
items[itBabyTortoise] += 4;
|
items[itBabyTortoise] += 4;
|
||||||
m->dead = true;
|
m->dead = true;
|
||||||
addMessage(XLAT(playergender() == GEN_F ? "You are now a tortoise heroine!" : "You are now a tortoise hero!"));
|
tortoise_hero_message(m->base);
|
||||||
}
|
}
|
||||||
for(int i=0; i<players; i++) if(!pc[i]->isVirtual)
|
for(int i=0; i<players; i++) if(!pc[i]->isVirtual)
|
||||||
if(m->type == moFlailer && curtime >= m->nextshot &&
|
if(m->type == moFlailer && curtime >= m->nextshot &&
|
||||||
|
23
tour.cpp
23
tour.cpp
@ -188,9 +188,10 @@ string get_subname(const string& s, const string& folder) {
|
|||||||
/** \brief display the help text for the current slide if texts enabled */
|
/** \brief display the help text for the current slide if texts enabled */
|
||||||
EX void slidehelp() {
|
EX void slidehelp() {
|
||||||
if(texts && slides[currentslide].help[0]) {
|
if(texts && slides[currentslide].help[0]) {
|
||||||
|
string slidename = get_slidename(slides[currentslide].name);
|
||||||
gotoHelp(
|
gotoHelp(
|
||||||
help =
|
help =
|
||||||
helptitle(XLAT(get_slidename(slides[currentslide].name)), 0xFF8000) +
|
helptitle(XLAT(slidename), 0xFF8000) +
|
||||||
XLAT(slides[currentslide].help)
|
XLAT(slides[currentslide].help)
|
||||||
);
|
);
|
||||||
presentation(pmHelpEx);
|
presentation(pmHelpEx);
|
||||||
@ -339,11 +340,14 @@ bool handleKeyTour(int sym, int uni) {
|
|||||||
canmove = true;
|
canmove = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else addMessage(XLAT(
|
else {
|
||||||
(vid.shifttarget&1) ?
|
bool shift = vid.shifttarget & 1;
|
||||||
"Shift-click a location to teleport there."
|
addMessage(
|
||||||
: "Click a location to teleport there."
|
shift ?
|
||||||
));
|
XLAT("Shift-click a location to teleport there.")
|
||||||
|
: XLAT("Click a location to teleport there.")
|
||||||
|
);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(NUMBERKEY == '5') {
|
if(NUMBERKEY == '5') {
|
||||||
@ -451,8 +455,11 @@ EX namespace ss {
|
|||||||
if(sf == last) continue;
|
if(sf == last) continue;
|
||||||
last = sf;
|
last = sf;
|
||||||
string sfd;
|
string sfd;
|
||||||
|
|
||||||
if(sf.back() == '/') sfd = XLAT(sf.substr(0, isize(sf)-1)) + "/ ";
|
if(sf.back() == '/') {
|
||||||
|
sfd = sf.substr(0, isize(sf)-1);
|
||||||
|
sfd = XLAT(sfd) + "/ ";
|
||||||
|
}
|
||||||
else sfd = XLAT(sf);
|
else sfd = XLAT(sf);
|
||||||
|
|
||||||
dialog::addBoolItem(XLAT(sf), wts == slides && in_folder(slides[currentslide].name, current_folder+sf), slidechars[key++]);
|
dialog::addBoolItem(XLAT(sf), wts == slides && in_folder(slides[currentslide].name, current_folder+sf), slidechars[key++]);
|
||||||
|
@ -1269,7 +1269,10 @@ EX namespace peace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EX void showMenu() {
|
EX void showMenu() {
|
||||||
string title = XLAT(otherpuzzles ? (explore_other ? "exploration" : "puzzles") : "memory game");
|
string title =
|
||||||
|
!otherpuzzles ? XLAT("memory game") :
|
||||||
|
explore_other ? XLAT("exploration") :
|
||||||
|
XLAT("puzzles");
|
||||||
dialog::init(title, 0x40A040, 150, 100);
|
dialog::init(title, 0x40A040, 150, 100);
|
||||||
|
|
||||||
int kind = 0;
|
int kind = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user