Game configuration data as global variables. More...
Namespaces | |
colors | |
images | |
sounds | |
Classes | |
class | config_cache |
Singleton class to manage game config file caching. More... | |
class | config_cache_transaction |
Used to share macros between cache objects You have to create transaction object to load all macros to memory and share them subsequent cache loads. More... | |
class | fake_transaction |
Holds a fake cache transaction if no real one is used. More... | |
struct | optional_feature |
class | scoped_preproc_define_internal |
Used to set and unset scoped defines to preproc_map. More... | |
struct | server_info |
Typedefs | |
typedef scoped_preproc_define_internal < config_cache > | scoped_preproc_define |
Enumerations | |
enum | LIBRARY_ID { LIB_BOOST, LIB_CAIRO, LIB_PANGO, LIB_SDL, LIB_SDL_IMAGE, LIB_SDL_MIXER, LIB_SDL_TTF, LIB_SDL_NET, LIB_PNG, LIB_COUNT } |
Functions | |
std::vector< optional_feature > | optional_features_table () |
Return a localized features table. More... | |
const std::string & | library_build_version (LIBRARY_ID lib) |
Retrieve the build-time version number of the given library. More... | |
const std::string & | library_runtime_version (LIBRARY_ID lib) |
Retrieve the runtime version number of the given library. More... | |
const std::string & | library_name (LIBRARY_ID lib) |
Retrieve the user-visible name for the given library. More... | |
std::string | library_versions_report () |
Produce a plain-text report of library versions suitable for stdout/stderr. More... | |
std::string | optional_features_report () |
Produce a plain-text report of features suitable for stdout/stderr. More... | |
void | load_config (const config &v) |
void | add_color_info (const config &v) |
const color_range & | color_info (const std::string &name) |
const std::vector< Uint32 > & | tc_info (const std::string &name) |
Uint32 | red_to_green (int val, bool for_text=true) |
Return a color corresponding to the value val red for val=0 to green for val=100, passing by yellow. More... | |
Uint32 | blue_to_white (int val, bool for_text) |
std::string | get_default_title_string () |
int | kill_xp (int level) |
Game configuration data as global variables.
This module can be used to load various high level game configuration data from a .cfg file. The loaded data will subsequently be accessible via the global variables.
Definition at line 77 of file config_cache.hpp.
Enumerator | |
---|---|
LIB_BOOST | |
LIB_CAIRO | |
LIB_PANGO | |
LIB_SDL | |
LIB_SDL_IMAGE | |
LIB_SDL_MIXER | |
LIB_SDL_TTF | |
LIB_SDL_NET | |
LIB_PNG | |
LIB_COUNT |
Definition at line 24 of file build_info.hpp.
Definition at line 334 of file game_config.cpp.
References config::child_range(), ERR_NG, error(), LOG_NG, palette(), and string2rgb().
Referenced by unit::apply_builtin_effect(), unit_type::build_full(), ng::connect_engine::connect_engine(), mp::wait::join_game(), load_config(), play_controller::play_controller(), game_config_manager::set_color_info(), and unit::unit().
Definition at line 415 of file game_config.cpp.
References blue_white_scale.
Referenced by unit_weapons().
const color_range & game_config::color_info | ( | const std::string & | name | ) |
Definition at line 377 of file game_config.cpp.
References _(), error(), i, and string2rgb().
Referenced by BOOST_AUTO_TEST_CASE(), display::draw_minimap_units(), image::getMinimap(), and color_range::index().
std::string game_config::get_default_title_string | ( | ) |
Definition at line 423 of file game_config.cpp.
Referenced by game_launcher::change_language(), game_launcher::init_video(), editor::context_manager::set_window_title(), and editor::context_manager::~context_manager().
Definition at line 45 of file game_config.hpp.
Referenced by ai::attack_analysis::analyze(), and ai::simulated_attack().
const std::string & game_config::library_build_version | ( | LIBRARY_ID | lib | ) |
Retrieve the build-time version number of the given library.
Definition at line 233 of file build_info.cpp.
References LIB_COUNT.
Referenced by gui2::tgame_version::tgame_version().
const std::string & game_config::library_name | ( | LIBRARY_ID | lib | ) |
Retrieve the user-visible name for the given library.
Definition at line 251 of file build_info.cpp.
References LIB_COUNT.
Referenced by gui2::tgame_version::tgame_version().
const std::string & game_config::library_runtime_version | ( | LIBRARY_ID | lib | ) |
Retrieve the runtime version number of the given library.
Definition at line 242 of file build_info.cpp.
References LIB_COUNT.
Referenced by gui2::tgame_version::tgame_version().
std::string game_config::library_versions_report | ( | ) |
Produce a plain-text report of library versions suitable for stdout/stderr.
Definition at line 277 of file build_info.cpp.
References compiled, LIB_COUNT, and linked.
Referenced by gui2::tgame_version::generate_plain_text_report(), and process_command_args().
Definition at line 191 of file game_config.cpp.
References add_color_info(), game_config::server_info::address, game_config::colors::ally_orb_color, config::child(), config::child_range(), game_config::images::editor_brush, game_config::images::ellipsis, game_config::colors::enemy_orb_color, game_config::images::energy, ERR_NG, game_config::images::flag, game_config::images::flag_icon, game_config::sounds::friend_message, game_config::sounds::game_has_begun, game_config::images::game_title, game_config::images::game_title_background, game_config::sounds::game_user_arrive, game_config::sounds::game_user_leave, config::get(), game_config::images::grid_bottom, game_config::images::grid_top, i, game_config::images::linger, game_config::images::missing, game_config::images::mouseover, game_config::colors::moved_orb_color, game_config::server_info::name, game_config::images::observer, game_config::images::orb, game_config::colors::partial_orb_color, game_config::sounds::status::petrified, game_config::sounds::player_joins, game_config::sounds::player_leaves, game_config::sounds::status::poisoned, game_config::sounds::private_message, game_config::sounds::public_message, game_config::sounds::ready_for_start, game_config::images::selected, game_config::sounds::server_message, game_config::sounds::status::slowed, utils::split(), string2rgb(), game_config::images::terrain_mask, game_config::sounds::timer_bell, game_config::images::tod_bright, game_config::images::tod_dark, game_config::sounds::turn_bell, game_config::colors::unmoved_orb_color, and game_config::images::unreachable.
Referenced by BOOST_AUTO_TEST_CASE(), test_utils::game_config_manager::game_config_manager(), game_config_manager::init_game_config(), and game_lua_kernel::initialize().
std::string game_config::optional_features_report | ( | ) |
Produce a plain-text report of features suitable for stdout/stderr.
Definition at line 317 of file build_info.cpp.
References game_config::optional_feature::enabled, features, game_config::optional_feature::name, and optional_features_table().
Referenced by gui2::tgame_version::generate_plain_text_report(), and process_command_args().
std::vector< optional_feature > game_config::optional_features_table | ( | ) |
Return a localized features table.
Definition at line 223 of file build_info.cpp.
References _().
Referenced by optional_features_report().
Return a color corresponding to the value val red for val=0 to green for val=100, passing by yellow.
Colors are defined by [game_config] keys red_green_scale and red_green_scale_text
Definition at line 407 of file game_config.cpp.
References red_green_scale.
Referenced by game_display::draw_movement_info(), gui2::set_weapon_info(), unit_defense(), and unit_weapons().
const std::vector< uint32_t > & game_config::tc_info | ( | const std::string & | name | ) |
Definition at line 391 of file game_config.cpp.
References ERR_NG, i, and string2rgb().
Referenced by BOOST_AUTO_TEST_CASE(), gui2::tlabel_settings::pre_show(), and gui2::unit_mode_controller::show_stuff_list().
int game_config::base_income = 2 |
Definition at line 37 of file game_config.cpp.
Referenced by team::base_income(), game_lua_kernel::impl_game_config_get(), game_lua_kernel::impl_game_config_set(), game_lua_kernel::intf_modify_side(), and team::set_base_income().
|
static |
Definition at line 124 of file game_config.cpp.
Referenced by blue_to_white().
|
static |
Definition at line 125 of file game_config.cpp.
int game_config::cache_compression_level = 6 |
Definition at line 66 of file game_config.cpp.
Referenced by game_config::config_cache::write_file().
bool game_config::debug = false |
Definition at line 62 of file game_config.cpp.
Referenced by playsingle_controller::hotkey_handler::can_execute_command(), ng::configure_engine::configure_engine(), mp::connect::connect(), ng::connect_engine::connect_engine(), mp::create::create(), make_enum_detail::debug_conversion_error(), game_display::debug_highlight(), help::description_type(), ai::readonly_context_impl::diagnostic(), gui2::tlua_interpreter::display(), addon_info::display_icon(), events::console_handler::do_debug(), do_gameloop(), events::console_handler::do_nodebug(), game_display::draw_hex(), display::draw_hex(), gui2::tgame_load::evaluate_summary_string(), ai::default_recruitment::recruitment::execute(), game_launcher::game_launcher(), ai::manager::get_active_ai_holder_for_side_dbg(), ai::holder::get_component(), help::help_text_area::handle_ref_cfg(), game_lua_kernel::impl_game_config_get(), intf_debug_ai(), events::console_handler::is_enabled(), game_config_manager::load_game_config_with_loadscreen(), image::load_image_file(), ai::readonly_context_impl::log_message(), help::terrain_topic_generator::operator()(), campaign_controller::play_game(), ai::engine_lua::push_ai_table(), game_logic::formula_debugger::show_gui(), help::show_help(), ai::default_recruitment::recruitment::show_important_hexes(), events::menu_handler::status_table(), and display::update_display().
bool game_config::debug_lua = false |
Definition at line 62 of file game_config.cpp.
Referenced by game_lua_kernel::impl_game_config_get(), lua_kernel_base::intf_require(), and process_command_args().
std::string game_config::default_defeat_music |
Definition at line 68 of file game_config.cpp.
Referenced by play_controller::set_defeat_music_list().
std::string game_config::default_preferences_path = "" |
Definition at line 186 of file game_config.cpp.
Referenced by filesystem::get_default_prefs_file().
std::string game_config::default_terrain |
Definition at line 49 of file game_config.cpp.
Referenced by editor::context_manager::create_default_context(), and terrain_type_data::get_terrain_info().
const std::string game_config::default_title_string |
std::string game_config::default_victory_music |
Definition at line 68 of file game_config.cpp.
Referenced by play_controller::set_victory_music_list().
bool game_config::disable_autosave = false |
Definition at line 64 of file game_config.cpp.
Referenced by playsingle_controller::before_human_turn(), and events::console_handler::do_nosaves().
bool game_config::editor = false |
Definition at line 62 of file game_config.cpp.
Referenced by game_config_manager::init_game_config(), game_config_manager::load_game_config_for_editor(), editor::start(), and use_color_cursors().
bool game_config::exit_at_end = false |
Definition at line 63 of file game_config.cpp.
Referenced by playsingle_controller::play_scenario().
std::string game_config::flag_rgb |
Definition at line 120 of file game_config.cpp.
Referenced by display::init_flags_for_side_internal(), REPORT_GENERATOR(), and unit_side().
std::string game_config::fog_prefix |
Definition at line 118 of file game_config.cpp.
Referenced by display::display(), and display::get_fog_shroud_images().
std::vector< std::string > game_config::foot_speed_prefix |
Definition at line 132 of file game_config.cpp.
Referenced by footsteps_images().
std::string game_config::foot_teleport_enter |
Definition at line 133 of file game_config.cpp.
Referenced by footsteps_images().
std::string game_config::foot_teleport_exit |
Definition at line 134 of file game_config.cpp.
Referenced by footsteps_images().
const int game_config::gold_carryover_percentage = 80 |
Default percentage gold carried over to the next scenario.
Definition at line 47 of file game_config.cpp.
Referenced by team::team_info::read().
double game_config::hex_brightening = 1.25 |
Definition at line 130 of file game_config.cpp.
Referenced by image::get_brightened(), and image::simplify_type().
double game_config::hex_semi_brightening |
double game_config::hp_bar_scaling = 0.666 |
Definition at line 127 of file game_config.cpp.
Referenced by unit_type::build_full().
bool game_config::ignore_replay_errors = false |
Definition at line 63 of file game_config.cpp.
Referenced by events::console_handler::do_ignore_replay_errors(), and play_controller::process_oos().
int game_config::kill_experience = 8 |
Definition at line 43 of file game_config.cpp.
Referenced by game_lua_kernel::impl_game_config_get(), game_lua_kernel::impl_game_config_set(), and unit::xp_color().
std::string game_config::lobby_music |
Definition at line 68 of file game_config.cpp.
Referenced by mp::lobby::lobby().
unsigned game_config::lobby_network_timer = 100 |
Definition at line 45 of file game_config.cpp.
Referenced by gui2::tlobby_main::pre_show().
unsigned game_config::lobby_refresh = 4000 |
Definition at line 46 of file game_config.cpp.
Referenced by gui2::tlobby_main::network_handler(), and mp::ui::process_network().
const size_t game_config::max_loop = 65536 |
The maximum number of hexes on a map and items in an array and also used as maximum in wml loops.
WARNING : This should not be set to less than the max map area
Definition at line 147 of file game_config.cpp.
Referenced by game_events::t_pump::operator()(), and terrain_filter::restrict_size().
const version_info game_config::min_savegame_version |
Definition at line 177 of file game_config.hpp.
Referenced by savegame::loadgame::check_version_compatibility().
bool game_config::mp_debug = false |
Definition at line 63 of file game_config.cpp.
Referenced by replay::add_unit_checksum(), events::console_handler::do_debug(), do_gameloop(), game_launcher::game_launcher(), game_lua_kernel::impl_game_config_get(), and game_config_manager::load_game_config_with_loadscreen().
bool game_config::no_addons = false |
Definition at line 64 of file game_config.cpp.
Referenced by game_config_manager::load_game_config().
bool game_config::no_delay = false |
Definition at line 64 of file game_config.cpp.
Referenced by CVideo::delay(), game_launcher::game_launcher(), game_launcher::init_video(), and unit_animator::wait_for_end().
const std::string game_config::observer_team_name = "observer" |
observer team name used for observer team chat
Definition at line 145 of file game_config.cpp.
Referenced by wesnothd::game::process_turn(), and events::menu_handler::send_chat_message().
std::string game_config::path = "" |
Definition at line 180 of file game_config.cpp.
Referenced by campaignd::add_license(), BOOST_AUTO_TEST_CASE(), font::check_font_file(), test_utils::game_config_manager::game_config_manager(), game_launcher::game_launcher(), filesystem::get_binary_paths(), filesystem::get_default_prefs_file(), get_exploder_dir(), filesystem::get_files_in_dir(), filesystem::get_independent_image_path(), filesystem::get_intl_dir(), get_mask_dir(), hotkey::command_executor::get_menu_image(), filesystem::get_short_wml_path(), filesystem::get_wml_location(), handle_preprocess_command(), font::manager::init(), CVideo::initSDL(), game_config_manager::load_game_config(), gui::button::load_images(), image::localized_file_uptodate(), main(), open_font_impl(), process_command_args(), game_config::config_cache::read_cache(), hotkey::command_executor_default::set_button_state(), gui2::tpreferences::setup_hotkey_list(), gui2::tgame_version::tgame_version(), wesnoth_global_fixture::wesnoth_global_fixture(), and WESNOTH_PARAMETERIZED_TEST_CASE().
int game_config::poison_amount = 8 |
Definition at line 40 of file game_config.cpp.
Referenced by ai::attack_analysis::analyze(), battle_context::better_combat(), calculate_healing(), ai::ai_default_rca::get_healing_phase::evaluate(), ai::default_recruitment::attack_simulation::get_avg_hp_of_combatant(), game_lua_kernel::impl_game_config_get(), and game_lua_kernel::impl_game_config_set().
int game_config::recall_cost = 20 |
Definition at line 42 of file game_config.cpp.
Referenced by ai::default_recruitment::recruitment::get_appropriate_recall(), ai::default_recruitment::recruitment::get_cheapest_unit_cost_for_leader(), game_lua_kernel::impl_game_config_get(), game_lua_kernel::impl_game_config_set(), and team::team_info::read().
std::vector< uint32_t > game_config::red_green_scale |
Definition at line 121 of file game_config.cpp.
Referenced by red_to_green().
std::vector< uint32_t > game_config::red_green_scale_text |
Definition at line 122 of file game_config.cpp.
int game_config::rest_heal_amount = 2 |
Definition at line 41 of file game_config.cpp.
Referenced by calculate_healing(), game_lua_kernel::impl_game_config_get(), and game_lua_kernel::impl_game_config_set().
const std::string game_config::revision = VERSION |
Definition at line 57 of file game_config.cpp.
Referenced by game_config::config_cache::config_cache(), events::chat_command_handler::do_version(), gui2::tgame_version::generate_plain_text_report(), get_default_title_string(), ai_testing::log_game_start(), main(), gui2::tgame_version::pre_show(), and gui2::ttitle_screen::pre_show().
std::vector< server_info > game_config::server_list |
Definition at line 189 of file game_config.cpp.
Referenced by game_launcher::game_launcher(), and preferences::server_list().
bool game_config::show_ally_orb |
Definition at line 81 of file game_config.cpp.
Referenced by gui2::tselect_orb_colors::handle_reset_click(), and preferences::show_allied_orb().
bool game_config::show_enemy_orb |
Definition at line 81 of file game_config.cpp.
Referenced by gui2::tselect_orb_colors::handle_reset_click(), and preferences::show_enemy_orb().
bool game_config::show_moved_orb |
Definition at line 81 of file game_config.cpp.
Referenced by gui2::tselect_orb_colors::handle_reset_click(), and preferences::show_moved_orb().
bool game_config::show_partial_orb |
Definition at line 81 of file game_config.cpp.
Referenced by gui2::tselect_orb_colors::handle_reset_click(), and preferences::show_partial_orb().
bool game_config::show_unmoved_orb |
Definition at line 81 of file game_config.cpp.
Referenced by gui2::tselect_orb_colors::handle_reset_click(), and preferences::show_unmoved_orb().
std::string game_config::shroud_prefix |
Definition at line 118 of file game_config.cpp.
Referenced by display::display(), and display::get_fog_shroud_images().
std::map< std::string, std::vector< uint32_t > > game_config::team_rgb_colors |
Definition at line 139 of file game_config.cpp.
std::map< std::string, t_string > game_config::team_rgb_name |
Definition at line 137 of file game_config.cpp.
Referenced by mp::get_color_string().
std::map< std::string, color_range > game_config::team_rgb_range |
Definition at line 136 of file game_config.cpp.
Referenced by mp::get_color_string(), team::get_side_color_range(), and image::getMinimap().
const version_info game_config::test_version |
Definition at line 178 of file game_config.hpp.
Referenced by savegame::loadgame::check_version_compatibility().
int game_config::tile_size = 72 |
Definition at line 44 of file game_config.cpp.
Referenced by events::console_handler::do_layers(), image::get_lighted_image(), image::get_scaled_to_zoom(), display::get_zoom_factor(), display::hexes_under_rect(), image::load_image_sub_file(), editor::mouse_action::set_terrain_mouse_overlay(), image::set_zoom(), and image::simplify_type().
std::string game_config::title_music |
Definition at line 68 of file game_config.cpp.
Referenced by do_gameloop().
const std::string game_config::version = VERSION |
Definition at line 48 of file game_config.cpp.
Referenced by savegame::loadgame::check_version_compatibility(), doargs(), game_lua_kernel::impl_game_config_get(), mp::initial_level_config(), wesnothd::server::load_config(), lua_version(), main(), open_connection(), desktop::os_version(), process_command_args(), wesnothd::server::read_version(), refresh_addon_version_info_cache(), game_classification::to_config(), mp_game_settings::addon_version_info::write(), and savegame::savegame::write_game().
int game_config::village_income = 1 |
Definition at line 38 of file game_config.cpp.
Referenced by ai::default_recruitment::recruitment::get_estimated_income(), game_lua_kernel::impl_game_config_get(), game_lua_kernel::impl_game_config_set(), and team::team_info::read().
int game_config::village_support = 1 |
Definition at line 39 of file game_config.cpp.
Referenced by editor::context_manager::edit_side_dialog(), ai::default_recruitment::recruitment::get_estimated_income(), game_lua_kernel::impl_game_config_get(), game_lua_kernel::impl_game_config_set(), game_lua_kernel::intf_modify_side(), mp::configure::process_event_impl(), and team::team_info::read().
std::string game_config::wesnoth_program_dir |
Definition at line 61 of file game_config.cpp.
Referenced by do_gameloop(), and filesystem::get_program_invocation().
const version_info game_config::wesnoth_version |
Definition at line 176 of file game_config.hpp.
Referenced by savegame::loadgame::check_version_compatibility(), game_config::config_cache::clear_defines(), filesystem::get_version_path_suffix(), handle_preprocess_command(), and setup_test_preproc_map().
double game_config::xp_bar_scaling = 0.5 |
Definition at line 128 of file game_config.cpp.
Referenced by unit_type::build_full().