mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-08-31 01:37:57 +00:00
dialog:: improvements to list dialogs
This commit is contained in:
22
geom-exp.cpp
22
geom-exp.cpp
@@ -187,17 +187,17 @@ EX void ge_land_selection() {
|
||||
});
|
||||
stable_sort(landlist.begin(), landlist.end(), [] (eLand l1, eLand l2) { return land_validity(l1).quality_level > land_validity(l2).quality_level; });
|
||||
|
||||
for(int i=0; i<euperpage; i++) {
|
||||
if(euperpage * eupage + i >= isize(landlist)) { dialog::addBreak(100); break; }
|
||||
eLand l = landlist[euperpage * eupage + i];
|
||||
char ch = '1'+i;
|
||||
dialog::start_list(900, 900, '1');
|
||||
|
||||
for(auto& l: landlist) {
|
||||
|
||||
string s = XLAT1(linf[l].name);
|
||||
|
||||
if(landvisited[l]) {
|
||||
dialog::addBoolItem(s, l == specialland, ch);
|
||||
dialog::addBoolItem(s, l == specialland, dialog::list_fake_key++);
|
||||
}
|
||||
else {
|
||||
dialog::addSelItem(s, XLAT("(locked)"), ch);
|
||||
dialog::addSelItem(s, XLAT("(locked)"), dialog::list_fake_key++);
|
||||
}
|
||||
|
||||
dialog::lastItem().color = linf[l].color;
|
||||
@@ -217,13 +217,13 @@ EX void ge_land_selection() {
|
||||
}));
|
||||
});
|
||||
}
|
||||
dialog::addItem(XLAT("next page"), '-');
|
||||
dialog::addInfo(XLAT("press letters to search"));
|
||||
dialog::end_list();
|
||||
|
||||
dialog::addBreak(25);
|
||||
validity_info();
|
||||
dialog::addBreak(25);
|
||||
|
||||
dialog::addInfo(XLAT("press letters to search"));
|
||||
dual::add_choice();
|
||||
dialog::addBack();
|
||||
dialog::display();
|
||||
@@ -231,11 +231,7 @@ EX void ge_land_selection() {
|
||||
keyhandler = [] (int sym, int uni) {
|
||||
dialog::handleNavigation(sym, uni);
|
||||
|
||||
if(uni == '-' || uni == PSEUDOKEY_WHEELUP || uni == PSEUDOKEY_WHEELDOWN) {
|
||||
eupage++;
|
||||
if(eupage * euperpage >= isize(landlist)) eupage = 0;
|
||||
}
|
||||
else if(dialog::editInfix(uni)) eupage = 0;
|
||||
if(dialog::editInfix(uni)) dialog::list_skip = 0;
|
||||
else if(doexiton(sym, uni)) popScreen();
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user