Help/Manager: don't need to keep a game config pointer anymore
I had removed the code that used it. We can just keep a help config pointer.
This commit is contained in:
parent
b81b5ba66e
commit
0e21a6425b
2 changed files with 5 additions and 10 deletions
|
@ -25,8 +25,7 @@
|
|||
namespace help
|
||||
{
|
||||
help_manager::help_manager()
|
||||
: game_cfg_(nullptr)
|
||||
, help_cfg_(nullptr)
|
||||
: help_cfg_(nullptr)
|
||||
, toplevel_section_(nullptr)
|
||||
, hidden_sections_(nullptr)
|
||||
, num_last_encountered_units_(-1)
|
||||
|
@ -104,12 +103,9 @@ void help_manager::reset_contents()
|
|||
num_last_encountered_terrains_ = -1;
|
||||
}
|
||||
|
||||
void help_manager::update_config_pointers()
|
||||
void help_manager::update_config_pointer()
|
||||
{
|
||||
game_cfg_ = &game_config_manager::get()->game_config();
|
||||
assert(game_cfg_);
|
||||
|
||||
help_cfg_ = &game_cfg_->child_or_empty("help");
|
||||
help_cfg_ = &game_config_manager::get()->game_config().child_or_empty("help");
|
||||
assert(help_cfg_);
|
||||
}
|
||||
|
||||
|
@ -117,7 +113,7 @@ void help_manager::build_topic_tree()
|
|||
{
|
||||
// We probaby don't need to update the pointers every time, but it's the
|
||||
// simplest way to ensure these are always valid.
|
||||
update_config_pointers();
|
||||
update_config_pointer();
|
||||
|
||||
try {
|
||||
// Start by parsing [toplevel]. It cascades down and parses all referenced sections and topics.
|
||||
|
|
|
@ -60,12 +60,11 @@ private:
|
|||
/** Returns true if we need to regenerate the toplevel and hidden sections. */
|
||||
bool content_update_needed() const;
|
||||
|
||||
void update_config_pointers();
|
||||
void update_config_pointer();
|
||||
|
||||
/** Fills in both toplevel_section_ and hidden_sections_. */
|
||||
void build_topic_tree();
|
||||
|
||||
const config* game_cfg_;
|
||||
const config* help_cfg_;
|
||||
|
||||
/** The default toplevel section node. */
|
||||
|
|
Loading…
Add table
Reference in a new issue