text improvements, PL/CZ translation update

This commit is contained in:
Zeno Rogue 2018-12-14 18:21:52 +01:00
parent f22ec08f86
commit 5d01ac0732
13 changed files with 346 additions and 76 deletions

View File

@ -1689,11 +1689,11 @@ vector<geometryinfo> ginf = {
{"minimal quotient", "minimal", 7, 3, qsSMALLN, gcHyperbolic, 0x18600, {{7, 5}}, eVariation::bitruncated},
{"binary tiling", "binary", 7, 3, 0, gcHyperbolic, 0, {{7, 5}}, eVariation::pure},
{"Archimedean", "A", 7, 3, 0, gcHyperbolic, 0, {{7, 5}}, eVariation::pure},
{"Macbeath surface", "Macbeath", 7, 3, qsSMALL, gcHyperbolic, 0x20000, {{7, 5}}, eVariation::bitruncated},
{"Macbeath Surface", "Macbeath", 7, 3, qsSMALL, gcHyperbolic, 0x20000, {{7, 5}}, eVariation::bitruncated},
{"Bring's Surface", "Bring", 5, 4, qsSMALL, gcHyperbolic, 0x20200, {{6, 4}}, eVariation::bitruncated},
{"Schmutz's M(3)", "M3", 12, 3, qsSMALL, gcHyperbolic, 0x20400, {{4, 2}}, eVariation::bitruncated},
{"Schmutz's M(4)", "M4", 12, 3, qsSMALL, gcHyperbolic, 0x20600, {{4, 2}}, eVariation::bitruncated},
{"more dimensions", "Crystal", 6, 4, qANYQ, gcHyperbolic, 0x28000, {{5, 3}}, eVariation::pure},
{"dimensional crystal", "Crystal", 6, 4, qANYQ, gcHyperbolic, 0x28000, {{5, 3}}, eVariation::pure},
};
// remember to match the following mask when specifying codes for extra geometries: 0x78600

View File

@ -1098,23 +1098,23 @@ string make_help() {
void show() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
dialog::init(XLAT("multi-dimensional"));
dialog::init(XLAT("dimensional crystal"));
for(int i=5; i<=14; i++) {
string s;
if(i % 2) s = its(i/2) + ".5D";
else s = its(i/2) + "D";
dialog::addBoolItem(s, geometry == gCrystal && ginf[gCrystal].sides == i && ginf[gCrystal].vertex == 4, 'a' + i - 5);
dialog::add_action([i]() { set_crystal(i); start_game(); });
dialog::add_action(dialog::add_confirmation([i]() { set_crystal(i); start_game(); }));
}
dialog::addBoolItem("4D double bitruncated", ginf[gCrystal].vertex == 3, 'D');
dialog::add_action([]() { set_crystal(8); set_variation(eVariation::bitruncated); set_variation(eVariation::bitruncated); start_game(); });
dialog::addBoolItem(XLAT("4D double bitruncated"), ginf[gCrystal].vertex == 3, 'D');
dialog::add_action(dialog::add_confirmation([]() { set_crystal(8); set_variation(eVariation::bitruncated); set_variation(eVariation::bitruncated); start_game(); }));
dialog::addBreak(50);
dialog::addBoolItem("view coordinates in the cheat mode", view_coordinates, 'v');
dialog::addBoolItem(XLAT("view coordinates in the cheat mode"), view_coordinates, 'v');
dialog::add_action([]() { view_coordinates = !view_coordinates; });
dialog::addSelItem(XLAT("compass probability"), fts(compass_probability), 'p');
dialog::add_action([]() { dialog::editNumber(compass_probability, 0, 1, 0.1, 1, XLAT("compass probability"), compass_help()); });
if(geometry == gCrystal) {
dialog::addBoolItem("3D display", rug::rugged, 'r');
dialog::addBoolItem(XLAT("3D display"), rug::rugged, 'r');
dialog::add_action([]() { pushScreen(rug::show); });
}
else

View File

@ -1058,6 +1058,20 @@ namespace dialog {
numberdark = 0;
}
void confirm_dialog(const string& text, const reaction_t& act) {
gamescreen(1);
dialog::addBreak(250);
dialog::init(XLAT("WARNING"), 0xFF0000, 150, 100);
dialog::addInfo(text);
dialog::addItem(XLAT("YES"), 'y');
auto yes = [act] () { popScreen(); act(); };
dialog::add_action(yes);
dialog::add_key_action(SDLK_RETURN, yes);
dialog::addItem(XLAT("NO"), 'n');
dialog::add_action([] () { popScreen(); });
dialog::display();
}
};
}

