1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-30 15:39:54 +00:00

dialog:: made editNumber return number_dialog

This commit is contained in:
Zeno Rogue 2023-08-15 10:54:36 +02:00
parent 1b76ab495e
commit 53324a9eeb

View File

@ -1524,7 +1524,7 @@ EX namespace dialog {
extra_options = reaction_t(); extra_options = reaction_t();
} }
EX void editNumber(ld& x, ld vmin, ld vmax, ld step, ld dft, string title, string help) { EX number_dialog& editNumber(ld& x, ld vmin, ld vmax, ld step, ld dft, string title, string help) {
number_dialog ne; number_dialog ne;
ne.editwhat = &x; ne.editwhat = &x;
ne.vmin = vmin; ne.vmin = vmin;
@ -1541,14 +1541,15 @@ EX namespace dialog {
#endif #endif
ne.reset_str(); ne.reset_str();
pushScreen(ne); pushScreen(ne);
return get_ne();
} }
EX void editNumber(int& x, int vmin, int vmax, ld step, int dft, string title, string help) { EX number_dialog& editNumber(int& x, int vmin, int vmax, ld step, int dft, string title, string help) {
ld tmp; ld tmp;
editNumber(tmp, vmin, vmax, step, dft, title, help); auto& ne = editNumber(tmp, vmin, vmax, step, dft, title, help);
auto& ne = dialog::get_ne();
ne.editwhat = &ne.intbuf; ne.intbuf = x; ne.intval = &x; ne.s = its(x); ne.editwhat = &ne.intbuf; ne.intbuf = x; ne.intval = &x; ne.s = its(x);
anims::get_parameter_animation(anims::find_param(&x), ne.s); anims::get_parameter_animation(anims::find_param(&x), ne.s);
return ne;
} }
EX void helpToEdit(int& x, int vmin, int vmax, int step, int dft) { EX void helpToEdit(int& x, int vmin, int vmax, int step, int dft) {