Consistently use "space" for the "pop this menu" option in all submenus.

The "pop this menu" option's *text* is still highly variable among all
the different menus, which could make it hard to navigate, but at least
if you're using the keyboard it's now easy to "go back".

Plus, the rogueviz menu incorrectly reported "(v) exit menu" when actually
`v` was already in use by an earlier option. This is now fixed.
This commit is contained in:
Arthur O'Dwyer 2017-10-29 12:04:27 -07:00
parent d3fd02f896
commit dae6b9e3d3
12 changed files with 26 additions and 23 deletions

View File

@ -527,7 +527,7 @@ void loadConfig() {
void showAllConfig() {
dialog::addBreak(50);
dialog::addItem(XLAT("exit configuration"), 'v');
dialog::addItem(XLAT("exit configuration"), ' ');
#if CAP_CONFIG
dialog::addItem(XLAT("save the current config"), 's');
if(getcstat == 's')
@ -538,7 +538,7 @@ void showAllConfig() {
void handleAllConfig(int sym, int uni) {
if(sym == SDLK_F1 || uni == 'h') gotoHelp(help);
else if(uni == 'v') popScreen();
else if(uni == ' ') popScreen();
else if(sym == SDLK_ESCAPE) popScreen();
#if CAP_CONFIG
else if(uni == 's') saveConfig();
@ -624,6 +624,8 @@ void showGraphConfig() {
char xuni = uni | 96;
if(uni >= 32 && uni < 64) xuni = uni;
if(xuni == 'u') vid.particles = !vid.particles;
if(xuni == 'd') vid.graphglyph = (1+vid.graphglyph)%3;
@ -849,12 +851,12 @@ void showJoyConfig() {
dialog::addSelItem(XLAT("second joystick: pan threshold"), its(vid.joypanthreshold), 'c');
dialog::addSelItem(XLAT("second joystick: panning speed"), fts(vid.joypanspeed * 1000), 'd');
dialog::addItem(XLAT("back"), 'v');
dialog::addItem(XLAT("back"), ' ');
dialog::display();
keyhandler = [] (int sym, int uni) {
dialog::handleNavigation(sym, uni);
char xuni = uni | 96;
char xuni = uni | 32;
if(xuni == 'p') autojoy = !autojoy;
else if(xuni == 'a')
dialog::editNumber(vid.joyvalue, 0, 32768, 100, 4800, XLAT("first joystick: movement threshold"), "");
@ -1003,7 +1005,7 @@ void show3D() {
else
dialog::addInfo(XLAT("parameters set correctly"));
dialog::addBreak(50);
dialog::addItem(XLAT("exit 3D configuration"), 'v');
dialog::addItem(XLAT("exit 3D configuration"), ' ');
dialog::display();
keyhandler = [] (int sym, int uni) {
@ -1104,7 +1106,7 @@ void showCustomizeChar() {
if(numplayers() > 1) dialog::addSelItem(XLAT("player"), its(shmup::cpid+1), 'a');
dialog::addBreak(50);
dialog::addItem(XLAT("return to the game"), 'v');
dialog::addItem(XLAT("return to the game"), ' ');
dialog::display();
int firsty = dialog::items[0].position / 2;
@ -1119,7 +1121,7 @@ void showCustomizeChar() {
keyhandler = [] (int sym, int uni) {
dialog::handleNavigation(sym, uni);
char xuni = uni | 96;
char xuni = uni | 32;
if(shmup::on || multi::players) shmup::cpid = shmup::cpid_edit % shmup::players;
charstyle& cs = getcs();
@ -1137,7 +1139,7 @@ void showCustomizeChar() {
if(xuni == 'd') switchcolor(cs.dresscolor, cat ? haircolors : dresscolors);
if(xuni == 'f') switchcolor(cs.dresscolor2, dresscolors2);
if(xuni == 'u') switchcolor(cs.uicolor, eyecolors);
if(xuni == 'v' || sym == SDLK_ESCAPE) popScreen();
if(uni == ' ' || sym == SDLK_ESCAPE) popScreen();
};
}
@ -1189,7 +1191,7 @@ void selectLanguageScreen() {
dialog::addBreak(50);
vid.language = -1;
dialog::addBoolItem(XLAT("default") + ": " + XLAT("EN"), v == -1, '0');
dialog::addItem(XLAT("exit configuration"), '1');
dialog::addItem(XLAT("exit configuration"), ' ');
dialog::addBreak(50);
@ -1216,7 +1218,7 @@ void selectLanguageScreen() {
keyhandler = [] (int sym, int uni) {
dialog::handleNavigation(sym, uni);
char xuni = uni | 96;
char xuni = uni | 32;
if(uni == '0') {
vid.language = -1;
ANDROID_SETTINGS;

View File

@ -591,7 +591,7 @@ namespace conformal {
}
#endif
dialog::addItem(XLAT("exit this menu"), 'q');
dialog::addItem(XLAT("exit this menu"), ' ');
dialog::display();
mouseovers = XLAT("see http://www.roguetemple.com/z/hyper/conformal.php");
keyhandler = handleKeyC;

View File

@ -769,7 +769,7 @@ namespace dialog {
getcstat = '2';
if(pages) if(displayfrZ(xr*40, i0, 1, vid.fsize, IFM("3 - ") + XLAT("all"), nlpage == 1 ? 0xD8D8C0 : 0xC0C0C0, 8))
getcstat = '3';
if(i&1) if(displayfrZ(xr*56, i0, 1, vid.fsize, IFM("0 - ") + XLAT("return"), 0xC0C0C0, 8))
if(i&1) if(displayfrZ(xr*56, i0, 1, vid.fsize, IFM(keyname(' ') + " - ") + XLAT("return"), 0xC0C0C0, 8))
getcstat = '0';
if(i&2) if(displayfrZ(xr*72, i0, 1, vid.fsize, IFM("F1 - ") + XLAT("help"), 0xC0C0C0, 8))
getcstat = SDLK_F1;

View File

@ -820,6 +820,8 @@ namespace dialog {
item& lastItem();
extern unsigned int *palette;
string keyname(int k);
void addSelItem(string body, string value, int key);
void addBoolItem(string body, bool value, int key);

View File

@ -2247,7 +2247,7 @@ lessalphaif(col, behindsphere(V), behindsphere(gmatrix[c2]))
dialog::addColorItem(XLAT(patterns[numpat].lpname), patterns[numpat].color, 'a'+numpat);
dialog::addBreak(50);
dialog::addItem(XLAT("exit menu"), 'v');
dialog::addItem(XLAT("exit menu"), ' ');
dialog::addBreak(50);
dialog::addInfo("change the alpha parameter to show the lines");

View File

@ -448,14 +448,14 @@ void showChangeMode() {
dialog::addBreak(50);
dialog::addItem(XLAT("return to the game"), 'v');
dialog::addItem(XLAT("return to the game"), ' ');
dialog::display();
keyhandler = [] (int sym, int uni) {
dialog::handleNavigation(sym, uni);
char xuni = uni;
if(xuni == 'v' || sym == SDLK_ESCAPE) popScreen();
if(xuni == ' ' || sym == SDLK_ESCAPE) popScreen();
else if(uni == 'c') {
if(tactic::on && gold()) {
@ -773,4 +773,3 @@ void setAppropriateOverview() {
pushScreen(showOverview);
}
}

View File

@ -656,7 +656,7 @@ namespace netgen {
dialog::addItem(XLAT("synchronize net and map"), 's');
dialog::addItem(XLAT("display the scope"), 't');
dialog::addItem(XLAT("create the model"), 'c');
dialog::addItem(XLAT("back to HyperRogue"), 'q');
dialog::addItem(XLAT("back to HyperRogue"), ' ');
dialog::addItem(XLAT("design the net"), 'd');
dialog::display();

View File

@ -1739,7 +1739,7 @@ void showMenu() {
kohonen::showMenu();
dialog::addBreak(50);
dialog::addItem(XLAT("exit menu"), 'v');
dialog::addItem(XLAT("exit menu"), ' ');
dialog::display();

View File

@ -661,7 +661,7 @@ void show() {
dialog::init(XLAT("hypersian rug mode"), iinf[itPalace].color, 150, 100);
dialog::addItem(XLAT("what's this?"), 'h');
dialog::addItem(XLAT("take me back"), 'q');
dialog::addItem(XLAT("take me back"), ' ');
dialog::addItem(XLAT("enable the Hypersian Rug mode"), 'u');
dialog::addBoolItem(XLAT("render the texture only once"), (renderonce), 'o');
dialog::addBoolItem(XLAT("render texture without OpenGL"), (rendernogl), 'g');

View File

@ -238,7 +238,7 @@ void show() {
displayButton(xr*10, i0, IFM("s - ") + XLAT("sort"), 's', 8);
displayButton(xr*30, i0, IFM("t - ") + XLAT("choose"), 't', 8);
displayButton(xr*50, i0, IFM("0 - ") + XLAT("play"), '0', 8);
displayButton(xr*50, i0, IFM(dialog::keyname(' ') + " - ") + XLAT("play"), '0', 8);
keyhandler = [] (int sym, int uni) {
if(sym == SDLK_LEFT || sym == SDLK_KP4 || sym == 'h' || sym == 'a') {

View File

@ -300,7 +300,7 @@ void showShmupConfig() {
dialog::addItem(XLAT("help"), 'h');
dialog::addItem(XLAT("exit configuration"), 'v');
dialog::addItem(XLAT("exit configuration"), ' ');
dialog::display();
}

View File

@ -249,7 +249,7 @@ namespace ss {
}
dialog::addBreak(50);
if(size(slideshows) > 1) dialog::addItem(XLAT("change slideshow"), '1');
dialog::addItem(XLAT("exit menu"), '0');
dialog::addItem(XLAT("exit menu"), ' ');
dialog::display();
keyhandler = [] (int sym, int uni) {
if(uni >= 'a' && uni < 'a' + sssize) {