View File

@ -72,18 +72,18 @@ void showQuotientConfig() {
gxcur.current_prime_id = uni - 'A';
else if(uni == 'p')
nextPrime(gxcur);
else if(uni == 'x' || uni == '\n') {
else if(uni == 'x' || uni == '\n') dialog::do_if_confirmed([&gxcur] {
set_geometry(gxcur.base);
enableFieldChange();
set_geometry(gFieldQuotient);
start_game();
}
else if(uni == 'c') {
});
else if(uni == 'c') dialog::do_if_confirmed([] {
set_geometry(gEuclid);
fieldpattern::quotient_field_changed = false;
set_geometry(gFieldQuotient);
start_game();
}
});
else if(doexiton(sym, uni))
popScreen();
};
@ -234,7 +234,7 @@ void showTorusConfig() {
dialog::editNumber(torusconfig::newsdy, 0, 1000, square ? 2 : simple ? 3 : 2, 12, XLAT("height (y)"), "");
else if(uni == 't')
torus_bitrunc = !torus_bitrunc;
else if((uni == 'a' || uni == '\n') && torusconfig::newqty >= 3 && valid) {
else if((uni == 'a' || uni == '\n') && torusconfig::newqty >= 3 && valid) dialog::do_if_confirmed([square] {
set_geometry(gNormal);
torusconfig::torus_mode = torusconfig::newmode;
torusconfig::qty = torusconfig::newqty;
@ -245,15 +245,15 @@ void showTorusConfig() {
set_geometry(gTorus);
set_variation((torus_bitrunc || !square) ? eVariation::bitruncated : eVariation::pure);
start_game();
}
else if(uni == 'c') {
});
else if(uni == 'c') dialog::do_if_confirmed([] {
set_geometry(gEuclid);
torusconfig::torus_mode = torusconfig::tmSingle;
torusconfig::qty = torusconfig::def_qty;
torusconfig::dy = torusconfig::def_dy;
set_geometry(gTorus);
start_game();
}
});
else if(uni == 'z') editScale();
#if CAP_RUG
else if(uni == 'u') rug::select();
@ -332,10 +332,10 @@ void showEuclideanMenu() {
pushScreen(crystal::show);
else if(targetgeometry == gArchimedean)
pushScreen(arcm::show);
else {
else dialog::do_if_confirmed([targetgeometry] () {
set_geometry(targetgeometry);
start_game();
}
});
});
}
@ -533,10 +533,10 @@ void showEuclideanMenu() {
#endif
};
}
else if(euclid4) {
else if(euclid4) dialog::do_if_confirmed([] {
set_variation(PURE ? eVariation::bitruncated : eVariation::pure);
start_game();
}
});
else // if(S3 == 3)
gp::configure();
}
@ -622,18 +622,18 @@ void showEuclideanMenu() {
if(eupage * euperpage >= isize(landlist)) eupage = 0;
}
else if(uni == '1') {
if(chaosUnlocked) {
if(chaosUnlocked) dialog::do_if_confirmed([] {
stop_game_and_switch_mode(rg::chaos);
start_game();
}
});
}
else if(lid >= 0 && lid < isize(landlist)) {
eLand nland = landlist[lid];
if(landvisited[nland]) {
if(landvisited[nland]) dialog::do_if_confirmed([nland] {
stop_game_and_switch_mode(tactic::on ? rg::tactic : rg::nothing);
firstland = specialland = nland;
start_game();
}
});
}
else if(uni == '2' || sym == SDLK_F1) gotoHelp(euchelp);
else if(doexiton(sym, uni)) popScreen();

View File

