// a RogueViz dialog to manipulate DHRG embeddings int held_id = -1; void show_likelihood() { cmode = sm::SIDE | sm::MAYDARK | sm::DIALOG_STRICT_X; gamescreen(); dialog::init("DHRG information"); ll bonus_tally[MAXDIST], bonus_edgetally[MAXDIST]; if(held_id >= 0) { for(int i=0; i= 0) { if(!mousepressed) held_id = -1; else if(mouseover) { rogueviz::vdata[held_id].m->base = mouseover; shmup::fixStorage(); dhrg::fixedges(); auto& mc = vertices[held_id]; tallyedgesof(held_id, -1, mc); add_to_set(mc, -1, 0); add_to_tally(mc, -1, 0); mc = find_mycell_by_path(computePath(rogueviz::vdata[held_id].m->base)); tallyedgesof(held_id, 1, mc); add_to_tally(mc, 1, 0); add_to_set(mc, 1, 0); } } keyhandler = [] (int sym, int uni) { if(uni == '-' && held_id == -1) { for(int i=0; ibase == mouseover) held_id = i; return; } dialog::handleNavigation(sym, uni); }; } bool dhrg_animate(int sym, int uni) { if((cmode & sm::NORMAL) && uni == '/') { clearMessages(); if(ts_rbase > ts_vertices) { dhrg_init(); graph_from_rv(); ts_vertices = ts_rbase; place_rogueviz_vertices(); if(!stored) rogueviz::storeall(), stored = true; else shmup::fixStorage(); } pushScreen(show_likelihood); return true; } return false; }