From dd8e30e04193d572586dcc03eb513059bb694a15 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 9 Jul 2018 18:39:34 +0200 Subject: [PATCH] RogueViz legend as HUD replacement, lists edge types too --- hud.cpp | 5 +--- mapeditor.cpp | 2 +- rogueviz.cpp | 76 +++++++++++++++++++++++++++++++++++---------------- 3 files changed, 55 insertions(+), 28 deletions(-) diff --git a/hud.cpp b/hud.cpp index 3f721aec..099e684d 100644 --- a/hud.cpp +++ b/hud.cpp @@ -335,11 +335,8 @@ void drawMobileArrow(cell *c, transmatrix V) { bool nofps = false; void drawStats() { - callhandlers(false, hooks_prestats); -#if CAP_ROGUEVIZ - if(rogueviz::on) return; -#endif if(nohud || stereo::mode == stereo::sLR) return; + if(callhandlers(false, hooks_prestats)) return; if(viewdists && sidescreen) { distcolors[0] = forecolor; dialog::init(""); diff --git a/mapeditor.cpp b/mapeditor.cpp index c5642248..d26353a1 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -949,7 +949,7 @@ namespace mapeditor { cmode = sm::DRAW; gamescreen(0); drawGrid(); - callhandlers(false, hooks_prestats); + if(callhandlers(false, hooks_prestats)) return; if(!mouseout()) getcstat = '-'; diff --git a/rogueviz.cpp b/rogueviz.cpp index c0735316..3450153f 100644 --- a/rogueviz.cpp +++ b/rogueviz.cpp @@ -1286,6 +1286,52 @@ vector legend; vector named; +bool rogueviz_hud() { + if(!rogueviz::on) return false; + if(cmode & sm::DRAW) return false; + if(legend.empty()) return true; + + initquickqueue(); + int qet = isize(edgetypes); + if(qet == 1) qet = 0; + + int legit = qet + isize(legend); + + int rad = vid.radius/10; + ld x = vid.xres - rad; + + for(int i=0; icolor | 0xFF; + queuepolyat(V, shTriangle, 0, PPR_MONSTER_HEAD); + + poly_outline = OUTLINE_DEFAULT; + queuestr(int(x-rad), int(y), 0, rad*(svg::in?5:3)/4, t->name, forecolor, 0, 16); + } + + quickqueue(); + return true; + } + void drawExtra() { if(kind == kFullNet) { @@ -1309,26 +1355,6 @@ void drawExtra() { canmove = true; items[itOrbAether] = true; } - -#if CAP_RUG - if(!rug::rugged) -#endif - for(int i=0; i