#include <game_launcher.hpp>
Public Types | |
enum | RELOAD_GAME_DATA { RELOAD_DATA, NO_RELOAD_DATA } |
Public Member Functions | |
game_launcher (const commandline_options &cmdline_opts, const char *appname) | |
~game_launcher () | |
CVideo & | video () |
bool | init_video () |
bool | init_language () |
bool | init_joystick () |
bool | init_lua_script () |
bool | play_test () |
bool | play_screenshot_mode () |
bool | play_render_image_mode () |
int | unit_test () |
bool | is_loading () const |
void | clear_loaded_game () |
bool | load_game () |
void | set_tutorial () |
std::string | jump_to_campaign_id () const |
bool | new_campaign () |
bool | goto_campaign () |
bool | goto_multiplayer () |
bool | goto_editor () |
bool | jump_to_editor () const |
bool | play_multiplayer () |
bool | play_multiplayer_commandline () |
bool | change_language () |
void | show_preferences () |
void | launch_game (RELOAD_GAME_DATA reload=RELOAD_DATA) |
void | play_replay () |
editor::EXIT_STATUS | start_editor () |
void | start_wesnothd () |
const commandline_options & | opts () const |
Private Member Functions | |
game_launcher (const game_launcher &) | |
void | operator= (const game_launcher &) |
void | mark_completed_campaigns (std::vector< config > &campaigns) |
editor::EXIT_STATUS | start_editor (const std::string &filename) |
Private Attributes | |
const commandline_options & | cmdline_opts_ |
boost::scoped_ptr< CVideo > | video_ |
const font::manager | font_manager_ |
const preferences::manager | prefs_manager_ |
const image::manager | image_manager_ |
const events::event_context | main_event_context_ |
const hotkey::manager | hotkey_manager_ |
sound::music_thinker | music_thinker_ |
std::string | test_scenario_ |
std::string | screenshot_map_ |
std::string | screenshot_filename_ |
saved_game | state_ |
bool | play_replay_ |
std::string | multiplayer_server_ |
bool | jump_to_multiplayer_ |
jump_to_campaign_info | jump_to_campaign_ |
bool | jump_to_editor_ |
Definition at line 53 of file game_launcher.hpp.
Enumerator | |
---|---|
RELOAD_DATA | |
NO_RELOAD_DATA |
Definition at line 90 of file game_launcher.hpp.
game_launcher::game_launcher | ( | const commandline_options & | cmdline_opts, |
const char * | appname | ||
) |
Definition at line 106 of file game_launcher.cpp.
References preferences::_set_maximized(), preferences::_set_resolution(), filesystem::base_name(), commandline_options::campaign, commandline_options::campaign_difficulty, jump_to_campaign_info::campaign_id_, commandline_options::campaign_scenario, commandline_options::clock, cmdline_opts_, commandline_options::core_id, game_config::debug, commandline_options::debug, jump_to_campaign_info::difficulty_, preferences::disable_preferences_save(), commandline_options::editor, font_manager_, commandline_options::fps, commandline_options::fullscreen, game::load_game_exception::game, filesystem::get_cwd(), commandline_options::headless_unit_test, if(), jump_to_campaign_info::jump_, jump_to_campaign_, jump_to_editor_, jump_to_multiplayer_, commandline_options::load, commandline_options::max_fps, game_config::mp_debug, multiplayer_server_, preferences::network_host(), gui2::new_widgets, commandline_options::new_widgets, game_config::no_delay, commandline_options::nodelay, commandline_options::nogui, commandline_options::nomusic, commandline_options::nosound, game_config::path, commandline_options::resolution, jump_to_campaign_info::scenario_id_, commandline_options::screenshot, screenshot_filename_, screenshot_map_, commandline_options::screenshot_map_file, commandline_options::screenshot_output_file, commandline_options::server, game_config::server_list, preferences::set_core_id(), preferences::set_draw_delay(), CVideo::set_fullscreen(), preferences::set_level(), preferences::set_show_fps(), gui2::show_debug_clock_button, font::manager::update_font_path(), and video().
game_launcher::~game_launcher | ( | ) |
Definition at line 1050 of file game_launcher.cpp.
References sound::close_sound(), and gui::dialog::delete_empty_menu().
|
private |
bool game_launcher::change_language | ( | ) |
Definition at line 956 of file game_launcher.cpp.
References cmdline_opts_, game_config::get_default_title_string(), gui2::tdialog::get_retval(), commandline_options::headless_unit_test, commandline_options::nogui, gui2::twindow::OK, CVideo::set_window_title(), gui2::tdialog::show(), and video().
|
inline |
Definition at line 72 of file game_launcher.hpp.
References game::load_game_exception::game.
Referenced by goto_editor(), launch_game(), load_game(), play_replay(), and unit_test().
bool game_launcher::goto_campaign | ( | ) |
Definition at line 738 of file game_launcher.cpp.
References jump_to_campaign_info::jump_, jump_to_campaign_, launch_game(), new_campaign(), and NO_RELOAD_DATA.
bool game_launcher::goto_editor | ( | ) |
Definition at line 765 of file game_launcher.cpp.
References clear_loaded_game(), editor::EXIT_QUIT_TO_DESKTOP, game::load_game_exception::game, jump_to_editor_, filesystem::normalize_path(), and start_editor().
bool game_launcher::goto_multiplayer | ( | ) |
Definition at line 752 of file game_launcher.cpp.
References jump_to_multiplayer_, and play_multiplayer().
bool game_launcher::init_joystick | ( | ) |
Definition at line 290 of file game_launcher.cpp.
References i, and preferences::joystick_support_enabled().
bool game_launcher::init_language | ( | ) |
Definition at line 313 of file game_launcher.cpp.
References cmdline_opts_, get_languages(), get_locale(), commandline_options::language, load_language_list(), language_def::localename, and translation::set_language().
bool game_launcher::init_lua_script | ( | ) |
Definition at line 368 of file game_launcher.cpp.
References plugins_manager::add_plugin(), cmdline_opts_, e, error(), plugins_manager::get(), plugins_manager::get_detailed_status(), plugins_manager::get_kernel_base(), plugins_manager::get_name(), i, filesystem::istream_file(), jump_to_campaign_info::jump_, jump_to_campaign_, jump_to_editor_, jump_to_multiplayer_, lua_kernel_base::load_package(), plugins_context::play_slice(), commandline_options::plugin_file, lua_kernel_base::run(), commandline_options::script_file, commandline_options::script_unsafe_mode, gui2::show_error_message(), plugins_manager::start_plugin(), and video().
Referenced by handle_lua_script_args().
bool game_launcher::init_video | ( | ) |
Definition at line 339 of file game_launcher.cpp.
References cmdline_opts_, game_config::get_default_title_string(), image::get_image(), commandline_options::headless_unit_test, CVideo::init_window(), CVideo::make_fake(), commandline_options::multiplayer, game_config::no_delay, commandline_options::nogui, commandline_options::plugin_file, commandline_options::screenshot, CVideo::set_window_icon(), CVideo::set_window_title(), image::UNSCALED, and video().
bool game_launcher::is_loading | ( | ) | const |
Definition at line 622 of file game_launcher.cpp.
References game::load_game_exception::game.
std::string game_launcher::jump_to_campaign_id | ( | ) | const |
Definition at line 733 of file game_launcher.cpp.
References jump_to_campaign_info::campaign_id_, and jump_to_campaign_.
|
inline |
Definition at line 82 of file game_launcher.hpp.
References jump_to_editor_.
void game_launcher::launch_game | ( | RELOAD_GAME_DATA | reload = RELOAD_DATA | ) |
Definition at line 975 of file game_launcher.cpp.
References preferences::add_completed_campaign(), game_classification::campaign, saved_game::classification(), clear_loaded_game(), game_classification::difficulty, gui2::tloadscreen::display(), e, game_classification::end_credits, game_classification::end_text, game_classification::end_text_duration, game_config_manager::get(), game_classification::is_normal_mp_game(), campaign_controller::play_game(), play_replay(), play_replay_, gui2::tloadscreen::progress(), RELOAD_DATA, twml_exception::show(), about::show_about(), state_, the_end(), and video().
Referenced by goto_campaign().
bool game_launcher::load_game | ( | ) |
Definition at line 627 of file game_launcher.cpp.
References _(), savegame::loadgame::cancel_orders(), game::load_game_exception::cancel_orders, saved_game::cancel_orders(), saved_game::classification(), statistics::clear_current_scenario(), clear_loaded_game(), DBG_GENERAL, game::load_game_exception::difficulty, e, game::load_game_exception::game, game_config_manager::get(), saved_game::is_mid_game_save(), floating_point_emulation::detail::load(), savegame::loadgame::load_game(), LOG_CONFIG, game::error::message, play_replay_, game::load_game_exception::select_difficulty, savegame::loadgame::set_gamestate(), twml_exception::show(), gui2::show_error_message(), savegame::loadgame::show_replay(), game::load_game_exception::show_replay, game::load_game_exception::skip_version_check, state_, saved_game::unify_controllers(), and video().
Referenced by unit_test().
Definition at line 715 of file game_launcher.cpp.
References preferences::is_campaign_completed().
bool game_launcher::new_campaign | ( | ) |
Definition at line 722 of file game_launcher.cpp.
References saved_game::classification(), sp::enter_create_mode(), game_config_manager::get(), jump_to_campaign_, saved_game::mp_settings(), play_replay_, ng::depcheck::SCENARIO, mp_game_settings::show_connect, state_, and video().
Referenced by goto_campaign().
|
private |
|
inline |
Definition at line 98 of file game_launcher.hpp.
References cmdline_opts_.
bool game_launcher::play_multiplayer | ( | ) |
Definition at line 815 of file game_launcher.cpp.
References _(), saved_game::classification(), events::discard_input(), e, ERR_CONFIG, ERR_NET, gui2::tmp_host_game_prompt::execute(), game_config_manager::get(), gui2::tmp_method_selection::get_choice(), gui2::tdialog::get_retval(), translation::gettext(), game_config_manager::load_game_config_for_create(), game::error::message, preferences::mp_server_warning_disabled(), multiplayer_server_, cursor::NORMAL, gui2::twindow::OK, preferences::server_list(), cursor::set(), twml_exception::show(), gui2::tdialog::show(), gui2::show_error_message(), gui2::show_transient_message(), preferences::show_wesnothd_server_search(), mp::start_client(), mp::start_local_game(), start_wesnothd(), state_, and video().
Referenced by do_gameloop(), and goto_multiplayer().
bool game_launcher::play_multiplayer_commandline | ( | ) |
Definition at line 932 of file game_launcher.cpp.
References saved_game::classification(), cmdline_opts_, DBG_MP, events::discard_input(), game_config_manager::get(), commandline_options::multiplayer, cursor::NORMAL, cursor::set(), mp::start_local_game_commandline(), state_, and video().
bool game_launcher::play_render_image_mode | ( | ) |
Definition at line 590 of file game_launcher.cpp.
References saved_game::classification(), cmdline_opts_, DBG_GENERAL, e, game_config_manager::get(), commandline_options::render_image, commandline_options::render_image_dst, image::save_image(), state_, and game::error::what().
void game_launcher::play_replay | ( | ) |
Definition at line 1017 of file game_launcher.cpp.
References clear_loaded_game(), e, game_config_manager::get(), campaign_controller::play_replay(), twml_exception::show(), state_, and video().
Referenced by launch_game().
bool game_launcher::play_screenshot_mode | ( | ) |
Definition at line 575 of file game_launcher.cpp.
References cmdline_opts_, game_config_manager::get(), init_textdomains(), game_config_manager::load_game_config_for_editor(), commandline_options::screenshot, screenshot_filename_, screenshot_map_, editor::start(), and video().
bool game_launcher::play_test | ( | ) |
Definition at line 460 of file game_launcher.cpp.
References game_classification::campaign_define, saved_game::classification(), cmdline_opts_, game_config_manager::get(), mp_game_settings::mp_era, saved_game::mp_settings(), campaign_controller::play_game(), saved_game::set_carryover_sides_start(), mp_game_settings::show_connect, state_, commandline_options::test, test_scenario_, and video().
void game_launcher::set_tutorial | ( | ) |
Definition at line 702 of file game_launcher.cpp.
References game_classification::campaign_define, saved_game::classification(), mp_game_settings::mp_era, saved_game::mp_settings(), saved_game::set_carryover_sides_start(), mp_game_settings::show_connect, and state_.
void game_launcher::show_preferences | ( | ) |
Definition at line 969 of file game_launcher.cpp.
References game_config_manager::get(), preferences::show_preferences_dialog(), and video().
|
inline |
Definition at line 94 of file game_launcher.hpp.
References start_editor().
Referenced by goto_editor(), and start_editor().
|
private |
Definition at line 1031 of file game_launcher.cpp.
References editor::EXIT_ERROR, editor::EXIT_RELOAD_DATA, image::flush_cache(), game_config_manager::get(), init_textdomains(), game_config_manager::load_game_config_for_editor(), game_config_manager::reload_changed_game_config(), editor::start(), and video().
void game_launcher::start_wesnothd | ( | ) |
Definition at line 779 of file game_launcher.cpp.
References filesystem::file_exists(), preferences::get_mp_server_program_name(), filesystem::get_program_invocation(), filesystem::get_user_config_dir(), filesystem::get_wml_location(), LOG_GENERAL, filesystem::read_file(), preferences::set_mp_server_program_name(), filesystem::write_file(), and WRN_GENERAL.
Referenced by play_multiplayer().
int game_launcher::unit_test | ( | ) |
Definition at line 498 of file game_launcher.cpp.
References lg::broke_strict(), game_classification::campaign_define, game::load_game_exception::cancel_orders, saved_game::classification(), savegame::clean_saves(), clear_loaded_game(), cmdline_opts_, twml_exception::dev_message, e, game::load_game_exception::game, game_config_manager::get(), game_classification::label, load_game(), compression::NONE, commandline_options::noreplaycheck, campaign_controller::play_game(), campaign_controller::play_replay(), save(), savegame::savegame::save_game_automatic(), saved_game::set_carryover_sides_start(), game::load_game_exception::show_replay, state_, test_scenario_, commandline_options::unit_test, and video().
|
inline |
Definition at line 59 of file game_launcher.hpp.
References video_.
Referenced by change_language(), game_launcher(), init_lua_script(), init_video(), launch_game(), load_game(), new_campaign(), play_multiplayer(), play_multiplayer_commandline(), play_replay(), play_screenshot_mode(), play_test(), show_preferences(), start_editor(), and unit_test().
|
private |
Definition at line 107 of file game_launcher.hpp.
Referenced by change_language(), game_launcher(), init_language(), init_lua_script(), init_video(), opts(), play_multiplayer_commandline(), play_render_image_mode(), play_screenshot_mode(), play_test(), and unit_test().
|
private |
Definition at line 111 of file game_launcher.hpp.
Referenced by game_launcher().
|
private |
Definition at line 115 of file game_launcher.hpp.
|
private |
Definition at line 113 of file game_launcher.hpp.
|
private |
Definition at line 127 of file game_launcher.hpp.
Referenced by game_launcher(), goto_campaign(), init_lua_script(), jump_to_campaign_id(), and new_campaign().
|
private |
Definition at line 129 of file game_launcher.hpp.
Referenced by game_launcher(), goto_editor(), init_lua_script(), and jump_to_editor().
|
private |
Definition at line 126 of file game_launcher.hpp.
Referenced by game_launcher(), goto_multiplayer(), and init_lua_script().
|
private |
Definition at line 114 of file game_launcher.hpp.
|
private |
Definition at line 125 of file game_launcher.hpp.
Referenced by game_launcher(), and play_multiplayer().
|
private |
Definition at line 116 of file game_launcher.hpp.
|
private |
Definition at line 123 of file game_launcher.hpp.
Referenced by launch_game(), load_game(), and new_campaign().
|
private |
Definition at line 112 of file game_launcher.hpp.
|
private |
Definition at line 120 of file game_launcher.hpp.
Referenced by game_launcher(), and play_screenshot_mode().
|
private |
Definition at line 120 of file game_launcher.hpp.
Referenced by game_launcher(), and play_screenshot_mode().
|
private |
Definition at line 122 of file game_launcher.hpp.
Referenced by launch_game(), load_game(), new_campaign(), play_multiplayer(), play_multiplayer_commandline(), play_render_image_mode(), play_replay(), play_test(), set_tutorial(), and unit_test().
|
private |
Definition at line 118 of file game_launcher.hpp.
Referenced by play_test(), and unit_test().
|
private |
Definition at line 109 of file game_launcher.hpp.
Referenced by video().