Removed help_manager struct (it will be replaced)

This is in preparation for a larger refactor.
This commit is contained in:
Charles Dang 2018-03-29 20:33:00 +11:00
parent de48b9fbb1
commit 20a58fd8f8
7 changed files with 1 additions and 40 deletions

View file

@ -43,6 +43,7 @@
#include "desktop/clipboard.hpp"
#include "floating_label.hpp"
#include "game_board.hpp"
#include "help/help.hpp"
#include "preferences/game.hpp"
#include "gettext.hpp"
#include "image.hpp"
@ -73,14 +74,12 @@ editor_controller::editor_controller(const config &game_config)
, toolkit_(nullptr)
, tooltip_manager_()
, floating_label_manager_(nullptr)
, help_manager_(nullptr)
, do_quit_(false)
, quit_mode_(EXIT_ERROR)
, music_tracks_()
{
init_gui();
toolkit_.reset(new editor_toolkit(*gui_.get(), key_, game_config_, *context_manager_.get()));
help_manager_.reset(new help::help_manager(&game_config));
context_manager_->switch_context(0, true);
init_tods(game_config);
init_music(game_config);

View file

@ -22,7 +22,6 @@
#include "editor/toolkit/editor_toolkit.hpp"
#include "controller_base.hpp"
#include "help/help.hpp"
#include "hotkey/command_executor.hpp"
#include "mouse_handler_base.hpp"
#include "tooltips.hpp"
@ -256,8 +255,6 @@ class editor_controller : public controller_base,
tooltips::manager tooltip_manager_;
std::unique_ptr<font::floating_label_context> floating_label_manager_;
std::unique_ptr<help::help_manager> help_manager_;
/** Quit main loop flag */
bool do_quit_;
EXIT_STATUS quit_mode_;

View file

@ -281,7 +281,6 @@ void title_screen::pre_show(window& win)
// Help
//
register_button(win, "help", hotkey::HOTKEY_HELP, []() {
help::help_manager help_manager(&game_config_manager::get()->game_config());
help::show_help();
});
@ -332,9 +331,6 @@ void title_screen::pre_show(window& win)
// Addons
//
register_button(win, "addons", hotkey::TITLE_SCREEN__ADDONS, []() {
// NOTE: we need the help_manager to get access to the Add-ons section in the game help!
help::help_manager help_manager(&game_config_manager::get()->game_config());
if(manage_addons()) {
game_config_manager::get()->reload_changed_game_config();
}

View file

@ -74,28 +74,6 @@ void show_unit_description(const unit_type& t)
}
}
extern config dummy_cfg;
help_manager::help_manager(const config* cfg) //, gamemap *_map)
{
game_cfg = cfg == nullptr ? &dummy_cfg : cfg;
// map = _map;
}
help_manager::~help_manager()
{
game_cfg = nullptr;
// map = nullptr;
default_toplevel.clear();
hidden_sections.clear();
// These last numbers must be reset so that the content is regenerated.
// Upon next start.
last_num_encountered_units = -1;
last_num_encountered_terrains = -1;
}
void show_help(const std::string& show_topic)
{
show_help(default_toplevel, show_topic);

View file

@ -23,12 +23,6 @@ class unit_type;
namespace help
{
struct help_manager
{
help_manager(const config* game_config);
~help_manager();
};
struct section;
void init_help();

View file

@ -142,7 +142,6 @@ play_controller::play_controller(const config& level,
, whiteboard_manager_()
, plugins_context_()
, labels_manager_()
, help_manager_(&game_config)
, mouse_handler_(nullptr, *this)
, menu_handler_(nullptr, *this, game_config)
, hotkey_handler_(new hotkey_handler(*this, saved_game_))

View file

@ -19,7 +19,6 @@
#include "floating_label.hpp"
#include "game_end_exceptions.hpp"
#include "game_state.hpp"
#include "help/help.hpp"
#include "hotkey/command_executor.hpp"
#include "menu_events.hpp"
#include "mouse_events.hpp"
@ -425,7 +424,6 @@ protected:
// more managers
font::floating_label_context labels_manager_;
help::help_manager help_manager_;
events::mouse_handler mouse_handler_;
events::menu_handler menu_handler_;
std::unique_ptr<hotkey_handler> hotkey_handler_;