mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-06 01:17:12 +00:00
Game Launcher: moved outtro handling to campaign_controller
This commit is contained in:
parent
321b496362
commit
39ca794c2a
@ -31,6 +31,7 @@
|
||||
#include "generators/map_generator.hpp"
|
||||
#include "gettext.hpp"
|
||||
#include "gui/dialogs/message.hpp"
|
||||
#include "gui/dialogs/outro.hpp"
|
||||
#include "gui/dialogs/transient_message.hpp"
|
||||
#include "gui/widgets/retval.hpp"
|
||||
#include "log.hpp"
|
||||
@ -335,6 +336,14 @@ LEVEL_RESULT campaign_controller::play_game()
|
||||
|
||||
// If there is no next scenario we're done now.
|
||||
if(state_.get_scenario_id().empty()) {
|
||||
// Don't show The End for multiplayer scenarios.
|
||||
if(res == LEVEL_RESULT::VICTORY && !state_.classification().is_normal_mp_game()) {
|
||||
preferences::add_completed_campaign(
|
||||
state_.classification().campaign, state_.classification().difficulty);
|
||||
|
||||
gui2::dialogs::outro::display(state_.classification());
|
||||
}
|
||||
|
||||
return res;
|
||||
} else if(res == LEVEL_RESULT::OBSERVER_END && mp_info_ && !mp_info_->is_host) {
|
||||
const int dlg_res = gui2::show_message(_("Game Over"),
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include "gui/dialogs/multiplayer/mp_connect.hpp"
|
||||
#include "gui/dialogs/multiplayer/mp_host_game_prompt.hpp" // for host game prompt
|
||||
#include "gui/dialogs/multiplayer/mp_method_selection.hpp"
|
||||
#include "gui/dialogs/outro.hpp"
|
||||
#include "gui/dialogs/title_screen.hpp" // for show_debug_clock_button
|
||||
#include "gui/dialogs/transient_message.hpp" // for show_transient_message
|
||||
#include "gui/widgets/retval.hpp" // for window, etc
|
||||
@ -990,13 +989,6 @@ void game_launcher::launch_game(RELOAD_GAME_DATA reload)
|
||||
campaign_controller ccontroller(state_);
|
||||
LEVEL_RESULT result = ccontroller.play_game();
|
||||
ai::manager::singleton_ = nullptr;
|
||||
// don't show The End for multiplayer scenario
|
||||
// change this if MP campaigns are implemented
|
||||
if(result == LEVEL_RESULT::VICTORY && !state_.classification().is_normal_mp_game()) {
|
||||
preferences::add_completed_campaign(state_.classification().campaign, state_.classification().difficulty);
|
||||
|
||||
gui2::dialogs::outro::display(state_.classification());
|
||||
}
|
||||
} catch(savegame::load_game_exception& e) {
|
||||
load_data_ = std::move(e.data_);
|
||||
// this will make it so next time through the title screen loop, this game is loaded
|
||||
|
Loading…
x
Reference in New Issue
Block a user