#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, CVideo &video, const bool jump_to_editor) | |
~game_config_manager () | |
const config & | game_config () const |
const preproc_map & | old_defines_map () const |
const tdata_cache & | terrain_types () const |
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) |
void | load_game_config_for_create (bool is_mp) |
Static Public Member Functions | |
static game_config_manager * | get () |
Private Member Functions | |
game_config_manager (const game_config_manager &) | |
void | operator= (const game_config_manager &) |
void | load_game_config (FORCE_RELOAD_CONFIG force_reload, game_classification const *classification=nullptr) |
void | load_game_config_with_loadscreen (FORCE_RELOAD_CONFIG force_reload, game_classification const *classification=nullptr) |
void | load_addons_cfg () |
void | set_multiplayer_hashes () |
void | set_color_info () |
void | set_unit_data () |
Private Attributes | |
const commandline_options & | cmdline_opts_ |
CVideo & | video_ |
const bool | jump_to_editor_ |
config | game_config_ |
preproc_map | old_defines_map_ |
filesystem::binary_paths_manager | paths_manager_ |
game_config::config_cache & | cache_ |
tdata_cache | tdata_ |
Definition at line 26 of file game_config_manager.hpp.
Enumerator | |
---|---|
FORCE_RELOAD |
Always reload config. |
NO_FORCE_RELOAD |
Dont reload if the previous defines equal the new defines. |
NO_INCLUDE_RELOAD |
Dont reload if the previous defines include the new defines. |
Definition at line 32 of file game_config_manager.hpp.
game_config_manager::game_config_manager | ( | const commandline_options & | cmdline_opts, |
CVideo & | video, | ||
const bool | jump_to_editor | ||
) |
Definition at line 47 of file game_config_manager.cpp.
References cache_, cmdline_opts_, commandline_options::nocache, game_config::config_cache::set_force_valid_cache(), game_config::config_cache::set_use_cache(), and commandline_options::validcache.
game_config_manager::~game_config_manager | ( | ) |
Definition at line 70 of file game_config_manager.cpp.
|
private |
|
inline |
Definition at line 42 of file game_config_manager.hpp.
References game_config_.
Referenced by ng::configure_engine::configure_engine(), saved_game::expand_scenario(), game_lua_kernel::impl_game_config_get(), ng::create_engine::init_extras(), init_game_config(), mp::initial_level_config(), load_game_config(), ng::create_engine::prepare_for_era_and_mods(), and mp::start_client().
|
static |
Definition at line 76 of file game_config_manager.cpp.
References singleton.
Referenced by replay_controller::add_replay_theme(), movetype::terrain_info::data::calc_value(), ng::configure_engine::configure_engine(), ng::create_engine::create_engine(), events::chat_command_handler::do_display(), do_gameloop(), enter_connect_mode(), sp::enter_create_mode(), enter_wait_mode(), saved_game::expand_scenario(), game_lua_kernel::impl_game_config_get(), ng::create_engine::init_all_levels(), ng::create_engine::init_extras(), mp::initial_level_config(), intf_get_era(), mp::wait::join_game(), game_launcher::launch_game(), game_launcher::load_game(), saved_game::load_mod(), help::load_terrain_types_data(), game_launcher::new_campaign(), game_launcher::play_multiplayer(), game_launcher::play_multiplayer_commandline(), game_launcher::play_render_image_mode(), game_launcher::play_replay(), game_launcher::play_screenshot_mode(), game_launcher::play_test(), ng::create_engine::prepare_for_era_and_mods(), ng::create_engine::prepare_for_saved_game(), mp::create::process_event_impl(), replay_controller::rebuild_replay_theme(), ng::scenario::set_metadata(), game_launcher::show_preferences(), mp::start_client(), game_launcher::start_editor(), mp::start_local_game_commandline(), and game_launcher::unit_test().
bool game_config_manager::init_game_config | ( | FORCE_RELOAD_CONFIG | force_reload | ) |
Definition at line 80 of file game_config_manager.cpp.
References config::child(), cmdline_opts_, hotkey::deactivate_all_scopes(), game_config::editor, game_config(), game_config_, ai::configuration::init(), init_textdomains(), jump_to_editor_, game_config::load_config(), load_game_config_with_loadscreen(), hotkey::load_hotkeys(), commandline_options::mptest, commandline_options::multiplayer, hotkey::SCOPE_MAIN_MENU, about::set_about(), hotkey::set_scope_active(), commandline_options::test, and test().
Referenced by reload_changed_game_config().
|
private |
Definition at line 339 of file game_config_manager.cpp.
References _n(), addon_source::addon_id, config::append(), cache_, config::child_or_empty(), config::child_range(), preferences::core_id(), gui2::twml_error::display(), config::empty(), filesystem::ENTIRE_FILE_PATH, lg::err(), ERR_CONFIG, filesystem::file_exists(), filesystem::FILE_NAME_ONLY, game_config_, get_addon_version_info(), filesystem::get_addons_dir(), game_config::config_cache::get_config(), filesystem::get_files_in_dir(), lg::info(), utils::join(), addon_source::main_cfg, game::error::message, report(), addon_source::version, and video_.
Referenced by load_game_config().
|
private |
Definition at line 142 of file game_config_manager.cpp.
References _(), config::add_child(), config::append(), cache_, game_classification::campaign, config::child_range(), config::clear_children(), cmdline_opts_, preferences::core_id(), filesystem::data_tree_checksum(), gui2::twml_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_, 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(), load_addons_cfg(), game_config::config_cache_transaction::lock(), game::error::message, game_config::no_addons, commandline_options::noaddons, old_defines_map_, game_config::path, paths_manager_, gui2::tloadscreen::progress(), set_color_info(), preferences::set_core_id(), theme::set_known_themes(), set_multiplayer_hashes(), filesystem::binary_paths_manager::set_paths(), terrain_builder::set_terrain_rules_cfg(), set_unit_data(), config::splice_children(), tdata_, and video_.
Referenced by load_game_config_with_loadscreen().
void game_config_manager::load_game_config_for_create | ( | bool | is_mp | ) |
During an mp game the default difficuly define is also defined so better already load it now if we alreeady must reload config cache.
Definition at line 550 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(), and game_launcher::play_multiplayer().
void game_config_manager::load_game_config_for_editor | ( | ) |
Definition at line 499 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 | ) |
Definition at line 505 of file game_config_manager.cpp.
References cache_, game_classification::campaign_define, game_classification::campaign_xtra_defines, game_config::config_cache::clear_defines(), cmdline_opts_, game_classification::difficulty, preferences::era(), game_classification::era_define, 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(), mp::wait::join_game(), ng::create_engine::prepare_for_saved_game(), mp::start_client(), and mp::start_local_game_commandline().
|
private |
Definition at line 121 of file game_config_manager.cpp.
References cache_, game_config::debug, gui2::tloadscreen::display(), config::empty(), game_config_, game_config::config_cache::get_preproc_map(), load_game_config(), game_config::mp_debug, NO_FORCE_RELOAD, NO_INCLUDE_RELOAD, old_defines_map_, and video_.
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 43 of file game_config_manager.hpp.
References old_defines_map_.
|
private |
void game_config_manager::reload_changed_game_config | ( | ) |
Definition at line 487 of file game_config_manager.cpp.
References cache_, filesystem::clear_binary_paths_cache(), FORCE_RELOAD, init_game_config(), old_defines_map_, game_config::config_cache::recheck_filetree_checksum(), and refresh_addon_version_info_cache().
Referenced by mp::start_client(), and game_launcher::start_editor().
|
private |
Definition at line 470 of file game_config_manager.cpp.
References game_config::add_color_info(), game_config_, and config::splice_children().
Referenced by load_game_config().
|
private |
Definition at line 462 of file game_config_manager.cpp.
References config::add_child(), config::child_range(), game_config_, and config::hash().
Referenced by load_game_config().
|
private |
Definition at line 478 of file game_config_manager.cpp.
References config::child(), game_config_, config::merge_children(), gui2::tloadscreen::progress(), unit_type_data::set_config(), unit_types, and resources::units.
Referenced by load_game_config().
|
inline |
Definition at line 44 of file game_config_manager.hpp.
References tdata_.
Referenced by movetype::terrain_info::data::calc_value(), and help::load_terrain_types_data().
|
private |
Definition at line 81 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 71 of file game_config_manager.hpp.
Referenced by game_config_manager(), init_game_config(), load_game_config(), load_game_config_for_create(), and load_game_config_for_game().
|
private |
Definition at line 75 of file game_config_manager.hpp.
Referenced by game_config(), init_game_config(), load_addons_cfg(), load_game_config(), load_game_config_with_loadscreen(), set_color_info(), set_multiplayer_hashes(), and set_unit_data().
|
private |
Definition at line 73 of file game_config_manager.hpp.
Referenced by init_game_config().
|
private |
Definition at line 77 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 79 of file game_config_manager.hpp.
Referenced by load_game_config().
|
private |
Definition at line 83 of file game_config_manager.hpp.
Referenced by load_game_config(), and terrain_types().
|
private |
Definition at line 72 of file game_config_manager.hpp.
Referenced by load_addons_cfg(), load_game_config(), and load_game_config_with_loadscreen().