1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-16 18:29:59 +00:00

settings to view less stuff on the screen; fixed items/kills going over buttons in the portrait mode

This commit is contained in:
Zeno Rogue 2022-07-12 14:22:46 +02:00
parent 8256b398b1
commit 4a4e48400a
2 changed files with 27 additions and 8 deletions

View File

@ -718,6 +718,14 @@ EX void initConfig() {
{"by number", ""} {"by number", ""}
}, "inventory/kill sorting", 'k'); }, "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 // basic graphics
param_b(vid.wantGL, "usingGL", true) param_b(vid.wantGL, "usingGL", true)
@ -1833,6 +1841,8 @@ EX void configureInterface() {
add_edit(glyphsortorder); add_edit(glyphsortorder);
add_edit(vid.graphglyph); add_edit(vid.graphglyph);
add_edit(less_in_landscape);
add_edit(less_in_portrait);
add_edit(display_yasc_codes); add_edit(display_yasc_codes);

25
hud.cpp
View File

@ -45,6 +45,7 @@ EX int subclass(int i) {
#define GLYPH_LOCAL2 256 #define GLYPH_LOCAL2 256
#define GLYPH_TARGET 512 #define GLYPH_TARGET 512
#define GLYPH_INSQUARE 1024 #define GLYPH_INSQUARE 1024
#define GLYPH_INLANDSCAPE 2048
#if HDR #if HDR
enum eGlyphsortorder { enum eGlyphsortorder {
@ -147,7 +148,7 @@ int glyphflags(int gid) {
if(i == localshardof(cwt.at->land)) f |= GLYPH_LOCAL2; if(i == localshardof(cwt.at->land)) f |= GLYPH_LOCAL2;
} }
if(i == treasureType(cwt.at->land) || daily::on) 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(i == itHolyGrail) {
if(items[i] >= 3 && !inv::on) f |= GLYPH_MARKOVER; 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 if(items[i] < 10) f |= GLYPH_MARKTODO;
} }
else { 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(itemclass(i) == IC_ORB && items[i] < 10) f |= GLYPH_RUNOUT;
} }
if(i == orbToTarget) f |= GLYPH_TARGET; if(i == orbToTarget) f |= GLYPH_TARGET;
f |= GLYPH_INPORTRAIT; if(!less_in_portrait) f |= GLYPH_INPORTRAIT;
if(!less_in_landscape) f |= GLYPH_INLANDSCAPE;
} }
else { else {
eMonster m = eMonster(gid-ittypes); 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); 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(isnat == 2) f |= GLYPH_LOCAL2;
if(m == monsterToSummon) f |= GLYPH_TARGET; if(m == monsterToSummon) f |= GLYPH_TARGET;
if(!less_in_landscape) f |= GLYPH_INLANDSCAPE;
} }
return f; return f;
} }
@ -406,6 +409,8 @@ EX void draw_crosshair() {
return; return;
} }
EX bool less_in_portrait, less_in_landscape;
EX void drawStats() { EX void drawStats() {
if(vid.stereo_mode == sLR) return; if(vid.stereo_mode == sLR) return;
draw_crosshair(); draw_crosshair();
@ -506,18 +511,21 @@ EX void drawStats() {
instat = false; instat = false;
bool portrait = vid.xres < vid.yres; 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 rowspace = portrait ? vid.xres - 16 : vid.yres - vid.fsize * (vid.msgleft ? 9 : 4);
int colid[4], rowid[4]; int colid[4], rowid[4];
int maxbyclass[4]; int maxbyclass[4];
for(int z=0; z<4; z++) maxbyclass[z] = 0; for(int z=0; z<4; z++) maxbyclass[z] = 0;
flagtype flag = portrait ? GLYPH_INPORTRAIT : GLYPH_INLANDSCAPE;
for(int i=0; i<glyphs; i++) if(ikappear(i)) for(int i=0; i<glyphs; i++) if(ikappear(i))
if(!portrait || (glyphflags(i) | GLYPH_INPORTRAIT)) if(glyphflags(i) & flag)
maxbyclass[glyphclass(i)]++; maxbyclass[glyphclass(i)]++;
int buttonsize; int buttonsize;
int columns, rows; int columns, rows;
bool imponly = false; bool imponly = false;
int minsize = vid.fsize * (portrait ? 4 : 2); int minsize = vid.fsize * (portrait ? 3 : 2);
rows = 0; rows = 0;
while((buttonsize = minsize - vid.killreduction)) { while((buttonsize = minsize - vid.killreduction)) {
columns = colspace / buttonsize; columns = colspace / buttonsize;
@ -549,6 +557,7 @@ EX void drawStats() {
if(!ikappear(i)) continue; if(!ikappear(i)) continue;
int z = glyphclass(i); int z = glyphclass(i);
int imp = glyphflags(i); int imp = glyphflags(i);
if(!(imp & flag)) continue;
if(imponly) { z &=~1; if(!(imp & GLYPH_IMPORTANT)) continue; } if(imponly) { z &=~1; if(!(imp & GLYPH_IMPORTANT)) continue; }
int cx, cy; int cx, cy;