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

add_action_push consistently; improved some menu hotkeys and ordering; improved some naming

This commit is contained in:
Zeno Rogue 2019-03-30 23:59:51 +01:00
parent 1b73714958
commit 80d14c0196
12 changed files with 34 additions and 35 deletions

View File

@ -1603,7 +1603,7 @@ void refresh_canvas() {
void edit_color_table(colortable& ct, const reaction_t& r = reaction_t()) { void edit_color_table(colortable& ct, const reaction_t& r = reaction_t()) {
cmode = sm::SIDE; cmode = sm::SIDE;
gamescreen(0); gamescreen(0);
dialog::init(XLAT("customize colors and aura")); dialog::init(XLAT("colors & aura"));
for(int i=0; i<isize(ct); i++) { for(int i=0; i<isize(ct); i++) {
dialog::addColorItem(its(i), ct[i] << 8, 'a'+i); dialog::addColorItem(its(i), ct[i] << 8, 'a'+i);
@ -1618,7 +1618,7 @@ void show_color_dialog() {
cmode = sm::SIDE | sm::DIALOG_STRICT_X; cmode = sm::SIDE | sm::DIALOG_STRICT_X;
getcstat = '-'; getcstat = '-';
gamescreen(0); gamescreen(0);
dialog::init(XLAT("customize colors and aura")); dialog::init(XLAT("colors & aura"));
dialog::addColorItem(XLAT("background"), backcolor << 8, 'b'); dialog::addColorItem(XLAT("background"), backcolor << 8, 'b');
dialog::add_action([] () { dialog::openColorDialog(backcolor); dialog::colorAlpha = false; dialog::dialogflags |= sm::SIDE; }); dialog::add_action([] () { dialog::openColorDialog(backcolor); dialog::colorAlpha = false; dialog::dialogflags |= sm::SIDE; });
@ -1650,17 +1650,17 @@ void show_color_dialog() {
dialog::addBreak(50); dialog::addBreak(50);
if(specialland == laCanvas && colortables.count(patterns::whichCanvas)) { if(specialland == laCanvas && colortables.count(patterns::whichCanvas)) {
dialog::addItem(XLAT("pattern colors"), 'P'); dialog::addItem(XLAT("pattern colors"), 'P');
dialog::add_action([] () { pushScreen([] () { edit_color_table(colortables[patterns::whichCanvas], refresh_canvas); });}); dialog::add_action_push([] { edit_color_table(colortables[patterns::whichCanvas], refresh_canvas); });
} }
if(cwt.at->land == laMinefield) { if(cwt.at->land == laMinefield) {
dialog::addItem(XLAT("minefield colors"), 'm'); dialog::addItem(XLAT("minefield colors"), 'm');
dialog::add_action([] () { pushScreen([] () { edit_color_table(minecolors); });}); dialog::add_action_push([] { edit_color_table(minecolors); });
} }
if(viewdists) { if(viewdists) {
dialog::addItem(XLAT("distance colors"), 'd'); dialog::addItem(XLAT("distance colors"), 'd');
dialog::add_action([] () { pushScreen([] () { edit_color_table(distcolors); });}); dialog::add_action_push([] () {edit_color_table(distcolors); });
} }
#if CAP_CRYSTAL #if CAP_CRYSTAL
@ -1836,7 +1836,7 @@ void configureMouse() {
#if CAP_ORIENTATION #if CAP_ORIENTATION
dialog::addSelItem(XLAT("scrolling by device rotation"), ors::choices[ors::mode], '1'); dialog::addSelItem(XLAT("scrolling by device rotation"), ors::choices[ors::mode], '1');
dialog::add_action([] { pushScreen(ors::show); }); dialog::add_action_push(ors::show);
#endif #endif
dialog::display(); dialog::display();
@ -1852,18 +1852,18 @@ void showSettings() {
dialog::addItem(XLAT("general graphics"), 'g'); dialog::addItem(XLAT("general graphics"), 'g');
dialog::add_action_push(showGraphConfig); dialog::add_action_push(showGraphConfig);
dialog::addItem(XLAT("colors and aura"), 'c');
dialog::add_action_push(show_color_dialog);
dialog::addItem(XLAT("3D configuration"), '9'); dialog::addItem(XLAT("3D configuration"), '9');
dialog::add_action_push(show3D); dialog::add_action_push(show3D);
dialog::addItem(XLAT("quick options"), 'q'); dialog::addItem(XLAT("quick options"), 'q');
dialog::add_action_push(showGraphQuickKeys); dialog::add_action_push(showGraphQuickKeys);
dialog::addItem(XLAT("models & projections"), 'a'); dialog::addItem(XLAT("models & projections"), 'p');
dialog::add_action_push(conformal::model_menu); dialog::add_action_push(conformal::model_menu);
dialog::addItem(XLAT("colors & aura"), 'c');
dialog::add_action_push(show_color_dialog);
#if CAP_SHMUP #if CAP_SHMUP
if(CAP_SHMUP && !ISMOBILE) { if(CAP_SHMUP && !ISMOBILE) {
dialog::addSelItem(XLAT("keyboard & joysticks"), "", 'k'); dialog::addSelItem(XLAT("keyboard & joysticks"), "", 'k');

View File

@ -1076,7 +1076,7 @@ void show() {
dialog::addBreak(100); dialog::addBreak(100);
dialog::addItem(XLAT("stereo vision config"), 'e'); dialog::addItem(XLAT("stereo vision config"), 'e');
dialog::add_action([] () { pushScreen(showStereo); }); dialog::add_action_push(showStereo);
dialog::addItem(XLAT("experiment with geometry"), 'g'); dialog::addItem(XLAT("experiment with geometry"), 'g');
dialog::add_action([] () { runGeometryExperiments(); }); dialog::add_action([] () { runGeometryExperiments(); });

View File

@ -1218,7 +1218,7 @@ void show() {
}); });
if(geometry == gCrystal) { if(geometry == gCrystal) {
dialog::addBoolItem(XLAT("3D display"), rug::rugged, 'r'); dialog::addBoolItem(XLAT("3D display"), rug::rugged, 'r');
dialog::add_action([]() { pushScreen(rug::show); }); dialog::add_action_push(rug::show);
} }
else else
dialog::addBreak(100); dialog::addBreak(100);

View File

@ -474,7 +474,7 @@ void showEuclideanMenu() {
dialog::init(XLAT("experiment with geometry")); dialog::init(XLAT("experiment with geometry"));
dialog::addSelItem(XLAT("basic tiling"), XLAT(ginf[geometry].tiling_name), 't'); dialog::addSelItem(XLAT("basic tiling"), XLAT(ginf[geometry].tiling_name), 't');
dialog::add_action([] { pushScreen([] { ge_select_tiling(tilinglist); }); }); dialog::add_action_push([] { ge_select_tiling(tilinglist); });
int ts = ginf[geometry].sides; int ts = ginf[geometry].sides;
int tv = ginf[geometry].vertex; int tv = ginf[geometry].vertex;
@ -600,10 +600,10 @@ void showEuclideanMenu() {
else else
dialog::addSelItem(XLAT("quotient space"), XLAT(qstring), 'q'); dialog::addSelItem(XLAT("quotient space"), XLAT(qstring), 'q');
dialog::add_action([] { pushScreen([] { ge_select_tiling(quotientlist); }); }); dialog::add_action_push([] { ge_select_tiling(quotientlist); });
dialog::addSelItem(XLAT("dimension"), its(DIM), 'd'); dialog::addSelItem(XLAT("dimension"), its(DIM), 'd');
dialog::add_action([] { pushScreen([] { ge_select_tiling(list3d); }); }); dialog::add_action_push([] { ge_select_tiling(list3d); });
#if CAP_IRR #if CAP_IRR
if(hyperbolic && IRREGULAR) { if(hyperbolic && IRREGULAR) {
@ -675,17 +675,17 @@ void showEuclideanMenu() {
dialog::addBreak(50); dialog::addBreak(50);
dialog::addSelItem(XLAT("land"), XLAT1(linf[specialland].name), 'l'); dialog::addSelItem(XLAT("land"), XLAT1(linf[specialland].name), 'l');
dialog::add_action([] { pushScreen(ge_land_selection); }); dialog::add_action_push(ge_land_selection);
dialog::addBoolItem(XLAT("pattern"), specialland == laCanvas, 'p'); dialog::addBoolItem(XLAT("pattern"), specialland == laCanvas, 'p');
if(specialland == laCanvas) dialog::lastItem().value = patterns::whichCanvas; if(specialland == laCanvas) dialog::lastItem().value = patterns::whichCanvas;
dialog::add_action([] { pushScreen(patterns::showPrePattern); }); dialog::add_action_push(patterns::showPrePattern);
validity_info(); validity_info();
if(DIM == 3) { if(DIM == 3) {
dialog::addItem(XLAT("3D configuration"), '9'); dialog::addItem(XLAT("3D configuration"), '9');
dialog::add_action([] { pushScreen(show3D); }); dialog::add_action_push(show3D);
} }
dialog::addSelItem(XLAT("projection"), current_proj_name(), '1'); dialog::addSelItem(XLAT("projection"), current_proj_name(), '1');
dialog::add_action([] { pushScreen(conformal::model_menu); }); dialog::add_action_push(conformal::model_menu);
#if CAP_CRYSTAL && MAXMDIM >= 4 #if CAP_CRYSTAL && MAXMDIM >= 4
crystal::add_crystal_transform('x'); crystal::add_crystal_transform('x');
#endif #endif
@ -694,7 +694,7 @@ void showEuclideanMenu() {
#if CAP_SHOT #if CAP_SHOT
dialog::addItem(XLAT("take picture"), 's'); dialog::addItem(XLAT("take picture"), 's');
dialog::add_action([] { pushScreen(shot::menu); }); dialog::add_action_push(shot::menu);
#endif #endif
dialog::addHelp(); dialog::addHelp();

View File

@ -1950,7 +1950,6 @@ namespace dialog {
void add_key_action(int key, const reaction_t& action); void add_key_action(int key, const reaction_t& action);
void add_action_push(const reaction_t& action); void add_action_push(const reaction_t& action);
inline void add_action_push(void a()) { add_action_push((reaction_t) a); }
string view_edited_string(); string view_edited_string();
void start_editing(string& s); void start_editing(string& s);

View File

@ -7499,7 +7499,7 @@ S(
// color edit dialog // color edit dialog
S("customize colors and aura", "uprav barvy a auru") S("colors & aura", "uprav barvy a auru")
S("background", "pozadí") S("background", "pozadí")
S("foreground", "popøedí") S("foreground", "popøedí")

View File

@ -7252,7 +7252,7 @@ S(
// color edit dialog // color edit dialog
S("customize colors and aura", "dostosuj kolory i aurę") S("colors & aura", "dostosuj kolory i aurę")
S("background", "tło") S("background", "tło")
S("foreground", "pierwszy plan") S("foreground", "pierwszy plan")

View File

@ -2109,7 +2109,7 @@ namespace mapeditor {
dialog::addInfo(XLAT("(unlock all, allow cheats, normal character display, cannot be turned off!)")); dialog::addInfo(XLAT("(unlock all, allow cheats, normal character display, cannot be turned off!)"));
dialog::addItem(XLAT("change the pattern/color of new Canvas cells"), 'c'); dialog::addItem(XLAT("change the pattern/color of new Canvas cells"), 'c');
dialog::add_action([] () { pushScreen(patterns::showPrePatternNoninstant); }); dialog::add_action_push(patterns::showPrePatternNoninstant);
dialog::addBack(); dialog::addBack();
dialog::display(); dialog::display();

View File

@ -205,7 +205,7 @@ void showMainMenu() {
dialog::init(XLAT("HyperRogue %1", VER), 0xC00000, 200, 100); dialog::init(XLAT("HyperRogue %1", VER), 0xC00000, 200, 100);
dialog::addItem(XLAT("settings"), 's'); dialog::addItem(XLAT("settings"), 's');
dialog::add_action([] { pushScreen(showSettings); }); dialog::add_action_push(showSettings);
dialog::addItem(XLAT("special modes"), 'm'); dialog::addItem(XLAT("special modes"), 'm');
#if CAP_SAVE #if CAP_SAVE
@ -448,9 +448,9 @@ void showCreative() {
#endif #endif
dialog::addItem(XLAT("screenshots"), 's'); dialog::addItem(XLAT("screenshots"), 's');
dialog::add_action([] () { pushScreen(shot::menu); }); dialog::add_action_push(shot::menu);
dialog::addBoolItem(XLAT("animations/history"), anims::any_on(), 'A'); dialog::addBoolItem(XLAT("animations/history"), anims::any_on(), 'a');
dialog::add_action_push(anims::show); dialog::add_action_push(anims::show);
#if CAP_TEXTURE #if CAP_TEXTURE

View File

@ -1009,7 +1009,7 @@ void race_projection() {
dialog::addBreak(100); dialog::addBreak(100);
dialog::addItem(XLAT("configure the projection"), 'p'); dialog::addItem(XLAT("configure the projection"), 'p');
dialog::add_action([] () { pushScreen(race_projection); }); dialog::add_action_push(race_projection);
dialog::addBoolItem(XLAT("guiding line"), guiding, 'g'); dialog::addBoolItem(XLAT("guiding line"), guiding, 'g');
dialog::add_action([] () { guiding = !guiding; }); dialog::add_action([] () { guiding = !guiding; });

View File

@ -1888,7 +1888,7 @@ void showMenu() {
dialog::addSelItem(XLAT("vertex shape"), its(vertex_shape), 'w'); dialog::addSelItem(XLAT("vertex shape"), its(vertex_shape), 'w');
dialog::addItem(XLAT("vertex search"), '/'); dialog::addItem(XLAT("vertex search"), '/');
dialog::add_action([] () { pushScreen(showVertexSearch); }); dialog::add_action_push(showVertexSearch);
if(kind == kKohonen) if(kind == kKohonen)
kohonen::showMenu(); kohonen::showMenu();
@ -2258,7 +2258,7 @@ auto hooks =
addHook(hooks_o_key, 100, o_key) + addHook(hooks_o_key, 100, o_key) +
addHook(hooks_mainmenu, 100, [] () { addHook(hooks_mainmenu, 100, [] () {
dialog::addItem(XLAT("rogueviz menu"), 'u'); dialog::addItem(XLAT("rogueviz menu"), 'u');
dialog::add_action([] () { pushScreen(rogueviz::showMenu); }); dialog::add_action_push(rogueviz::showMenu);
}) + }) +
addHook(hooks_welcome_message, 100, [] () { addHook(hooks_welcome_message, 100, [] () {
if(rogueviz::on) addMessage(XLAT("Welcome to RogueViz!")); if(rogueviz::on) addMessage(XLAT("Welcome to RogueViz!"));

View File

@ -429,8 +429,8 @@ void menu() {
dialog::addBoolItem(XLAT("hide the player"), !mapeditor::drawplayer, 'H'); dialog::addBoolItem(XLAT("hide the player"), !mapeditor::drawplayer, 'H');
dialog::add_action([] { mapeditor::drawplayer = !mapeditor::drawplayer; }); dialog::add_action([] { mapeditor::drawplayer = !mapeditor::drawplayer; });
dialog::addItem(XLAT("customize colors and aura"), 'c'); dialog::addItem(XLAT("colors & aura"), 'c');
dialog::add_action([] { pushScreen(show_color_dialog); }); dialog::add_action_push(show_color_dialog);
menuitem_sightrange('r'); menuitem_sightrange('r');
@ -941,11 +941,11 @@ void show() {
}); });
dialog::addBoolItem(XLAT("history mode"), (conformal::on || conformal::includeHistory), 'h'); dialog::addBoolItem(XLAT("history mode"), (conformal::on || conformal::includeHistory), 'h');
dialog::add_action([] () { pushScreen(conformal::history_menu); }); dialog::add_action_push(conformal::history_menu);
#if CAP_FILES && CAP_SHOT #if CAP_FILES && CAP_SHOT
dialog::addItem(XLAT("shot settings"), 's'); dialog::addItem(XLAT("shot settings"), 's');
dialog::add_action([] () { pushScreen(shot::menu); }); dialog::add_action_push(shot::menu);
if(needs_highqual) if(needs_highqual)
dialog::addInfo(XLAT("some parameters will only change in recorded animation")); dialog::addInfo(XLAT("some parameters will only change in recorded animation"));