inv:: an option to display help about orbs, in touch interfaces

This commit is contained in:
Zeno Rogue
2025-12-11 20:57:58 +01:00
parent 5235521446
commit 964e2f20f6
2 changed files with 12 additions and 4 deletions
+4
View File
@@ -1675,6 +1675,10 @@ EX namespace dialog {
getcstat = SDLK_F1;
if(i&4) if(displayfrZH(xr*8, i0, 1, vid.fsize, IFM("1 - ") + XLAT("plain"), dialogcolor, 8))
getcstat = '1';
if(i&8) if(displayfrZH(xr*24, i0, 1, vid.fsize, IFM("2 - ") + XLAT("touch to activate"), dialogcolor, 8))
getcstat = '2';
if(i&16) if(displayfrZH(xr*24, i0, 1, vid.fsize, IFM("2 - ") + XLAT("touch to explain"), dialogcolor, 8))
getcstat = '2';
}
EX bool handlePageButtons(int sym, int uni, bool dkeys, int numpages) {
+8 -4
View File
@@ -481,7 +481,7 @@ EX namespace inv {
return s;
}
EX bool activating;
EX bool activating, view_help_only;
/** \brief show the OSM Orb screen */
EX void show() {
@@ -581,7 +581,7 @@ EX namespace inv {
dialog::addItem(XLAT("help"), SDLK_F1);
dialog::addItem(XLAT("return to the game"), 'i');
dialog::display();
which = orbmap[getcstat];
if(orbmap.count(getcstat)) which = orbmap[getcstat];
}
else {
if(which == itNone) {
@@ -632,14 +632,17 @@ EX namespace inv {
}
}
dialog::displayPageButtons(7, 0);
dialog::displayPageButtons(7 + (view_help_only ? 16 : 8), 0);
mouseovers = "";
keyhandler = [] (int sym, int uni) {
if(plain) dialog::handleNavigation(sym, uni);
if(orbmap.count(uni)) {
eItem orb = orbmap[uni];
if(remaining[orb] <= 0) ;
if(view_help_only) {
gotoHelp(generateHelpForItem(orb));
}
else if(remaining[orb] <= 0) ;
else if(orb == itOrbMirror) {
mirroring = !mirroring;
// an amusing message
@@ -690,6 +693,7 @@ EX namespace inv {
}
else if(uni == '1') plain = !plain;
else if(uni == '2') view_help_only = !view_help_only;
else if(sym == SDLK_F1)
gotoHelp(which ? generateHelpForItem(which) : XLAT(helptext));
else if(doexiton(sym, uni)) {