Yet another feature that was missing in newui

This commit is contained in:
Henrik Rydgard 2013-08-18 02:03:59 +02:00
parent 92f0678f2f
commit d7000ef1a4
2 changed files with 26 additions and 1 deletions

View File

@ -36,6 +36,10 @@
#include "Core/HW/atrac3plus.h"
#include "Core/System.h"
#ifdef _WIN32
#include "Core/Host.h"
#endif
#ifdef _WIN32
namespace MainWindow {
enum {
@ -388,11 +392,32 @@ void GlobalSettingsScreen::CreateViews() {
// Screenshot functionality is not yet available on non-Windows
list->Add(new CheckBox(&g_Config.bScreenshotsAsPNG, gs->T("Screenshots as PNG")));
#endif
// TODO: Come up with a way to display a keyboard for mobile users,
// so until then, this is Windows/Desktop only.
#ifdef _WIN32
list->Add(new Choice(g->T("Change Nickname")))->OnClick.Handle(this, &GlobalSettingsScreen::OnChangeNickname);
#endif
list->Add(new Choice(gs->T("System Language")))->OnClick.Handle(this, &GlobalSettingsScreen::OnLanguage);
list->Add(new Choice(gs->T("Developer Tools")))->OnClick.Handle(this, &GlobalSettingsScreen::OnDeveloperTools);
list->Add(new Choice(g->T("Back")))->OnClick.Handle(this, &GlobalSettingsScreen::OnBack);
}
UI::EventReturn GlobalSettingsScreen::OnChangeNickname(UI::EventParams &e) {
#ifdef _WIN32
const size_t name_len = 256;
char name[name_len];
memset(name, 0, sizeof(name));
if (host->InputBoxGetString("Enter a new PSP nickname", "PPSSPP", name, name_len)) {
g_Config.sNickName = name;
}
#endif
return UI::EVENT_DONE;
}
UI::EventReturn GlobalSettingsScreen::OnFactoryReset(UI::EventParams &e) {
screenManager()->push(new PluginScreen());
return UI::EVENT_DONE;

View File

@ -62,7 +62,7 @@ private:
UI::EventReturn OnFactoryReset(UI::EventParams &e);
UI::EventReturn OnBack(UI::EventParams &e);
UI::EventReturn OnDeveloperTools(UI::EventParams &e);
UI::EventReturn OnChangeNickname(UI::EventParams &e);
// Temporaries to convert bools to other kinds of settings
bool enableReports_;
};