diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 6b700253..9111ed8d 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -962,7 +962,7 @@ void init_boe(int argc, char* argv[]) { plop_fancy_startup(fps_limiter); cUniverse::print_result = iLiving::print_result = add_string_to_buf; - cPlayer::give_help = give_help; + cPlayer::give_help_enabled = true; init_fileio(); init_debug_actions(); init_spell_menus(); diff --git a/src/universe/pc.cpp b/src/universe/pc.cpp index 044b5ebd..c1dbbce8 100644 --- a/src/universe/pc.cpp +++ b/src/universe/pc.cpp @@ -21,11 +21,14 @@ #include "fileio/fileio.hpp" #include "fileio/tagfile.hpp" #include "sounds.hpp" +#include "dialogxml/dialogs/strdlog.hpp" extern short skill_bonus[21]; // A nice convenient bitset with just the low 30 bits set, for initializing spells const uint32_t cPlayer::basic_spells = std::numeric_limits::max() >> 2; +bool cPlayer::give_help_enabled = false; + void cPlayer::import_legacy(legacy::pc_record_type old){ main_status = (eMainStatus) old.main_status; name = old.name; @@ -152,7 +155,7 @@ void cPlayer::curse(int how_much) { else if(how_much > 0) print_result(" " + name + " cursed."); } - if(give_help) { + if(give_help_enabled) { if(how_much > 0) give_help(59,0); else if(how_much > 0) @@ -180,7 +183,7 @@ void cPlayer::dumbfound(int how_much) { if(print_result) print_result(" " + name + " dumbfounded."); one_sound(67); - if(give_help) + if(give_help_enabled) give_help(28,0); } @@ -203,7 +206,7 @@ void cPlayer::disease(int how_much) { if(print_result) print_result(" " + name + " diseased."); one_sound(66); - if(give_help) + if(give_help_enabled) give_help(29,0); } @@ -250,7 +253,7 @@ void cPlayer::sleep(eStatus what_type,int how_much,int adjust) { else play_sound(90); if(what_type != eStatus::FORCECAGE) ap = 0; - if(give_help) { + if(give_help_enabled) { if(what_type == eStatus::ASLEEP) give_help(30,0); else if(what_type == eStatus::PARALYZED) @@ -272,7 +275,7 @@ void cPlayer::slow(int how_much) { else if(how_much > 0) print_result(" " + name + " slowed."); } - if(give_help) + if(give_help_enabled) give_help(35,0); } @@ -1345,6 +1348,4 @@ void cPlayer::readFrom(const cTagFile& file) { items[i].readFrom(page); } } -} - -void(* cPlayer::give_help)(short,short) = nullptr; +} \ No newline at end of file diff --git a/src/universe/pc.hpp b/src/universe/pc.hpp index 0235fba7..8a73edf5 100644 --- a/src/universe/pc.hpp +++ b/src/universe/pc.hpp @@ -81,7 +81,9 @@ class cPlayer : public iLiving { public: // A nice convenient bitset with just the low 30 bits set, for initializing spells static const uint32_t basic_spells; - static void(* give_help)(short,short); + // This class is shared between the game and the editors, but it should only show help dialogs + // when being used in the game, which sets this flag to true on startup. + static bool give_help_enabled; eMainStatus main_status; std::string name; // HACK: This is only really marked mutable so that I can use operator[] from const methods