From cfb47631ac1c681ddc2791a8fd1e16f679079d9e Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 13 Aug 2022 22:44:44 +0200 Subject: [PATCH] slide text improvements --- tour.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tour.cpp b/tour.cpp index fb0d8953..0ac57b46 100644 --- a/tour.cpp +++ b/tour.cpp @@ -71,6 +71,8 @@ static const flagtype SIDESCREEN = 64; static const flagtype USE_SLIDE_NAME = 128; /** \brief do not display any help line */ static const flagtype NOTITLE = 256; +/** \brief always display the text, even if going back or texts are disabled */ +static const flagtype ALWAYS_TEXT = 256; #endif EX vector restorers; @@ -196,15 +198,14 @@ string get_subname(const string& s, const string& folder) { /** \brief display the help text for the current slide if texts enabled */ EX void slidehelp() { - if(texts && slides[currentslide].help[0]) { - string slidename = get_slidename(slides[currentslide].name); - gotoHelp( - help = - helptitle(XLAT(slidename), 0xFF8000) + - XLAT(slides[currentslide].help) - ); - presentation(pmHelpEx); - } + if(!slides[currentslide].help[0]) return; + string slidename = get_slidename(slides[currentslide].name); + gotoHelp( + help = + helptitle(XLAT(slidename), 0xFF8000) + + XLAT(slides[currentslide].help) + ); + presentation(pmHelpEx); } /** \brief return from a subgame launched while in presentation */ @@ -227,7 +228,7 @@ EX bool next_slide() { slide_restore_all(); currentslide++; presentation(pmStart); - slidehelp(); + if(texts) slidehelp(); return true; } @@ -248,7 +249,7 @@ bool handleKeyTour(int sym, int uni) { currentslide--; presentation(pmStart); popScreenAll(); - if(inhelp) slidehelp(); + if(inhelp || (flags & ALWAYS_TEXT)) slidehelp(); return true; } int legal = slides[currentslide].flags & 7; @@ -503,7 +504,7 @@ EX namespace ss { currentslide = i; popScreenAll(); presentation(pmStart); - slidehelp(); + if(texts) slidehelp(); }); } dialog::addBreak(50); @@ -559,7 +560,7 @@ EX void start() { } restart_game(rg::tour); if(tour::on) { - slidehelp(); + if(texts) slidehelp(); presentation(pmStart); } }