1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-27 20:07:40 +00:00

more OOP-style standard dialogs

This commit is contained in:
Zeno Rogue
2023-08-09 14:01:24 +02:00
parent 4d4874f7ac
commit b6f13b953b
23 changed files with 306 additions and 249 deletions

View File

@@ -873,7 +873,7 @@ void show_gridmaker() {
dialog::addSelItem(XLAT("density"), fts(density), 'd');
dialog::add_action([] {
dialog::editNumber(density, 1, 10, .1, 4, XLAT("density"), XLAT(irrhelp));
dialog::reaction = [] () {
dialog::get_di().reaction = [] () {
int s = cellcount;
if(density < 1) density = 1;
cellcount = int(isize(currentmap->allcells()) * density + .5);
@@ -888,7 +888,7 @@ void show_gridmaker() {
"The smallest allowed ratio of edge length to median edge length. "
"Tilings with low values are easier to generate, but tend to be more ugly."
));
dialog::reaction = [] () {
dialog::get_di().reaction = [] () {
println(hlog, "quality = ", density);
if(runlevel > 4) runlevel = 4;
};
@@ -931,7 +931,7 @@ void show_gridmaker() {
dialog::add_action([] () {
dialog::editNumber(bitruncations_requested, 0, 5, 1, 1, XLAT("bitruncation const"),
XLAT("Bitruncation introduces some regularity, allowing more sophisticated floor tilings and textures."));
dialog::reaction = [] () {
dialog::get_di().reaction = [] () {
if(bitruncations_requested > bitruncations_performed && runlevel > 5) runlevel = 5;
if(bitruncations_requested < bitruncations_performed) runlevel = 0;
};