rogueviz adjusted to the changes

This commit is contained in:
Zeno Rogue 2023-08-14 20:13:52 +02:00
parent beb679ccab
commit 07857e612a
14 changed files with 32 additions and 35 deletions

View File

@ -235,20 +235,17 @@ void show() {
dialog::addSelItem("advance", fts(advance), 'a'); dialog::addSelItem("advance", fts(advance), 'a');
dialog::add_action([]() { dialog::add_action([]() {
dialog::editNumber(advance, 0, 100, 1, 1, "advance", ""); dialog::editNumber(advance, 0, 100, 1, 1, "advance", "").reaction = make_routes;
dialog::reaction = make_routes;
}); });
dialog::addSelItem("over", fts(over), 'o'); dialog::addSelItem("over", fts(over), 'o');
dialog::add_action([]() { dialog::add_action([]() {
dialog::editNumber(over, 0, 100, 1, 1, "over", ""); dialog::editNumber(over, 0, 100, 1, 1, "over", "").reaction = make_routes;
dialog::reaction = make_routes;
}); });
dialog::addSelItem("over2", fts(over2), 'p'); dialog::addSelItem("over2", fts(over2), 'p');
dialog::add_action([]() { dialog::add_action([]() {
dialog::editNumber(over2, 0, 100, 1, 1, "over2", ""); dialog::editNumber(over2, 0, 100, 1, 1, "over2", "").reaction = make_routes;
dialog::reaction = make_routes;
}); });
dialog::addBoolItem_action("animated", animated, 'a'); dialog::addBoolItem_action("animated", animated, 'a');

View File

@ -169,12 +169,12 @@ void collatz_video(const string &fname) {
if(true) { if(true) {
sightrange_bonus = 3; sightrange_bonus = 3;
genrange_bonus = 3; genrange_bonus = 3;
dronemode = true; pconf.camera_angle = -45; rog3 = true; patterns::whichShape = '8'; dronemode = true; pconf.cam() = spin(-45._deg); rog3 = true; patterns::whichShape = '8';
vid.aurastr = 512; vid.aurastr = 512;
collatz::lookup(763, 60); collatz::lookup(763, 60);
history::create_playerpath(), models::rotation = 1; history::create_playerpath(), models::rotation = spin90();
// pmodel = mdBand; // pmodel = mdBand;
#define STORYCOUNT 24 #define STORYCOUNT 24

View File

@ -223,12 +223,12 @@ EX void show_menu() {
dialog::addItem(XLAT("enter seed"), 's'); dialog::addItem(XLAT("enter seed"), 's');
dialog::add_action([] { dialog::add_action([] {
dialog::editNumber(last_seed, 0, 1000000, 1, last_seed, XLAT("seed"), ""); auto& di = dialog::editNumber(last_seed, 0, 1000000, 1, last_seed, XLAT("seed"), "");
dialog::reaction_final = [] { di.reaction_final = [] {
launch(last_seed, last_elimit, last_hlimit); launch(last_seed, last_elimit, last_hlimit);
popScreenAll(); popScreenAll();
}; };
dialog::extra_options = [] { di.extra_options = [] {
dialog::addSelItem("Euclidean size", its(last_elimit), 'E'); dialog::addSelItem("Euclidean size", its(last_elimit), 'E');
dialog::add_action([] { popScreen(); dialog::editNumber(last_elimit, 2, 10, 1, 3, XLAT("Euclidean size"), ""); }); dialog::add_action([] { popScreen(); dialog::editNumber(last_elimit, 2, 10, 1, 3, XLAT("Euclidean size"), ""); });
dialog::addSelItem("hyperbolic size", its(last_hlimit), 'H'); dialog::addSelItem("hyperbolic size", its(last_hlimit), 'H');

View File

@ -871,7 +871,7 @@ void switch_fpp_fixed() {
playermoved = false; playermoved = false;
} }
else { else {
pconf.camera_angle = 0; pconf.cam() = Id;
vid.yshift = 0; vid.yshift = 0;
ys = tView[2][3]; ys = tView[2][3];
println(hlog, "ys = ", ys, " from ", tView); println(hlog, "ys = ", ys, " from ", tView);

View File

@ -195,8 +195,7 @@ void add_extra_projections() {
add_extra("azimuthal cylindrical", mf::cylindrical | mf::azimuthal | mf::orientation, [] (shiftpoint& H_orig, hyperpoint& H, hyperpoint& ret) { add_extra("azimuthal cylindrical", mf::cylindrical | mf::azimuthal | mf::orientation, [] (shiftpoint& H_orig, hyperpoint& H, hyperpoint& ret) {
find_zlev(H); find_zlev(H);
models::apply_orientation_yz(H[1], H[2]); models::scr_to_ori(H);
models::apply_orientation(H[0], H[1]);
ld x, y; ld x, y;
y = asin_auto(H[1]); y = asin_auto(H[1]);
@ -212,6 +211,7 @@ void add_extra_projections() {
ret[1] = H[1] / H[0] * x; ret[1] = H[1] / H[0] * x;
if(GDIM == 2) ret[2] = H[2] / H[0] * x; if(GDIM == 2) ret[2] = H[2] / H[0] * x;
ret[LDIM] = 1; ret[LDIM] = 1;
models::ori_to_scr(H);
}); });
} }

View File

@ -85,17 +85,19 @@ void draw_to(ld t0, hyperpoint h0, ld t1, hyperpoint h1, int small = 0, int big
int editwhich = -1; int editwhich = -1;
dialog::string_dialog se;
void show_graph() { void show_graph() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(); gamescreen();
dialog::init(XLAT("graph")); dialog::init(XLAT("graph"));
for(int i=0; i<isize(formula); i++) { for(int i=0; i<isize(formula); i++) {
if(editwhich == i) { if(editwhich == i) {
dialog::addItem(dialog::view_edited_string(), '1'+i); dialog::addItem(se.view_edited_string(), '1'+i);
} }
else { else {
dialog::addItem(formula[i], editwhich == -1 ? '1'+i : 0); dialog::addItem(formula[i], editwhich == -1 ? '1'+i : 0);
dialog::add_action([i] () { editwhich = i; dialog::start_editing(formula[i]); }); dialog::add_action([i] () { editwhich = i; se.start_editing(formula[i]); });
} }
} }
@ -104,7 +106,7 @@ void show_graph() {
keyhandler = [] (int sym, int uni) { keyhandler = [] (int sym, int uni) {
if(editwhich >= 0) { if(editwhich >= 0) {
if(dialog::handle_edit_string(sym, uni)) ; if(se.handle_edit_string(sym, uni)) ;
else if(doexiton(sym, uni)) else if(doexiton(sym, uni))
editwhich = -1; editwhich = -1;
} }

View File

@ -34,7 +34,7 @@ vector<reaction_t> models_to_use = {
else { else {
pmodel = mdHyperboloid; pmodel = mdHyperboloid;
pconf.top_z = 4; pconf.top_z = 4;
pconf.ballangle = -20; pconf.ball() = spin(-20._deg);
pconf.scale = .75; pconf.scale = .75;
} }
spherename = "Euclidean sphere"; spherename = "Euclidean sphere";

View File

@ -246,8 +246,7 @@ bool cylanim = false;
void o_key(o_funcs& v) { void o_key(o_funcs& v) {
v.push_back(named_functionality("ring size", [] { v.push_back(named_functionality("ring size", [] {
dialog::editNumber(cscale, 0, 1, .01, .1, "", ""); dialog::editNumber(cscale, 0, 1, .01, .1, "", "").reaction = reset;
dialog::reaction = reset;
})); }));
} }

View File

@ -946,7 +946,10 @@ void ncee() {
if(uni == 's') show_mapping = !show_mapping; if(uni == 's') show_mapping = !show_mapping;
if(uni == 'g') show_mgrid = !show_mgrid; if(uni == 'g') show_mgrid = !show_mgrid;
if(uni == 't') pushScreen(conf_shapes); if(uni == 't') pushScreen(conf_shapes);
if(uni == 'y') dialog::editNumber(mapping_split, 0, 1, 0.05, 0.75, "", ""), dialog::dialogflags = sm::NOSCR; if(uni == 'y') {
dialog::editNumber(mapping_split, 0, 1, 0.05, 0.75, "", "");
dialog::get_di().dialogflags = sm::NOSCR;
}
if(uni == '-') { if(uni == '-') {
int x = (mousex - cd->xcenter - xc - x0) / siz; int x = (mousex - cd->xcenter - xc - x0) / siz;
int y = (mousey - cd->ycenter - yc - y0) / siz; int y = (mousey - cd->ycenter - yc - y0) / siz;

View File

@ -140,7 +140,7 @@ void show() {
} }
if(in_video) { if(in_video) {
history::create(currentmap->gamestart(), walkers[0].at, walkers[0].T); history::create(currentmap->gamestart(), walkers[0].at, walkers[0].T);
models::rotation = rand() % 360; models::rotation = spin((rand() % 360) * degree);
} }
}); });

View File

@ -1012,7 +1012,7 @@ void configure_edge_display() {
dialog::addColorItem(t->name, t->color, 'a' + i); dialog::addColorItem(t->name, t->color, 'a' + i);
dialog::add_action([t] { dialog::add_action([t] {
dialog::openColorDialog(t->color, NULL); dialog::openColorDialog(t->color, NULL);
dialog::dialogflags |= sm::MAYDARK | sm::SIDE; dialog::get_di().dialogflags |= sm::MAYDARK | sm::SIDE;
}); });
break; break;
case 1: case 2: { case 1: case 2: {
@ -1030,8 +1030,8 @@ void configure_edge_display() {
static ld i; static ld i;
i = 1 / val; i = 1 / val;
dialog::editNumber(i, 1, 1000000, 1, 500, weight_label, ""); dialog::editNumber(i, 1, 1000000, 1, 500, weight_label, "");
dialog::reaction = [&val] () { val = i ? 1. / i : 5; }; dialog::get_di().reaction = [&val] () { val = i ? 1. / i : 5; };
dialog::scaleLog(); dialog::ne.step = .2; dialog::scaleLog(); dialog::get_ne().step = .2;
}); });
} }
break; break;

View File

@ -994,13 +994,11 @@ namespace sag {
if(method == smMatch) { if(method == smMatch) {
dialog::addSelItem(XLAT("match parameter A"), fts(match_a), 'A'); dialog::addSelItem(XLAT("match parameter A"), fts(match_a), 'A');
dialog::add_action([] { dialog::add_action([] {
dialog::editNumber(match_a, 0, 10, 1, 1, XLAT("match parameter A"), ""); dialog::editNumber(match_a, 0, 10, 1, 1, XLAT("match parameter A"), "").reaction = prepare_graph;
dialog::reaction = prepare_graph;
}); });
dialog::addSelItem(XLAT("match parameter B"), fts(match_b), 'B'); dialog::addSelItem(XLAT("match parameter B"), fts(match_b), 'B');
dialog::add_action([] { dialog::add_action([] {
dialog::editNumber(match_b, 0, 10, 1, 1, XLAT("match parameter B"), ""); dialog::editNumber(match_b, 0, 10, 1, 1, XLAT("match parameter B"), "").reaction = prepare_graph;
dialog::reaction = prepare_graph;
}); });
} }

View File

@ -453,10 +453,10 @@ void show() {
last_segment = -1; last_segment = -1;
test_t = 0; test_t = 0;
dialog::editNumber(test_t, 0, 100, 0.1, 0, "enter the percentage", ""); dialog::editNumber(test_t, 0, 100, 0.1, 0, "enter the percentage", "");
dialog::reaction = [] { dialog::get_di().reaction = [] {
handle_animation(test_t / 100); handle_animation(test_t / 100);
}; };
dialog::extra_options = [] { dialog::get_di().extra_options = [] {
dialog::addSelItem("current segment", its(last_segment), 'C'); dialog::addSelItem("current segment", its(last_segment), 'C');
dialog::addSelItem("current front", fts(c_front_dist), 'F'); dialog::addSelItem("current front", fts(c_front_dist), 'F');
dialog::addSelItem("current up", fts(c_up_dist), 'U'); dialog::addSelItem("current up", fts(c_up_dist), 'U');

View File

@ -216,8 +216,7 @@ void snow_slide(vector<tour::slide>& v, string title, string desc, reaction_t t)
if(mode == pmKey) { if(mode == pmKey) {
using namespace anims; using namespace anims;
tour::slide_backup(ma, ma == maTranslation ? maNone : maTranslation); tour::slide_backup(ma, ma == maTranslation ? maNone : maTranslation);
tour::slide_backup<ld>(shift_angle, 0); tour::slide_backup<transmatrix>(movement_angle.v3, cspin90(0, 2));
tour::slide_backup<ld>(movement_angle, 90);
} }
if(mode == pmStart) { if(mode == pmStart) {
@ -241,8 +240,7 @@ void show() {
dialog::addSelItem("lambda", fts(snow_lambda), 'l'); dialog::addSelItem("lambda", fts(snow_lambda), 'l');
dialog::add_action([]() { dialog::add_action([]() {
dialog::editNumber(snow_lambda, 0, 100, 1, 10, "lambda", "snowball density"); dialog::editNumber(snow_lambda, 0, 100, 1, 10, "lambda", "snowball density").reaction = [] { snowballs_at.clear(); };
dialog::reaction = [] { snowballs_at.clear(); };
}); });
dialog::addSelItem("size", fts(snow_shape), 's'); dialog::addSelItem("size", fts(snow_shape), 's');