@ -724,10 +724,10 @@ namespace hr { namespace gp {
if(irr::supports(geometry)) {
dialog::addBoolItem(XLAT("irregular"), IRREGULAR, 'i');
dialog::add_action([=] () {
dialog::add_action(dialog::add_confirmation([=] () {
if(min_quality && !irr::bitruncations_requested) irr::bitruncations_requested++;
if(!IRREGULAR) irr::visual_creator();
});
}));
}
dialog::addBreak(100);
@ -737,9 +737,10 @@ namespace hr { namespace gp {
keyhandler = [] (int sym, int uni) {
dialog::handleNavigation(sym, uni);
if(uni == 'a')
if(uni == 'a') dialog::do_if_confirmed([] {
whirl_set(loc(1, 0));
else if(uni == 'b') {
});
else if(uni == 'b') dialog::do_if_confirmed([] {
if(S3 == 4) {
if(!BITRUNCATED) {
stop_game();
@ -749,13 +750,16 @@ namespace hr { namespace gp {
}
else
whirl_set(loc(1, 1));
}
else if(uni == 'c')
});
else if(uni == 'c') dialog::do_if_confirmed([] {
whirl_set(loc(2, 0));
else if(uni == 'd')
});
else if(uni == 'd') dialog::do_if_confirmed([] {
whirl_set(S3 == 3 ? loc(3, 0) : loc(1,1));
else if(uni == 'f')
});
else if(uni == 'f') dialog::do_if_confirmed([] {
whirl_set(config);
});
else if(uni == 'x')
dialog::editNumber(config.first, 0, 8, 1, 1, "x", helptext());
else if(uni == 'y')

20
hyper.h
View File

@ -1727,6 +1727,8 @@ bool minesafe();
bool hasSafeOrb(cell *c);
void placeWater(cell *c, cell *c2);
bool againstCurrent(cell *w, cell *from);
bool needConfirmation();
bool needConfirmationEvenIfSaved();
#define DEFAULTCONTROL (multi::players == 1 && !shmup::on && !multi::alwaysuse && !(rug::rugged && rug::renderonce))
#define DEFAULTNOR(sym) (DEFAULTCONTROL || multi::notremapped(sym))
@ -1854,6 +1856,22 @@ namespace dialog {
string editchecker(int sym, int uni);
bool handle_edit_string(int sym, int uni, function<string(int, int)> checker = editchecker);
void edit_string(string& s, string title, string help);
void confirm_dialog(const string& text, const reaction_t& act);
void cheat_if_confirmed(const reaction_t& act) {
if(needConfirmationEvenIfSaved()) pushScreen([act] () { confirm_dialog("This will enable the cheat mode, making this game ineligible for scoring. Are you sure?", act); });
else act();
}
void do_if_confirmed(const reaction_t& act) {
if(needConfirmation()) pushScreen([act] () { confirm_dialog("This will end your current game and start a new one. Are you sure?", act); });
else act();
}
reaction_t add_confirmation(const reaction_t& act) {
return [act] { do_if_confirmed(act); };
}
}
void checkStunKill(cell *dest);
@ -2528,8 +2546,6 @@ void handlePanning(int sym, int uni);
namespace leader { void showMenu(); void handleKey(int sym, int uni); }
#endif
bool needConfirmation();
namespace mirror {
cellwalker reflect(const cellwalker& cw);
}

View File

@ -7501,7 +7501,7 @@ S(
// color edit dialog
S("customize colors and aura", "Uprav barvy a auru")
S("customize colors and aura", "uprav barvy a auru")
S("background", "pozadí")
S("foreground", "popøedí")
@ -7535,3 +7535,109 @@ S("half-plane scale", "polorovinové měřítko")
S("use GPU to compute projections", "použít GPU k výpočtu projekcí")
S("N/A", "nedostupné")
S(" (2D only)", " (pouze 2D)")
// 10.5d
// this line was missing...
S("geometry experiments", "experimenty s geometrií")
S("cylinder (squares)", "válec (čtverce)")
S("cylinder (hex)", "válec (hexy)")
S("Möbius band (squares)", "Möbiův pásek (čtverce)")
S("Möbius band (hex)", "Möbiův pásek (hexy)")
S("Macbeath Surface", "Macbeathova plocha")
S("Bring's Surface", "Bringova plocha")
S("Schmutz's M(3)", "Schmutzův M(3)")
S("Schmutz's M(4)", "Schmutzův M(4)")
S("dimensional crystal", "dimenzionální krystal")
S(
"This geometry essentially lets you play in a d-dimensional grid. Pick three "
"dimensions and '3D display' to see how it works -- we are essentially playing on a periodic surface in "
"three dimensions, made of hexagons; each hexagon connects to six other hexagons, in each of the 6 "
"possible directions. Normally, the game visualizes this from the point of view of a creature living inside "
"the surface (regularized and smoothened somewhat), assuming that light rays are also restricted to the surface -- "
"this will look exactly like the {2d,4} tiling, except that the light rays may thus "
"sometimes make a loop, causing you to see images of yourself in some directions (in other words, "
"the d-dimensional grid is a quotient of the hyperbolic plane tiling). The same construction works in other dimensions. "
"Half dimensions are interpreted in the following way: the extra dimension only has two 'levels', for example 2.5D "
"has a top plane and a bottom plane.\n\n"
"You may also bitruncate this geometry -- which makes it work better with the rules of HyperRogue, but a bit harder to understand.",
"Tato geometrie ti v podstatě umožňuje hrát na d-rozměrné mřížce. Vyber si tři rozměry "
"a '3D zobrazení', abyste viděli, jak to funguje -- v podstatě hrajeme na periodickém "
"povrchu ve třech rozměrech tvořeném šestiúhelníky; každý šestiúhelník je spojený se "
"šesti dalšími šestiúhelníky v každém z šesti možných směrů. Hra to normálně vizualizuje "
"z pohledu tvora žijícího uvnitř tohoto povrchu (poněkud regularizovaného a vyhlazeného) "
"za předpokladu, že i světelné paprsky se mohou šířit pouze po tomto povrchu -- bude to "
"vypadat přesně jako dláždění {2d,4}, až na to, že světelné paprsky mohou tím pádem někdy "
"udělat okruh a ty v některých směrech můžeš vidět sám sebe (jinými slovy, d-rozměrná "
"mřížka je kvocientem dláždění hyperbolické roviny). Stejná konstrukce funguje i "
"v jiných rozměrech. "
"Poločíselné rozměry se interpretují následovně: přebytečný rozměr má pouze dvě "
"'úrovně' -- například 2.5D má horní rovinu a dolní rovinu.\n\n"
"Tuto geometrii je také možné dvojseříznout -- bude pak lépe fungovat v rámci pravidel "
"HyperRogue, ale bude o něco obtížnější jí porozumět.")
S("4D double bitruncated", "4D dvojitě dvojseříznutý")
S("view coordinates in the cheat mode", "zobraz souřadnice v cheat módu")
S("compass probability", "pravděpodobnost kompasu")
S("3D display", "3D zobrazení")
S("\"Each piece of the Round Table is exactly %1 steps away from the Holy Grail.\"",
"\"Každý kousek Kulatého stolu je přesně %1 kroků od Svatého grálu.\"")
S("\"According to Merlin, the Round Table is a perfect Euclidean sphere in %1 dimensions.\"",
"\"Merlin říká, že Kulatý stůl je dokonalá eukleidovská sféra v %1 rozměrech.")
S(
"Lands in this geometry are usually built on North-South or West-East axis. "
"Compasses always point North, and all the cardinal directions to the right from compass North are East (this is not "
"true in general, but it is true for the cells where compasses are generated). "
"North is the first coordinate, while East is the sum of other coordinates.",
"Země v této geometrii se obvykle budují na ose sever-jih nebo západ-východ. Kompasy "
"vždy ukazují na sever a všechny kardinální směry napravo od kompasového severu jsou "
"východ (toto neplatí obecně, ale platí to pro políčka, na kterých se generují kompasy). "
"Sever je první souřadnice, zatímco východ je součet zbývajících souřadnic.")
S("crystal coordinate colors", "barvy souřadných krystalů")
S("3D monsters/walls on the surface", "3D netvoři/stěny na povrchu")
S("no 3D effects available in this projection", "v této projekci nejsou k dispozici 3D efekty")
// new screenshot menu
S("screenshots", "snímky obrazovky")
S("format", "formát")
S("pixels (X)", "pixely (X)")
S("pixels (Y)", "pixely (Y)")
S("supersampling", "supersampling")
S("transparent", "průsvitnost")
S("gamma", "gamma")
S("higher value = darker", "vyšší hodnota = tmavší")
S("brightness", "jas")
S("higher value = lighter", "vyšší hodnota = světlejší")
S("show the HUD", "zobrazuj HUD")
S("SVG screenshots do not work in this 3D mode", "SVG snímky obrazovky v tomto 3D módu nefungují")
S("SVG screenshots do not work with textures", "SVG snímky obrazovky nefungují s texturami")
S("take screenshot", "pořiď snímek obrazovky")
S("screenshot", "snímek obrazovky")
S("shot settings", "nastavení snímků obrazovky")
// new warnings
S("WARNING", "VAROVÁNÍ")
S("YES", "ANO")
S("NO", "NE")
S("Are you sure you want to hit %the1?", "Víš jistě, že chceš udeřit %a1?")
S("This will exit HyperRogue without saving your current game. Are you sure?",
"Tímto ukončíš HyperRogue bez uložení aktuální hry. Víš jistě, že to chceš udělat?")
S("This will end your current game and start a new one. Are you sure?",
"Tímto ukončíš současnou hru a začneš novou. Víš to jistě?")
S("This will enable the cheat mode, making this game ineligible for scoring. Are you sure?",
"Tímto aktivuješ cheat mód a tuto hru nebude možné skórovat. Víš to jistě?")

View File

@ -7254,7 +7254,7 @@ S(
// color edit dialog
S("customize colors and aura", "Dostosuj kolory i aurę")
S("customize colors and aura", "dostosuj kolory i aurę")
S("background", "tło")
S("foreground", "pierwszy plan")
@ -7288,3 +7288,109 @@ S("half-plane scale", "skala półpłaszczyzny")
S("use GPU to compute projections", "obliczanie projekcji przy użyciu GPU")
S("N/A", "niedostępne")
S(" (2D only)", " (tylko 2D)")
// 10.5d
// this line was missing...
S("geometry experiments", "eksperymenty z geometrią")
S("cylinder (squares)", "walec (kwadraty)")
S("cylinder (hex)", "walec (heksy)")
S("Möbius band (squares)", "wstęga Möbiusa (kwadraty)")
S("Möbius band (hex)", "wstęga Möbiusa (heksy)")
S("Macbeath Surface", "powierzchnia Macbeatha")
S("Bring's Surface", "powierzchnia Bringa")
S("Schmutz's M(3)", "M(3) Schmutza")
S("Schmutz's M(4)", "M(4) Schmutza")
S("dimensional crystal", "wielowymiarowy kryształ")
S(
"This geometry essentially lets you play in a d-dimensional grid. Pick three "
"dimensions and '3D display' to see how it works -- we are essentially playing on a periodic surface in "
"three dimensions, made of hexagons; each hexagon connects to six other hexagons, in each of the 6 "
"possible directions. Normally, the game visualizes this from the point of view of a creature living inside "
"the surface (regularized and smoothened somewhat), assuming that light rays are also restricted to the surface -- "
"this will look exactly like the {2d,4} tiling, except that the light rays may thus "
"sometimes make a loop, causing you to see images of yourself in some directions (in other words, "
"the d-dimensional grid is a quotient of the hyperbolic plane tiling). The same construction works in other dimensions. "
"Half dimensions are interpreted in the following way: the extra dimension only has two 'levels', for example 2.5D "
"has a top plane and a bottom plane.\n\n"
"You may also bitruncate this geometry -- which makes it work better with the rules of HyperRogue, but a bit harder to understand.",
"Ta geometria pozwala Ci grać na d-wymiarowej siatce. Wybierz 3 wymiary i "
"'tryb 3D' by zobaczyć, jak to działa -- gramy na okresowej powierzchni w "
"trzech wymiarach, złożonej z sześciokątów; każdy sześciokąt łączy się "
"z 6 innymi sześciokątami, w 6 kierunkach. Normalnie gra przedstawia "
"sytuację z punktu widzenia istoty żyjącej na tej powierzchni (wyregulowanej i "
"wygładzonej), przy założeniu, że promienie świetlne również są ograniczone "
"do powierzchni -- w związku z czym sytuacja wygląda jak parkietaż {2d,4}, "
"poza tym, że promienie świetlne czasami zataczają pętlę, w związku z czym "
"w niektórych kierunkach widzisz obrazy samego siebie (innymi słowami, "
"siatka d-wymiarowa jest przestrzenią ilorazową parkietażu hiperbolicznego). "
"Ta sama konstrukcja działa też w innych wymiarach. Pół-wymiary są "
"interpretowane w sposób następujący: dodatkowy wymiar ma 2 'poziomy', na przykład "
"2.5D ma górną i dolną płaszczyznę.\n\n"
"Można przyciąć (bitruncate) tą geometrię -- powoduje to, że lepiej ona współgra z regułami "
"HyperRogue, ale jest trochę trudniejsza do zrozumienia.")
S("4D double bitruncated", "4 wymiary, podwójna bitrunkacja")
S("view coordinates in the cheat mode", "pokazuj współrzędne w trybie oszustwa")
S("compass probability", "prawdopodobieństwo kompasu")
S("3D display", "tryb 3D")
S("\"Each piece of the Round Table is exactly %1 steps away from the Holy Grail.\"",
"\"Każdy fragment stołu jest dokładnie %1 kroków od Świętego Graala.\"")
S("\"According to Merlin, the Round Table is a perfect Euclidean sphere in %1 dimensions.\"",
"\"Merlin mówi, że Okrągły Stół jest dokładną Euklidesową sferą w %1 wymiarach.")
S(
"Lands in this geometry are usually built on North-South or West-East axis. "
"Compasses always point North, and all the cardinal directions to the right from compass North are East (this is not "
"true in general, but it is true for the cells where compasses are generated). "
"North is the first coordinate, while East is the sum of other coordinates.",
"Krainy w tej geometrii są zwykle budowane na osi Północ-Południe lub Wschód-Zachód. "
"Kompasy zawsze wskazują Północ, i wszystkie główne kierunki na prawo od Północy kompasu są zachodnie "
"(to nie jest zawsze prawda, ale jest to prawda na polach z kompasami). "
"Północ jest pierwszą współrzędną, a Wschód jest sumą pozostałych.")
S("crystal coordinate colors", "kolory współrzędnych kryształu")
S("3D monsters/walls on the surface", "potwory/ściany 3D na powierzchni")
S("no 3D effects available in this projection", "ta projekcja nie ma efektów 3D")
// new screenshot menu
S("screenshots", "zrzuty ekranu")
S("format", "format")
S("pixels (X)", "piksele (X)")
S("pixels (Y)", "piksele (Y)")
S("supersampling", "supersampling")
S("transparent", "przezroczysość")
S("gamma", "współczynnik gamma")
S("higher value = darker", "wyższa wartość = ciemniej")
S("brightness", "jasność")
S("higher value = lighter", "wyższa wartość = jaśniej")
S("show the HUD", "pokazuj HUD")
S("SVG screenshots do not work in this 3D mode", "zrzuty ekranu w formacie SVG nie działają w tym trybie 3D")
S("SVG screenshots do not work with textures", "zrzuty ekranu w formacie SVG nie działają z teksturami")
S("take screenshot", "zrób zrzut ekranu")
S("screenshot", "zrzut ekranu")
S("shot settings", "ustawienia zrzutów ekranu")
// new warnings
S("WARNING", "UWAGA")
S("YES", "TAK")
S("NO", "NIE")
S("Are you sure you want to hit %the1?", "Czy na pewno chcesz uderzyć %a1?")
S("This will exit HyperRogue without saving your current game. Are you sure?",
"To spowoduje wyjście z HyperRogue bez zapisania Twojej obecnej gry. Czy na pewno?")
S("This will end your current game and start a new one. Are you sure?",
"To zakończy Twoją obecną grę i zacznie nową. Czy na pewno?")
S("This will enable the cheat mode, making this game ineligible for scoring. Are you sure?",
"To uruchomi tryb oszusta. Wyniki przestaną się liczyć. Czy na pewno?")

View File

@ -254,22 +254,23 @@ void showMainMenu() {
else if(uni == 'g') pushScreen(showGraphConfig);
else if(uni == 'd') pushScreen(showDisplayMode);
else if(uni == 'm') pushScreen(showChangeMode);
else if(uni == 'R')
else if(uni == 'R') dialog::do_if_confirmed([] {
popScreenAll(), pushScreen(showStartMenu);
});
#if CAP_SAVE
else if(uni == 't') scores::load();
#endif
else if(uni == 'r' || sym == SDLK_F5) {
else if(uni == 'r' || sym == SDLK_F5) dialog::do_if_confirmed([] {
restart_game();
}
else if(uni == 'q' || sym == SDLK_F10) {
});
else if(uni == 'q' || sym == SDLK_F10) dialog::do_if_confirmed([] {
#if ISMOBILE
extern void openURL();
openURL();
#else
quitmainloop = true;
#endif
}
});
else if(uni == 'o') {
clearMessages();
get_o_key().second();
@ -413,14 +414,14 @@ void enable_cheat() {
else if(daily::on) {
addMessage(XLAT("Not available in the daily challenge!"));
}
else if(!cheater) {
else if(!cheater) dialog::cheat_if_confirmed([] {
cheater++;
addMessage(XLAT("You activate your demonic powers!"));
#if ISMOBILE==0
addMessage(XLAT("Shift+F, Shift+O, Shift+T, Shift+L, Shift+U, etc."));
#endif
popScreen();
}
});
else {
popScreen();
firstland = princess::challenge ? laPalace : laIce;
@ -523,35 +524,38 @@ void showChangeMode() {
}
else if(xuni == 'p')
pushScreen(peace::showMenu);
else if(xuni == 'i') {
else if(xuni == 'i') dialog::do_if_confirmed([] {
restart_game(rg::inv);
}
});
#if CAP_TOUR
else if(uni == 'T') {
else if(uni == 'T') dialog::do_if_confirmed([] {
tour::start();
}
});
#endif
else if(uni == 'C') {
chaosUnlocked = chaosUnlocked || autocheat;
if(chaosUnlocked) restart_game(rg::chaos);
if(chaosUnlocked) dialog::do_if_confirmed([] { restart_game(rg::chaos); });
if(!chaosUnlocked) help_nochaos();
}
else if(xuni == 'P') {
if(!princess::everSaved)
addMessage(XLAT("Save %the1 first to unlock this challenge!", moPrincess));
else
restart_game(rg::princess);
dialog::do_if_confirmed([] { restart_game(rg::princess); });
}
#if CAP_EDIT
else if(xuni == 'm') {
if(tactic::on)
addMessage(XLAT("Not available in the pure tactics mode!"));
else {
else if(daily::on) {
addMessage(XLAT("Not available in the daily challenge!"));
}
else dialog::cheat_if_confirmed([] {
cheater++;
pushScreen(mapeditor::showMapEditor);
lastexplore = turncount;
addMessage(XLAT("You activate your terraforming powers!"));
}
});
}
#endif
else if(xuni == 's') {
@ -564,8 +568,11 @@ void showChangeMode() {
else if(xuni == 'h' && !shmup::on)
switchHardcore();
else if(xuni == 'r') {
firstland = laIce;
restart_game(rg::randpattern);
dialog::do_if_confirmed([] {
stop_game();
firstland = laIce;
restart_game(rg::randpattern);
});
}
else if(doexiton(sym, uni))
popScreen();

View File

@ -5,8 +5,12 @@ namespace hr {
bool quitsaves() { return (items[itOrbSafety] && havesave && !archimedean); }
bool needConfirmationEvenIfSaved() {
return canmove && (gold() >= 30 || tkills() >= 50) && !cheater;
}
bool needConfirmation() {
return canmove && (gold() >= 30 || tkills() >= 50) && !cheater && !quitsaves();
return needConfirmationEvenIfSaved() && !quitsaves();
}
int getgametime() {
@ -458,11 +462,20 @@ void handleKeyQuit(int sym, int uni) {
sym = 0;
#endif
if(sym == SDLK_RETURN || sym == SDLK_KP_ENTER || sym == SDLK_F10) quitmainloop = true;
else if(uni == 'r' || sym == SDLK_F5) {
if(sym == SDLK_RETURN || sym == SDLK_KP_ENTER || sym == SDLK_F10) {
if(needConfirmation()) pushScreen([] {
dialog::confirm_dialog(
XLAT("This will exit HyperRogue without saving your current game. Are you sure?"),
[] {
quitmainloop = true;
});
});
else quitmainloop = true;
}
else if(uni == 'r' || sym == SDLK_F5) dialog::do_if_confirmed([] {
restart_game(rg::nothing);
msgs.clear();
}
});
else if(uni == 'v') popScreenAll(), pushScreen(showMainMenu);
else if(uni == 'l') popScreenAll(), pushScreen(showMessageLog), messagelogpos = isize(gamelog);
else if(uni == 'z') hints[hinttoshow].action();

View File

@ -423,12 +423,12 @@ void menu() {
#if CAP_RUG
if(make_svg && rug::rugged)
dialog::addInfo("SVG screenshot do not work in this 3D mode", 0xFF0000);
dialog::addInfo("SVG screenshots do not work in this 3D mode", 0xFF0000);
else
#endif
#if CAP_TEXTURE
if(make_svg && texture::config.tstate == texture::tsActive)
dialog::addInfo("SVG screenshot do not work with textures", 0xFF0000);
dialog::addInfo("SVG screenshots do not work with textures", 0xFF0000);
else
#endif
dialog::addBreak(100);

View File

@ -485,17 +485,21 @@ struct shmup_configurer {
}
else if(doexiton(sym, uni)) {
popScreen();
if(shmup::on != shmupcfg) {
stop_game();
switch_game_mode(rg::shmup);
resetScores();
}
if(playercfg != players) {
stop_game();
players = playercfg;
resetScores();
}
start_game();
auto sc = shmupcfg;
auto pc = playercfg;
if(shmup::on != sc || pc != players) dialog::do_if_confirmed([sc, pc] {
if(shmup::on != sc) {
stop_game();
switch_game_mode(rg::shmup);
resetScores();
}
if(pc != players) {
stop_game();
players = pc;
resetScores();
}
start_game();
});
}
#endif
}

View File

@ -557,10 +557,10 @@ namespace yendor {
dialog::handleNavigation(sym, uni);
int new_challenge = char_to_yendor(uni);
if(new_challenge && new_challenge < YENDORLEVELS) {
if(levelUnlocked(new_challenge) || autocheat) {
if(levelUnlocked(new_challenge) || autocheat) dialog::do_if_confirmed([new_challenge] {
challenge = new_challenge;
restart_game(yendor::on ? rg::nothing : rg::yendor);
}
});
else
addMessage("Collect 10 treasures in various lands to unlock the challenges there");
}
@ -800,11 +800,11 @@ namespace tactic {
}
keyhandler = [] (int sym, int uni) {
if(uni >= 1000 && uni < 1000 + isize(landlist)) {
if(uni >= 1000 && uni < 1000 + isize(landlist)) dialog::do_if_confirmed([uni] {
stop_game();
specialland = landlist[uni - 1000];
restart_game(tactic::on ? rg::nothing : rg::tactic);
}
});
else if(uni == '0') {
if(tactic::on) {
stop_game();
@ -1119,11 +1119,11 @@ namespace peace {
dialog::handleNavigation(sym, uni);
if(uni == '1') otherpuzzles = !otherpuzzles;
else if(uni >= 'a' && uni < 'a' + qty) {
else if(uni >= 'a' && uni < 'a' + qty) dialog::do_if_confirmed([uni] {
stop_game();
specialland = levellist[uni - 'a'];
restart_game(peace::on ? 0 : rg::peace);
}
});
else if(uni == '2') { hint = !hint; popScreen(); }
else if(uni == '0') {
firstland = laIce;