Moved init_language() to the game_controller_abstract

This commit is contained in:
Lukasz Dobrogowski 2011-06-10 22:34:54 +00:00
parent fe81c82a8d
commit 23cbd74535
6 changed files with 22 additions and 26 deletions

View File

@ -311,24 +311,6 @@ bool game_controller::init_config(const bool force)
return true; return true;
} }
bool game_controller::init_language()
{
if(!::load_language_list())
return false;
::set_language(get_locale());
if(!cmdline_opts_.nogui) {
std::string wm_title_string = _("The Battle for Wesnoth");
wm_title_string += " - " + game_config::revision;
SDL_WM_SetCaption(wm_title_string.c_str(), NULL);
}
hotkey::load_descriptions();
return true;
}
bool game_controller::play_test() bool game_controller::play_test()
{ {
static bool first_time = true; static bool first_time = true;

View File

@ -50,7 +50,6 @@ public:
~game_controller(); ~game_controller();
bool init_config() { return init_config(false); } bool init_config() { return init_config(false); }
bool init_language();
bool play_test(); bool play_test();
bool play_multiplayer_mode(); bool play_multiplayer_mode();
bool play_screenshot_mode(); bool play_screenshot_mode();

View File

@ -16,6 +16,9 @@
#include "game_controller_abstract.hpp" #include "game_controller_abstract.hpp"
#include "game_display.hpp" #include "game_display.hpp"
#include "gettext.hpp"
#include "hotkeys.hpp"
#include "language.hpp"
#include "preferences_display.hpp" #include "preferences_display.hpp"
#include <iostream> #include <iostream>
@ -39,6 +42,24 @@ game_display& game_controller_abstract::disp()
return *disp_.get(); return *disp_.get();
} }
bool game_controller_abstract::init_language()
{
if(!::load_language_list())
return false;
::set_language(get_locale());
if(!cmdline_opts_.nogui) {
std::string wm_title_string = _("The Battle for Wesnoth");
wm_title_string += " - " + game_config::revision;
SDL_WM_SetCaption(wm_title_string.c_str(), NULL);
}
hotkey::load_descriptions();
return true;
}
bool game_controller_abstract::init_video() bool game_controller_abstract::init_video()
{ {
if(cmdline_opts_.nogui) { if(cmdline_opts_.nogui) {

View File

@ -33,7 +33,7 @@ public:
bool init_video(); bool init_video();
virtual bool init_config() = 0; virtual bool init_config() = 0;
virtual bool init_language() = 0; bool init_language();
virtual bool play_test() = 0; virtual bool play_test() = 0;
virtual bool play_multiplayer_mode() = 0; virtual bool play_multiplayer_mode() = 0;
virtual bool play_screenshot_mode() = 0; virtual bool play_screenshot_mode() = 0;

View File

@ -34,11 +34,6 @@ bool game_controller_new::init_config()
return true; return true;
} }
bool game_controller_new::init_language()
{
return true;
}
bool game_controller_new::play_test() bool game_controller_new::play_test()
{ {
return true; return true;

View File

@ -26,7 +26,6 @@ public:
~game_controller_new(); ~game_controller_new();
bool init_config(); bool init_config();
bool init_language();
bool play_test(); bool play_test();
bool play_multiplayer_mode(); bool play_multiplayer_mode();
bool play_screenshot_mode(); bool play_screenshot_mode();