mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Update language immediately in UI.
This commit is contained in:
parent
98717fee7c
commit
24ecf9416c
6 changed files with 26 additions and 6 deletions
|
@ -515,7 +515,15 @@ UI::EventReturn GameSettingsScreen::OnFactoryReset(UI::EventParams &e) {
|
|||
|
||||
UI::EventReturn GameSettingsScreen::OnLanguage(UI::EventParams &e) {
|
||||
I18NCategory *d = GetI18NCategory("Developer");
|
||||
screenManager()->push(new NewLanguageScreen(d->T("Language")));
|
||||
auto langScreen = new NewLanguageScreen(d->T("Language"));
|
||||
langScreen->OnChoice.Handle(this, &GameSettingsScreen::OnLanguageChange);
|
||||
screenManager()->push(langScreen);
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnLanguageChange(UI::EventParams &e) {
|
||||
RecreateViews();
|
||||
OnLanguageChanged.Trigger(e);
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@ public:
|
|||
|
||||
virtual void update(InputState &input);
|
||||
|
||||
UI::Event OnLanguageChanged;
|
||||
|
||||
protected:
|
||||
virtual void CreateViews();
|
||||
virtual void DrawBackground(UIContext &dc);
|
||||
|
@ -50,6 +52,7 @@ private:
|
|||
|
||||
// Global settings handlers
|
||||
UI::EventReturn OnLanguage(UI::EventParams &e);
|
||||
UI::EventReturn OnLanguageChange(UI::EventParams &e);
|
||||
UI::EventReturn OnFactoryReset(UI::EventParams &e);
|
||||
UI::EventReturn OnDeveloperTools(UI::EventParams &e);
|
||||
UI::EventReturn OnChangeNickname(UI::EventParams &e);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Core/System.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/SaveState.h"
|
||||
|
||||
#include "UI/EmuScreen.h"
|
||||
|
@ -585,7 +586,17 @@ UI::EventReturn MainScreen::OnGameSelectedInstant(UI::EventParams &e) {
|
|||
|
||||
UI::EventReturn MainScreen::OnGameSettings(UI::EventParams &e) {
|
||||
// screenManager()->push(new SettingsScreen());
|
||||
screenManager()->push(new GameSettingsScreen("",""));
|
||||
auto gameSettings = new GameSettingsScreen("", "");
|
||||
gameSettings->OnLanguageChanged.Handle(this, &MainScreen::OnLanguageChange);
|
||||
screenManager()->push(gameSettings);
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn MainScreen::OnLanguageChange(UI::EventParams &e) {
|
||||
RecreateViews();
|
||||
if (host) {
|
||||
host->UpdateUI();
|
||||
}
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ private:
|
|||
// Event handlers
|
||||
UI::EventReturn OnLoadFile(UI::EventParams &e);
|
||||
UI::EventReturn OnGameSettings(UI::EventParams &e);
|
||||
UI::EventReturn OnLanguageChange(UI::EventParams &e);
|
||||
UI::EventReturn OnCredits(UI::EventParams &e);
|
||||
UI::EventReturn OnSupport(UI::EventParams &e);
|
||||
UI::EventReturn OnPPSSPPOrg(UI::EventParams &e);
|
||||
|
|
|
@ -249,6 +249,7 @@ void NewLanguageScreen::OnCompleted(DialogResult result) {
|
|||
} else {
|
||||
g_Config.ilanguage = langValuesMapping[code].second;
|
||||
}
|
||||
RecreateViews();
|
||||
} else {
|
||||
g_Config.languageIni = oldLang;
|
||||
}
|
||||
|
|
|
@ -104,7 +104,6 @@ namespace MainWindow
|
|||
static void *rawInputBuffer;
|
||||
static size_t rawInputBufferSize;
|
||||
static int currentSavestateSlot = 0;
|
||||
static bool menusAreTranslated = false;
|
||||
|
||||
#define MAX_LOADSTRING 100
|
||||
const TCHAR *szTitle = TEXT("PPSSPP");
|
||||
|
@ -319,9 +318,6 @@ namespace MainWindow
|
|||
}
|
||||
|
||||
void TranslateMenus() {
|
||||
if(menusAreTranslated) return;
|
||||
menusAreTranslated = true;
|
||||
|
||||
const char *desktopUI = "DesktopUI";
|
||||
|
||||
// File menu
|
||||
|
|
Loading…
Add table
Reference in a new issue