From 4a4e48400a1e65b29ef9b1a8f30b598e3da3f0ce Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 12 Jul 2022 14:22:46 +0200 Subject: [PATCH] settings to view less stuff on the screen; fixed items/kills going over buttons in the portrait mode --- config.cpp | 10 ++++++++++ hud.cpp | 25 +++++++++++++++++-------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/config.cpp b/config.cpp index dfb91850..b0cf7439 100644 --- a/config.cpp +++ b/config.cpp @@ -717,6 +717,14 @@ EX void initConfig() { {"by land", ""}, {"by number", ""} }, "inventory/kill sorting", 'k'); + + param_b(less_in_landscape, "less_in_landscape", false) + ->editable("less items/kills in landscape", 'L') + -> set_sets([] { dialog::reaction_final = [] { println(hlog, "Reset"); vid.killreduction = 0; }; }); + + param_b(less_in_portrait, "less_in_portrait", false) + ->editable("less items/kills in portrait", 'P') + -> set_sets([] { dialog::reaction_final = [] { println(hlog, "Reset"); vid.killreduction = 0; }; }); // basic graphics @@ -1833,6 +1841,8 @@ EX void configureInterface() { add_edit(glyphsortorder); add_edit(vid.graphglyph); + add_edit(less_in_landscape); + add_edit(less_in_portrait); add_edit(display_yasc_codes); diff --git a/hud.cpp b/hud.cpp index 8f405941..4bab2bd2 100644 --- a/hud.cpp +++ b/hud.cpp @@ -45,6 +45,7 @@ EX int subclass(int i) { #define GLYPH_LOCAL2 256 #define GLYPH_TARGET 512 #define GLYPH_INSQUARE 1024 +#define GLYPH_INLANDSCAPE 2048 #if HDR enum eGlyphsortorder { @@ -147,7 +148,7 @@ int glyphflags(int gid) { if(i == localshardof(cwt.at->land)) f |= GLYPH_LOCAL2; } if(i == treasureType(cwt.at->land) || daily::on) - f |= GLYPH_LOCAL | GLYPH_LOCAL2 | GLYPH_IMPORTANT | GLYPH_INSQUARE; + f |= GLYPH_LOCAL | GLYPH_LOCAL2 | GLYPH_IMPORTANT | GLYPH_INSQUARE | GLYPH_INPORTRAIT | GLYPH_INLANDSCAPE; if(i == itHolyGrail) { if(items[i] >= 3 && !inv::on) f |= GLYPH_MARKOVER; } @@ -156,19 +157,21 @@ int glyphflags(int gid) { else if(items[i] < 10) f |= GLYPH_MARKTODO; } else { - f |= GLYPH_IMPORTANT | GLYPH_INSQUARE; + f |= GLYPH_IMPORTANT | GLYPH_INSQUARE | GLYPH_INPORTRAIT | GLYPH_INLANDSCAPE; if(itemclass(i) == IC_ORB && items[i] < 10) f |= GLYPH_RUNOUT; } if(i == orbToTarget) f |= GLYPH_TARGET; - f |= GLYPH_INPORTRAIT; + if(!less_in_portrait) f |= GLYPH_INPORTRAIT; + if(!less_in_landscape) f |= GLYPH_INLANDSCAPE; } else { eMonster m = eMonster(gid-ittypes); - if(m == moLesser) f |= GLYPH_IMPORTANT | GLYPH_DEMON | GLYPH_INPORTRAIT | GLYPH_INSQUARE; + if(m == moLesser) f |= GLYPH_IMPORTANT | GLYPH_DEMON | GLYPH_INPORTRAIT | GLYPH_INSQUARE | GLYPH_INLANDSCAPE; int isnat = isNative(cwt.at->land, m); - if(isnat) f |= GLYPH_LOCAL | GLYPH_IMPORTANT | GLYPH_INPORTRAIT | GLYPH_INSQUARE; + if(isnat) f |= GLYPH_LOCAL | GLYPH_IMPORTANT | GLYPH_INPORTRAIT | GLYPH_INSQUARE | GLYPH_INLANDSCAPE; if(isnat == 2) f |= GLYPH_LOCAL2; if(m == monsterToSummon) f |= GLYPH_TARGET; + if(!less_in_landscape) f |= GLYPH_INLANDSCAPE; } return f; } @@ -405,6 +408,8 @@ EX void draw_crosshair() { } return; } + +EX bool less_in_portrait, less_in_landscape; EX void drawStats() { if(vid.stereo_mode == sLR) return; @@ -506,18 +511,21 @@ EX void drawStats() { instat = false; bool portrait = vid.xres < vid.yres; - int colspace = portrait ? (vid.yres - vid.xres - vid.fsize*3) : (vid.xres - vid.yres - 16) / 2; + int colspace = portrait ? (current_display->ycenter - current_display->scrsize - 3 * vid.fsize) : (vid.xres - vid.yres - 16) / 2; int rowspace = portrait ? vid.xres - 16 : vid.yres - vid.fsize * (vid.msgleft ? 9 : 4); int colid[4], rowid[4]; int maxbyclass[4]; for(int z=0; z<4; z++) maxbyclass[z] = 0; + + flagtype flag = portrait ? GLYPH_INPORTRAIT : GLYPH_INLANDSCAPE; + for(int i=0; i