#include <game_config_manager.hpp>
Public Types | |
enum | FORCE_RELOAD_CONFIG { FORCE_RELOAD , NO_FORCE_RELOAD , NO_INCLUDE_RELOAD } |
Public Member Functions | |
game_config_manager (const commandline_options &cmdline_opts) | |
~game_config_manager () | |
game_config_manager (const game_config_manager &)=delete | |
game_config_manager & | operator= (const game_config_manager &)=delete |
const game_config_view & | game_config () const |
const preproc_map & | old_defines_map () const |
const std::shared_ptr< terrain_type_data > & | terrain_types () const |
std::vector< achievement_group > & | get_achievements () |
bool | init_game_config (FORCE_RELOAD_CONFIG force_reload) |
void | reload_changed_game_config () |
void | load_game_config_for_editor () |
void | load_game_config_for_game (const game_classification &classification, const std::string &scenario_id) |
void | load_game_config_for_create (bool is_mp, bool is_test=false) |
Static Public Member Functions | |
static game_config_manager * | get () |
Private Member Functions | |
void | set_enabled_addon (std::set< std::string > addon_ids) |
void | set_enabled_addon_all () |
void | load_game_config (bool reload_everything, const game_classification *classification, const std::string &scenario_id) |
void | load_game_config_with_loadscreen (FORCE_RELOAD_CONFIG force_reload, const game_classification *classification, const std::string &scenario_id) |
void | load_addons_cfg () |
void | set_multiplayer_hashes () |
void | set_unit_data () |
Private Attributes | |
const commandline_options & | cmdline_opts_ |
config | game_config_ |
game_config_view | game_config_view_ |
std::map< std::string, config > | addon_cfgs_ |
std::set< std::string > | active_addons_ |
preproc_map | old_defines_map_ |
filesystem::binary_paths_manager | paths_manager_ |
game_config::config_cache & | cache_ |
std::shared_ptr< terrain_type_data > | tdata_ |
achievements | achievements_ |
Friends | |
class | game_config_view |
Definition at line 28 of file game_config_manager.hpp.
Definition at line 38 of file game_config_manager.hpp.
game_config_manager::game_config_manager | ( | const commandline_options & | cmdline_opts | ) |
Definition at line 53 of file game_config_manager.cpp.
References commandline_options::any_validation_option(), cache_, game_config::config_cache::clean_cache(), cmdline_opts_, prefs::get(), commandline_options::nocache, game_config::config_cache::set_force_valid_cache(), game_config::config_cache::set_use_cache(), singleton, commandline_options::validcache, and game_config::wesnoth_version.
game_config_manager::~game_config_manager | ( | ) |
Definition at line 90 of file game_config_manager.cpp.
References singleton.
|
delete |
|
inline |
Definition at line 48 of file game_config_manager.hpp.
References game_config_view_.
Referenced by do_gameloop(), saved_game::expand_scenario(), mp::game_info::game_info(), init_game_config(), mp::initial_level_config(), load_game_config(), saved_game::set_defaults(), set_multiplayer_hashes(), set_unit_data(), and mp::start_local_game_commandline().
|
static |
Definition at line 96 of file game_config_manager.cpp.
References singleton.
Referenced by game_classification::active_addons(), gui2::dialogs::title_screen::button_callback_cores(), movetype::terrain_info::data::calc_value(), ng::create_engine::create_engine(), help::ensure_cache_lifecycle(), saved_game::expand_scenario(), gui2::dialogs::mp_join_game::fetch_game_config(), mp::game_info::game_info(), gamemap::gamemap(), gui2::dialogs::title_screen::hotkey_callback_select_tests(), gui2::dialogs::title_screen::init_callbacks(), mp::initial_level_config(), game_lua_kernel::intf_get_achievement(), intf_get_era(), intf_get_resource(), game_lua_kernel::intf_progress_achievement(), game_lua_kernel::intf_set_achievement(), game_lua_kernel::intf_set_sub_achievement(), game_launcher::launch_game(), game_launcher::load_game(), saved_game::load_non_scenario(), help::load_terrain_types_data(), game_launcher::play_multiplayer(), game_launcher::play_multiplayer_commandline(), game_launcher::play_render_image_mode(), game_launcher::play_screenshot_mode(), game_launcher::play_test(), gui2::dialogs::mp_create_game::post_show(), gui2::dialogs::achievements_dialog::pre_show(), ng::create_engine::prepare_for_saved_game(), gui2::dialogs::achievements_dialog::set_achievements_row(), saved_game::set_defaults(), game_launcher::single_unit_test(), game_launcher::start_editor(), and mp::start_local_game_commandline().
|
inline |
Definition at line 51 of file game_config_manager.hpp.
References achievements_, and achievements::get_list().
Referenced by gui2::dialogs::achievements_dialog::pre_show(), and gui2::dialogs::achievements_dialog::set_achievements_row().
bool game_config_manager::init_game_config | ( | FORCE_RELOAD_CONFIG | force_reload | ) |
Definition at line 101 of file game_config_manager.cpp.
References events::call_in_main_thread(), cmdline_opts_, commandline_options::editor, game_config::editor, game_config(), prefs::get(), ai::configuration::init(), init_textdomains(), prefs::load_advanced_prefs(), game_config::load_config(), hotkey::load_default_hotkeys(), load_game_config_with_loadscreen(), prefs::load_hotkeys(), commandline_options::mptest, commandline_options::multiplayer, game_config::reset_color_info(), hotkey::scope_main, about::set_about(), and commandline_options::test.
Referenced by do_gameloop(), and reload_changed_game_config().
|
private |
Definition at line 448 of file game_config_manager.cpp.
References _n(), addon_cfgs_, config::all_children_view(), config::append_children_by_move(), cache_, events::call_in_main_thread(), config::child_or_empty(), cmdline_opts_, gui2::dialogs::wml_error::display(), e, config::empty(), filesystem::ENTIRE_FILE_PATH, lg::err(), ERR_CONFIG, filesystem::file_exists(), filesystem::FILE_NAME_ONLY, game_config_, prefs::get(), get_addon_pbl_info(), filesystem::get_addons_dir(), game_config::config_cache::get_config(), filesystem::get_files_in_dir(), filesystem::get_short_wml_path(), filesystem::get_wml_location(), have_addon_pbl_info(), filesystem::is_cfg(), utils::join(), log_config, log_scope2, n, show_deprecated_warnings(), version_info::str(), commandline_options::validate_addon, validator, filesystem::wml_extension, and WRN_CONFIG.
Referenced by load_game_config().
|
private |
Definition at line 186 of file game_config_manager.cpp.
References _(), achievements_, game_classification::active_addons(), active_addons_, config::add_child(), game_config::add_color_info(), config::append(), cache_, events::call_in_main_thread(), config::child_range(), resources::classification, cmdline_opts_, create_cache, filesystem::data_tree_checksum(), gui2::dialogs::wml_error::display(), e, filesystem::ENTIRE_FILE_PATH, ERR_CONFIG, game_lua_kernel::extract_preload_scripts(), filesystem::file_exists(), config::find_child(), game_config(), game_config_, prefs::get(), filesystem::get_addons_dir(), game_config::config_cache::get_config(), filesystem::get_files_in_dir(), game_config::config_cache::get_preproc_map(), filesystem::get_wml_location(), init_strings(), utils::join(), load_addons_cfg(), game_config::config_cache_transaction::lock(), LOG_CONFIG, game_config::no_addons, commandline_options::noaddons, old_defines_map_, game_config::path, paths_manager_, gui2::dialogs::loading_screen::progress(), achievements::reload(), set_enabled_addon(), set_enabled_addon_all(), theme::set_known_themes(), set_multiplayer_hashes(), filesystem::binary_paths_manager::set_paths(), terrain_builder::set_terrain_rules_cfg(), set_unit_data(), tdata_, commandline_options::validate_core, validator, and verify_cache.
Referenced by load_game_config_with_loadscreen().
void game_config_manager::load_game_config_for_create | ( | bool | is_mp, |
bool | is_test = false |
||
) |
During an mp game the default difficulty define is also defined so better already load it now if we already must reload config cache.
Definition at line 735 of file game_config_manager.cpp.
References cache_, game_config::config_cache::clear_defines(), cmdline_opts_, DEFAULT_DIFFICULTY, game_config::config_cache::get_preproc_map(), load_game_config_with_loadscreen(), commandline_options::mptest, NO_FORCE_RELOAD, NO_INCLUDE_RELOAD, and old_defines_map_.
Referenced by ng::create_engine::create_engine(), gui2::dialogs::title_screen::hotkey_callback_select_tests(), game_launcher::play_multiplayer(), and game_launcher::play_multiplayer_commandline().
void game_config_manager::load_game_config_for_editor | ( | ) |
Definition at line 678 of file game_config_manager.cpp.
References game_config::editor, load_game_config_with_loadscreen(), and NO_FORCE_RELOAD.
Referenced by game_launcher::play_screenshot_mode(), and game_launcher::start_editor().
void game_config_manager::load_game_config_for_game | ( | const game_classification & | classification, |
const std::string & | scenario_id | ||
) |
Definition at line 684 of file game_config_manager.cpp.
References cache_, events::call_in_main_thread(), game_classification::campaign_define, game_classification::campaign_xtra_defines, resources::classification, game_config::config_cache::clear_defines(), cmdline_opts_, game_classification::difficulty, game_classification::era_define, image::flush_cache(), game_classification::is_multiplayer(), load_game_config_with_loadscreen(), game_classification::mod_defines, commandline_options::mptest, NO_FORCE_RELOAD, old_defines_map_, and game_classification::scenario_define.
Referenced by saved_game::expand_scenario(), gui2::dialogs::mp_join_game::fetch_game_config(), game_launcher::launch_game(), game_launcher::load_game(), game_launcher::play_render_image_mode(), game_launcher::play_test(), ng::create_engine::prepare_for_saved_game(), game_launcher::single_unit_test(), and mp::start_local_game_commandline().
|
private |
Definition at line 148 of file game_config_manager.cpp.
References cache_, resources::classification, game_config::debug, gui2::dialogs::loading_screen::display(), config::empty(), FORCE_LOG_TO, game_config_, game_config::config_cache::get_preproc_map(), lg::info(), load_game_config(), log_config, LOG_CONFIG, game_config::mp_debug, NO_FORCE_RELOAD, NO_INCLUDE_RELOAD, and old_defines_map_.
Referenced by init_game_config(), load_game_config_for_create(), load_game_config_for_editor(), and load_game_config_for_game().
|
inline |
Definition at line 49 of file game_config_manager.hpp.
References old_defines_map_.
|
delete |
void game_config_manager::reload_changed_game_config | ( | ) |
Definition at line 663 of file game_config_manager.cpp.
References cache_, filesystem::clear_binary_paths_cache(), image::flush_cache(), sound::flush_cache(), FORCE_RELOAD, init_game_config(), old_defines_map_, game_config::config_cache::recheck_filetree_checksum(), and refresh_addon_version_info_cache().
Referenced by do_gameloop(), and game_launcher::start_editor().
|
private |
Definition at line 759 of file game_config_manager.cpp.
References addon_cfgs_, game_config_view::data(), ERR_CONFIG, game_config_, game_config_view_, id, and LOG_CONFIG.
Referenced by load_game_config().
|
private |
Definition at line 776 of file game_config_manager.cpp.
References active_addons_, addon_cfgs_, game_config_view::data(), game_config_, game_config_view_, and LOG_CONFIG.
Referenced by load_game_config().
|
private |
Definition at line 649 of file game_config_manager.cpp.
References config::add_child(), game_config(), game_config_, and config::hash().
Referenced by load_game_config().
|
private |
Definition at line 657 of file game_config_manager.cpp.
References game_config(), load_unit_types, gui2::dialogs::loading_screen::progress(), unit_type_data::set_config(), and unit_types.
Referenced by load_game_config().
|
inline |
Definition at line 50 of file game_config_manager.hpp.
References tdata_.
Referenced by movetype::terrain_info::data::calc_value(), and help::load_terrain_types_data().
|
friend |
Definition at line 30 of file game_config_manager.hpp.
|
private |
Definition at line 91 of file game_config_manager.hpp.
Referenced by get_achievements(), and load_game_config().
|
private |
Definition at line 81 of file game_config_manager.hpp.
Referenced by load_game_config(), and set_enabled_addon_all().
|
private |
Definition at line 80 of file game_config_manager.hpp.
Referenced by load_addons_cfg(), set_enabled_addon(), and set_enabled_addon_all().
|
private |
Definition at line 87 of file game_config_manager.hpp.
Referenced by game_config_manager(), load_addons_cfg(), load_game_config(), load_game_config_for_create(), load_game_config_for_game(), load_game_config_with_loadscreen(), and reload_changed_game_config().
|
private |
Definition at line 75 of file game_config_manager.hpp.
Referenced by game_config_manager(), init_game_config(), load_addons_cfg(), load_game_config(), load_game_config_for_create(), and load_game_config_for_game().
|
private |
Definition at line 77 of file game_config_manager.hpp.
Referenced by load_addons_cfg(), load_game_config(), load_game_config_with_loadscreen(), set_enabled_addon(), set_enabled_addon_all(), and set_multiplayer_hashes().
|
private |
Definition at line 78 of file game_config_manager.hpp.
Referenced by game_config(), set_enabled_addon(), and set_enabled_addon_all().
|
private |
Definition at line 83 of file game_config_manager.hpp.
Referenced by load_game_config(), load_game_config_for_create(), load_game_config_for_game(), load_game_config_with_loadscreen(), old_defines_map(), and reload_changed_game_config().
|
private |
Definition at line 85 of file game_config_manager.hpp.
Referenced by load_game_config().
|
private |
Definition at line 89 of file game_config_manager.hpp.
Referenced by load_game_config(), and terrain_types().