1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-05-06 17:24:06 +00:00

rogueviz:: remove visible_from_help, it just displays a list

This commit is contained in:
Zeno Rogue 2022-11-13 13:39:28 +01:00
parent 06523e063e
commit b7aae63b90
3 changed files with 29 additions and 29 deletions

View File

@ -28,12 +28,14 @@ ld ggamma = 1;
using namespace hr; using namespace hr;
edgetype default_edgetype = { .1, .1, .1, DEFAULT_COLOR, 0xFF0000FF, "default" }; edgetype default_edgetype = { .1, .1, DEFAULT_COLOR, 0xFF0000FF, "default" };
bool showlabels = false; bool showlabels = false;
bool specialmark = false; bool specialmark = false;
bool edge_legend = false; bool edge_legend = false;
int max_edges_help = 1000;
bool rog3 = false; bool rog3 = false;
int vertex_shape = 1; int vertex_shape = 1;
@ -295,43 +297,44 @@ void rogueviz_help(int id, int pagenumber) {
sort(alledges.begin(), alledges.end(), edgecmp); sort(alledges.begin(), alledges.end(), edgecmp);
for(int i=0; i<10 && i+pagenumber < noedges; i++) { int qty = 0;
help_extension hex;
hex.key = 'a' + i; for(auto ei: alledges) {
help_extension hex;
hex.key = dialog::list_fake_key++;
edgeinfo *ei = alledges[pagenumber + i];
if(ei->weight < ei->type->visible_from_help) continue;
int k = ei->i ^ ei->j ^ id; int k = ei->i ^ ei->j ^ id;
hex.text = vdata[k].name; hex.text = vdata[k].name;
hex.color = vdata[k].cp.color1 >> 8; hex.color = vdata[k].cp.color1 >> 8;
if(vizflags & RV_WHICHWEIGHT) { if(vizflags & RV_WHICHWEIGHT) {
if(which_weight) ld w = which_weight ? ei->weight2 : ei->weight;
hex.subtext = fts(ei->weight2); if(vizflags & RV_INVERSE_WEIGHT) w = 1 / w;
else hex.subtext = fts(w);
hex.subtext = fts(ei->weight);
} }
hex.action = [k] () { help_extensions.clear(); rogueviz_help(k, 0); }; hex.action = [k] () { help_extensions.clear(); rogueviz_help(k, 0); };
help_extensions.push_back(hex); help_extensions.push_back(hex);
}
if(noedges > pagenumber + 10) { qty++; if(qty > max_edges_help) break;
help_extension hex;
hex.key = 'z';
hex.text = "next page";
hex.subtext = its(pagenumber+10) + "/" + its(noedges) + " edges";
hex.action = [id, pagenumber] () { help_extensions.clear(); rogueviz_help(id, pagenumber + 10); };
help_extensions.push_back(hex);
} }
if((vizflags & RV_WHICHWEIGHT) && noedges) { if((vizflags & RV_WHICHWEIGHT) && noedges) {
help_extension hex; help_extension hex;
hex.key = 'w'; hex.key = '1';
hex.text = "displayed weight"; hex.text = "displayed weight";
hex.subtext = which_weight ? "attraction force" : "weight from the data"; bool inv = vizflags & RV_INVERSE_WEIGHT;
hex.subtext = which_weight ? (inv ? "distance requested" : "attraction force") : (inv ? "inverse value from data" : "weight from the data");
hex.action = [id, pagenumber] () { which_weight = !which_weight; help_extensions.clear(); rogueviz_help(id, pagenumber); }; hex.action = [id, pagenumber] () { which_weight = !which_weight; help_extensions.clear(); rogueviz_help(id, pagenumber); };
help_extensions.push_back(hex); help_extensions.push_back(hex);
} }
if(true) {
help_extension hex;
hex.key = '2';
hex.text = "find this";
hex.action = [id] () { search_for = id; popScreen(); };
help_extensions.push_back(hex);
}
} }
bool describe_monster(shmup::monster *m, string& out) { bool describe_monster(shmup::monster *m, string& out) {

View File

@ -44,7 +44,6 @@ namespace rogueviz {
struct edgetype { struct edgetype {
double visible_from; double visible_from;
double visible_from_hi; double visible_from_hi;
double visible_from_help;
unsigned color, color_hi; unsigned color, color_hi;
string name; string name;
}; };

View File

@ -1163,12 +1163,13 @@ int readArgs() {
if(0) ; if(0) ;
else if(argis("-sagmin")) { else if(argis("-sagmin")) {
shift_arg_formula(default_edgetype.visible_from); auto& ed = sag_edge ? *sag_edge : default_edgetype;
default_edgetype.visible_from_hi = default_edgetype.visible_from; shift_arg_formula(ed.visible_from);
default_edgetype.visible_from_help = default_edgetype.visible_from; ed.visible_from_hi = ed.visible_from;
} }
else if(argis("-sagminhi")) { else if(argis("-sagminhi")) {
shift_arg_formula(default_edgetype.visible_from_hi); auto& ed = sag_edge ? *sag_edge : default_edgetype;
shift_arg_formula(ed.visible_from_hi);
} }
else if(argis("-sag_gdist")) { else if(argis("-sag_gdist")) {
shift(); sag::gdist_prec = argi(); shift(); sag::gdist_prec = argi();
@ -1213,9 +1214,6 @@ int readArgs() {
if(method == smMatch) prepare_graph(); if(method == smMatch) prepare_graph();
} }
else if(argis("-sagminhelp")) {
shift_arg_formula(default_edgetype.visible_from_help);
}
else if(argis("-sagformat")) { else if(argis("-sagformat")) {
shift(); informat = argi(); shift(); informat = argi();
} }