1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-12-21 21:28:33 +00:00

editInfix now also has sym argument

This commit is contained in:
Zeno Rogue
2025-12-11 20:48:08 +01:00
parent 5d56c8679f
commit 38e50861a0
8 changed files with 15 additions and 9 deletions

View File

@@ -4227,7 +4227,7 @@ EX void find_parameter() {
keyhandler = [] (int sym, int uni) { keyhandler = [] (int sym, int uni) {
dialog::handleNavigation(sym, uni); dialog::handleNavigation(sym, uni);
if(dialog::editInfix(uni)) dialog::list_skip = 0; if(dialog::editInfix(sym, uni)) dialog::list_skip = 0;
else if(doexiton(sym, uni)) popScreen(); else if(doexiton(sym, uni)) popScreen();
}; };
} }

View File

@@ -1950,11 +1950,17 @@ EX namespace dialog {
} }
} }
EX bool editInfix(int uni) { EX bool editInfix(int sym, int uni) {
if(uni >= 'A' && uni <= 'Z') infix += uni; if(uni >= 'A' && uni <= 'Z') infix += uni;
else if(uni >= 'a' && uni <= 'z') infix += uni-32; else if(uni >= 'a' && uni <= 'z') infix += uni-32;
else if(infix != "" && uni == 8) infix = infix.substr(0, isize(infix)-1); else if(infix != "" && (uni == 8 || is_joy_index(sym, deck::space) || is_joy_index(sym, deck::key_pageup))) infix = infix.substr(0, isize(infix)-1);
else if(infix != "" && uni != 0) infix = ""; else if(infix != "" && uni != 0) infix = "";
else if(is_joy_index(sym, deck::show_keyboard)) {
onscreen_keyboard = !onscreen_keyboard;
}
else if(uni == PSEUDOKEY_ONSCREEN_KEYBOARD) {
infix += keyboard_what;
}
else return false; else return false;
return true; return true;
} }

View File

@@ -235,7 +235,7 @@ EX void ge_land_selection() {
keyhandler = [] (int sym, int uni) { keyhandler = [] (int sym, int uni) {
dialog::handleNavigation(sym, uni); dialog::handleNavigation(sym, uni);
if(dialog::editInfix(uni)) dialog::list_skip = 0; if(dialog::editInfix(sym, uni)) dialog::list_skip = 0;
else if(doexiton(sym, uni)) popScreen(); else if(doexiton(sym, uni)) popScreen();
}; };
} }

View File

@@ -1075,7 +1075,7 @@ EX void customize_land_list() {
keyhandler = [] (int sym, int uni) { keyhandler = [] (int sym, int uni) {
dialog::handleNavigation(sym, uni); dialog::handleNavigation(sym, uni);
if(dialog::editInfix(uni)) dialog::list_skip = 0; if(dialog::editInfix(sym, uni)) dialog::list_skip = 0;
else if(doexiton(sym, uni)) popScreen(); else if(doexiton(sym, uni)) popScreen();
}; };
} }

View File

@@ -2037,7 +2037,7 @@ EX namespace mapeditor {
keyhandler = [] (int sym, int uni) { keyhandler = [] (int sym, int uni) {
dialog::handleNavigation(sym, uni); dialog::handleNavigation(sym, uni);
if(dialog::editInfix(uni)) dialog::list_skip = 0; if(dialog::editInfix(sym, uni)) dialog::list_skip = 0;
else if(doexiton(sym, uni)) popScreen(); else if(doexiton(sym, uni)) popScreen();
}; };
} }

View File

@@ -219,7 +219,7 @@ EX void showOverview() {
"mousewheel to gain or lose treasures and orbs quickly (Ctrl = precise, Shift = reverse)." "mousewheel to gain or lose treasures and orbs quickly (Ctrl = precise, Shift = reverse)."
); );
else if(dialog::handlePageButtons(sym, uni, true, numpages)) ; else if(dialog::handlePageButtons(sym, uni, true, numpages)) ;
else if(dialog::editInfix(uni)) dialog::list_skip = 0; else if(dialog::editInfix(sym, uni)) dialog::list_skip = 0;
else if(doexiton(sym, uni)) popScreen(); else if(doexiton(sym, uni)) popScreen();
}; };
} }

View File

@@ -171,7 +171,7 @@ void showPickScores() {
mouseovers = dialog::infix; mouseovers = dialog::infix;
keyhandler = [] (int sym, int uni) { keyhandler = [] (int sym, int uni) {
dialog::handleNavigation(sym, uni); dialog::handleNavigation(sym, uni);
if(dialog::editInfix(uni)) dialog::list_skip = 0; if(dialog::editInfix(sym, uni)) dialog::list_skip = 0;
else if(doexiton(sym, uni)) popScreen(); else if(doexiton(sym, uni)) popScreen();
}; };
} }

View File

@@ -976,7 +976,7 @@ EX namespace tactic {
"Good luck, and have fun!" "Good luck, and have fun!"
); );
else if(dialog::infix == "" && dialog::handlePageButtons(sym, uni, true, numpages)) ; else if(dialog::infix == "" && dialog::handlePageButtons(sym, uni, true, numpages)) ;
else if(dialog::editInfix(uni)) dialog::list_skip = 0; else if(dialog::editInfix(sym, uni)) dialog::list_skip = 0;
else if(doexiton(sym, uni)) popScreen(); else if(doexiton(sym, uni)) popScreen();
}; };
} }