Game Launcher: moved cache clear calls to change_language

This commit is contained in:
Charles Dang 2021-01-07 18:29:31 +11:00
parent bcdf93c9fc
commit 480fc920dc
2 changed files with 6 additions and 5 deletions

View file

@ -961,6 +961,11 @@ bool game_launcher::change_language()
video_->set_window_title(game_config::get_default_title_string());
}
t_string::reset_translations();
image::flush_cache();
sound::flush_cache();
font::load_font_config();
return true;
}

View file

@ -53,10 +53,10 @@
#include "hotkey/hotkey_command.hpp"
#include "sdl/surface.hpp"
#include "sdl/utils.hpp"
#include <functional>
#include "video.hpp"
#include <algorithm>
#include <functional>
static lg::log_domain log_config("config");
#define ERR_CF LOG_STREAM(err, log_config)
@ -373,10 +373,6 @@ void title_screen::pre_show(window& win)
register_button(win, "language", hotkey::HOTKEY_LANGUAGE, [this, &win]() {
try {
if(game_.change_language()) {
t_string::reset_translations();
::image::flush_cache();
sound::flush_cache();
font::load_font_config();
on_resize();
}
} catch(const std::runtime_error& e) {