twml_exception::show only needs CVideo
This commit is contained in:
parent
632a663e0e
commit
b4a34b282b
8 changed files with 16 additions and 15 deletions
|
@ -1069,7 +1069,7 @@ bool addons_manager_ui(display& disp, const std::string& remote_address)
|
|||
gui2::show_error_message(disp.video(),
|
||||
vgettext("A local file with add-on publishing information could not be read.\n\nFile: $path\nError message: $msg", symbols));
|
||||
} catch(twml_exception& e) {
|
||||
e.show(disp);
|
||||
e.show(disp.video());
|
||||
} catch(const addons_client::user_exit&) {
|
||||
LOG_AC << "initial connection canceled by user\n";
|
||||
} catch(const addons_client::invalid_server_address&) {
|
||||
|
@ -1282,7 +1282,7 @@ bool ad_hoc_addon_fetch_session(display & disp, const std::vector<std::string> &
|
|||
gui2::show_error_message(disp.video(),
|
||||
vgettext("A local file with add-on publishing information could not be read.\n\nFile: $path\nError message: $msg", symbols));
|
||||
} catch(twml_exception& e) {
|
||||
e.show(disp);
|
||||
e.show(disp.video());
|
||||
} catch(const addons_client::user_exit&) {
|
||||
LOG_AC << "initial connection canceled by user\n";
|
||||
} catch(const addons_client::invalid_server_address&) {
|
||||
|
|
|
@ -179,7 +179,7 @@ EXIT_STATUS editor_controller::main_loop()
|
|||
gui2::show_transient_message(gui().video(), _("Fatal error"), e.what());
|
||||
return EXIT_ERROR;
|
||||
} catch (twml_exception& e) {
|
||||
e.show(gui());
|
||||
e.show(gui().video());
|
||||
}
|
||||
return quit_mode_;
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ void editor_controller::do_screenshot(const std::string& screenshot_filename /*
|
|||
ERR_ED << "Screenshot creation failed!\n";
|
||||
}
|
||||
} catch (twml_exception& e) {
|
||||
e.show(gui());
|
||||
e.show(gui().video());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -645,7 +645,7 @@ WML_HANDLER_FUNCTION(replace_map, /*event_info*/, cfg)
|
|||
lg::wml_error << "replace_map: Unable to load map " << log_map_name << std::endl;
|
||||
return;
|
||||
} catch(twml_exception& e) {
|
||||
e.show(*resources::screen);
|
||||
e.show(resources::screen->video());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1228,7 +1228,7 @@ WML_HANDLER_FUNCTION(terrain_mask, /*event_info*/, cfg)
|
|||
ERR_NG << "terrain mask is in the incorrect format, and couldn't be applied" << std::endl;
|
||||
return;
|
||||
} catch(twml_exception& e) {
|
||||
e.show(*resources::screen);
|
||||
e.show(resources::screen->video());
|
||||
return;
|
||||
}
|
||||
resources::gameboard->overlay_map(mask_map, cfg.get_parsed_config(), loc, border);
|
||||
|
|
|
@ -312,7 +312,7 @@ LEVEL_RESULT campaign_controller::play_game()
|
|||
gui2::show_error_message(disp_.video(), _("Error while reading the WML: ") + e.message);
|
||||
return LEVEL_RESULT::QUIT;
|
||||
} catch(twml_exception& e) {
|
||||
e.show(disp_);
|
||||
e.show(disp_.video());
|
||||
return LEVEL_RESULT::QUIT;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ bool enter_create_mode(game_display& disp, const config& game_config,
|
|||
try {
|
||||
dlg.show(disp.video());
|
||||
} catch(twml_exception& e) {
|
||||
e.show(disp);
|
||||
e.show(disp.video());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -742,7 +742,7 @@ bool game_launcher::load_game()
|
|||
}
|
||||
return false;
|
||||
} catch(twml_exception& e) {
|
||||
e.show(disp());
|
||||
e.show(disp().video());
|
||||
return false;
|
||||
} catch(filesystem::io_exception& e) {
|
||||
if(e.message.empty()) {
|
||||
|
@ -1009,7 +1009,7 @@ bool game_launcher::play_multiplayer()
|
|||
} catch (game::load_game_exception &) {
|
||||
//this will make it so next time through the title screen loop, this game is loaded
|
||||
} catch(twml_exception& e) {
|
||||
e.show(disp());
|
||||
e.show(disp().video());
|
||||
} catch (game::error & e) {
|
||||
std::cerr << "caught game::error...\n";
|
||||
gui2::show_error_message(disp().video(), _("Error: ") + e.message);
|
||||
|
@ -1106,7 +1106,7 @@ void game_launcher::launch_game(RELOAD_GAME_DATA reload)
|
|||
} catch (game::load_game_exception &) {
|
||||
//this will make it so next time through the title screen loop, this game is loaded
|
||||
} catch(twml_exception& e) {
|
||||
e.show(disp());
|
||||
e.show(disp().video());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1120,7 +1120,7 @@ void game_launcher::play_replay()
|
|||
} catch (game::load_game_exception &) {
|
||||
//this will make it so next time through the title screen loop, this game is loaded
|
||||
} catch(twml_exception& e) {
|
||||
e.show(disp());
|
||||
e.show(disp().video());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ void wml_exception(
|
|||
throw twml_exception(message, sstr.str());
|
||||
}
|
||||
|
||||
void twml_exception::show(display &disp)
|
||||
void twml_exception::show(CVideo &video)
|
||||
{
|
||||
std::ostringstream sstr;
|
||||
|
||||
|
@ -66,7 +66,7 @@ void twml_exception::show(display &disp)
|
|||
<< _("When reporting the bug please include the following error message :")
|
||||
<< "\n" << dev_message;
|
||||
|
||||
gui2::show_error_message(disp.video(), sstr.str());
|
||||
gui2::show_error_message(video, sstr.str());
|
||||
}
|
||||
|
||||
std::string missing_mandatory_wml_key(
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <string>
|
||||
|
||||
class display;
|
||||
class CVideo;
|
||||
|
||||
/**
|
||||
* The macro to use for the validation of WML
|
||||
|
@ -132,7 +133,7 @@ struct twml_exception
|
|||
* Shows the error in a dialog.
|
||||
* @param disp The display object to show the message on.
|
||||
*/
|
||||
void show(display &disp);
|
||||
void show(CVideo &video);
|
||||
private:
|
||||
IMPLEMENT_LUA_JAILBREAK_EXCEPTION(twml_exception)
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue