From 08bf3fe3d64f8fa677d733e2acdb2ebd3323b2ce Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 25 Mar 2023 09:24:47 +0100 Subject: [PATCH] an option to not display default help --- config.cpp | 9 +++++++++ graph.cpp | 4 ++-- help.cpp | 3 ++- system.cpp | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/config.cpp b/config.cpp index 27195b59..f2336d7d 100644 --- a/config.cpp +++ b/config.cpp @@ -1961,6 +1961,8 @@ EX void configureInterface() { XLAT("Maximum number of messages on screen.")); dialog::bound_low(0); }); + + add_edit(nohelp); add_edit(vid.msgleft); @@ -2671,6 +2673,13 @@ EX int config3 = addHook(hooks_configfile, 100, [] { addsaver(vid.auto_eye, "auto-eyelevel", false); + param_enum(nohelp, "help_messages", "help_messages", 0) + -> editable({ + {"all", "all context help/welcome messages"}, + {"none", "no context help/welcome messages"}, + {"automatic", "I know I can press F1 for help"}, + }, "context help", 'H'); + param_f(vid.creature_scale, "creature_scale", "3d-creaturescale", 1) ->editable(0, 1, .1, "Creature scale", "", 'C'); param_f(vid.height_width, "heiwi", "3d-heightwidth", 1.5) diff --git a/graph.cpp b/graph.cpp index b6f5e5f7..7d663d64 100644 --- a/graph.cpp +++ b/graph.cpp @@ -5690,7 +5690,7 @@ EX void emptyscreen() { drawqueue(); } -EX bool nohelp; +EX int nohelp; EX bool no_find_player; EX void normalscreen() { @@ -5836,7 +5836,7 @@ EX void drawscreen() { color_t col = linf[cwt.at->land].color; if(cwt.at->land == laRedRock) col = 0xC00000; if(titlecolor) col = titlecolor; - if(!nohelp) + if(nohelp != 1) displayfr(vid.xres/2, vid.fsize, 2, vid.fsize, mouseovers, col, 8); #endif diff --git a/help.cpp b/help.cpp index 1bbae4db..46675783 100644 --- a/help.cpp +++ b/help.cpp @@ -218,6 +218,7 @@ EX void buildHelpText() { } EX string standard_help() { + if(nohelp == 2) return ""; return XLAT("Press F1 or right click for help"); } @@ -239,7 +240,7 @@ EX void buildCredits() { "Kojiguchi Kazuki, baconcow, Alan, SurelyYouJest, hotdogPi, DivisionByZero, xXxWeedGokuxXx, jpystynen, Dmitry Marakasov, Alexandre Moine, Arthur O'Dwyer, " "Triple_Agent_AAA, bluetailedgnat, Allalinor, Shitford, KittyTac, Christopher King, KosGD, TravelDemon, Bubbles, rdococ, frozenlake, MagmaMcFry, " "Snakebird Priestess, roaringdragon2, Stopping Dog, bengineer8, Sir Light IJIJ, ShadeBlade, Saplou, shnourok, Ralith, madasa, 6% remaining, Chimera245, Remik Pi, alien foxcat thing, " - "Piotr Grochowski, Ann, still-flow, tyzone, Paradoxica, LottieRatWorld, aismallard, albatross, EncodedSpirit, Jacob Mandelson, CrashTuvai, cvoight, jennlbw" + "Piotr Grochowski, Ann, still-flow, tyzone, Paradoxica, LottieRatWorld, aismallard, albatross, EncodedSpirit, Jacob Mandelson, CrashTuvai, cvoight, jennlbw, Kali Ranya" ); #ifdef EXTRALICENSE help += EXTRALICENSE; diff --git a/system.cpp b/system.cpp index 11426211..2d65850f 100644 --- a/system.cpp +++ b/system.cpp @@ -77,6 +77,7 @@ EX hookset hooks_welcome_message; /** \brief Print the welcome message during the start of game. Depends on the current mode and other settings. */ EX void welcomeMessage() { if(callhandlers(false, hooks_welcome_message)) return; + if(nohelp == 1) return; if(embedded_plane) return IPF(welcomeMessage()); #if CAP_TOUR else if(tour::on) return; // displayed by tour @@ -140,6 +141,7 @@ EX void welcomeMessage() { addMessage(XLAT(lv.msg)); } + if(nohelp == 2) return; #if ISMAC addMessage(XLAT("Press F1 or right-shift-click things for help.")); #elif !ISMOBILE