mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 21:07:17 +00:00
list_setting::show_edit_option for very large lists
This commit is contained in:
parent
735db2bcc4
commit
9b91d46f47
16
config.cpp
16
config.cpp
@ -3100,16 +3100,26 @@ void list_setting::show_edit_option(int key) {
|
|||||||
dialog::init(XLAT(menu_item_name));
|
dialog::init(XLAT(menu_item_name));
|
||||||
dialog::addBreak(100);
|
dialog::addBreak(100);
|
||||||
int q = isize(options);
|
int q = isize(options);
|
||||||
|
|
||||||
|
int need_list = q > 15 ? 2 : q > 10 ? 1 : 0;
|
||||||
|
|
||||||
|
if(need_list >= 2) dialog::start_list(1500, 1500, 'a');
|
||||||
for(int i=0; i<q; i++) {
|
for(int i=0; i<q; i++) {
|
||||||
dialog::addBoolItem(XLAT(options[i].first), get_value() == i, 'a'+i);
|
dialog::addBoolItem(XLAT(options[i].first), get_value() == i, need_list >= 2 ? dialog::list_fake_key++ : 'a' + i);
|
||||||
dialog::add_action([this, i] { set_value(i); if(reaction) reaction(); popScreen(); });
|
dialog::add_action([this, i, need_list] { set_value(i); if(reaction) reaction(); if(need_list == 0) popScreen(); });
|
||||||
|
if(need_list == 0 && options[i].second != "") {
|
||||||
dialog::addBreak(100);
|
dialog::addBreak(100);
|
||||||
if(options[i].second != "") {
|
|
||||||
dialog::addHelp(XLAT(options[i].second));
|
dialog::addHelp(XLAT(options[i].second));
|
||||||
dialog::addBreak(100);
|
dialog::addBreak(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(need_list >= 2) dialog::end_list();
|
||||||
dialog::addBreak(100);
|
dialog::addBreak(100);
|
||||||
|
|
||||||
|
if(need_list >= 1 && options[get_value()].second != "") {
|
||||||
|
dialog::addHelp(XLAT(options[get_value()].second));
|
||||||
|
dialog::addBreak(100);
|
||||||
|
}
|
||||||
dialog::addBack();
|
dialog::addBack();
|
||||||
dialog::display();
|
dialog::display();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user