Recreat all views when received language change message

This commit is contained in:
shenweip 2013-09-14 13:52:21 +08:00
parent a318488244
commit 9907f4a740
3 changed files with 10 additions and 3 deletions

View File

@ -334,7 +334,7 @@ void GameSettingsScreen::update(InputState &input) {
void GameSettingsScreen::sendMessage(const char *message, const char *value) {
if (!strcmp(message, "language")) {
RecreateViews();
screenManager()->RecreateAllViews();
}
}
@ -459,6 +459,12 @@ void DeveloperToolsScreen::CreateViews() {
list->Add(new Choice(d->T("Back")))->OnClick.Handle(this, &DeveloperToolsScreen::OnBack);
}
void DeveloperToolsScreen::sendMessage(const char *message, const char *value){
if (!strcmp(message, "language")) {
screenManager()->RecreateAllViews();
}
}
UI::EventReturn DeveloperToolsScreen::OnBack(UI::EventParams &e) {
screenManager()->finishDialog(this, DR_OK);

View File

@ -87,6 +87,7 @@ public:
protected:
virtual void CreateViews();
virtual void sendMessage(const char *message, const char *value);
void CallbackRestoreDefaults(bool yes);
private:

View File

@ -556,7 +556,7 @@ void MainScreen::sendMessage(const char *message, const char *value) {
screenManager()->switchScreen(new EmuScreen(value));
}
if (!strcmp(message, "language")) {
RecreateViews();
screenManager()->RecreateAllViews();
}
if (!strcmp(message, "control mapping")) {
screenManager()->push(new ControlMappingScreen());
@ -774,6 +774,6 @@ UI::EventReturn GamePauseScreen::OnCwCheat(UI::EventParams &e) {
void GamePauseScreen::sendMessage(const char *message, const char *value) {
if (!strcmp(message, "language")) {
RecreateViews();
screenManager()->RecreateAllViews();
}
}