Get rid of the separate "Main settings", put them in the System Settings category instead.

This commit is contained in:
Henrik Rydgard 2013-08-20 18:03:52 +02:00
parent 0fddaf146f
commit 3f6d1d5e13
5 changed files with 49 additions and 67 deletions

View File

@ -341,6 +341,31 @@ void GameSettingsScreen::CreateViews() {
systemSettings->Add(new CheckBox(&g_Config.bSeparateIOThread, s->T("I/O on thread (experimental)")))->SetEnabled(!PSP_IsInited());
systemSettings->Add(new PopupSliderChoice(&g_Config.iLockedCPUSpeed, 0, 1000, gs->T("Change CPU Clock", "Change CPU Clock (0 = default)"), screenManager()));
enableReports_ = g_Config.sReportHost != "";
LinearLayout *list = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)));
systemSettings->SetSpacing(0);
systemSettings->Add(new ItemHeader(g->T("General")));
systemSettings->Add(new CheckBox(&enableReports_, s->T("Enable Compatibility Server Reports")));
#ifndef ANDROID
// Need to move the cheat config dir somewhere where it can be read/written on android
systemSettings->Add(new CheckBox(&g_Config.bEnableCheats, s->T("Enable Cheats")));
#endif
#ifdef _WIN32
// Screenshot functionality is not yet available on non-Windows
systemSettings->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
systemSettings->Add(new Choice(s->T("Change Nickname")))->OnClick.Handle(this, &GameSettingsScreen::OnChangeNickname);
#endif
systemSettings->Add(new Choice(s->T("System Language")))->OnClick.Handle(this, &GameSettingsScreen::OnLanguage);
systemSettings->Add(new Choice(s->T("Developer Tools")))->OnClick.Handle(this, &GameSettingsScreen::OnDeveloperTools);
systemSettings->Add(new Choice(g->T("Back")))->OnClick.Handle(this, &GameSettingsScreen::OnBack);
#ifndef ANDROID
systemSettings->Add(new ItemHeader(s->T("Cheats", "Cheats (experimental, see forums)")));
systemSettings->Add(new Choice(s->T("Reload Cheats")))->OnClick.Handle(this, &GameSettingsScreen::OnReloadCheats);
@ -424,7 +449,9 @@ UI::EventReturn GameSettingsScreen::OnBack(UI::EventParams &e) {
Atrac3plus_Decoder::Init();
else Atrac3plus_Decoder::Shutdown();
}
g_Config.sReportHost = enableReports_ ? "report.ppsspp.org" : "";
g_Config.Save();
#ifdef _WIN32
PostMessage(MainWindow::hwndMain, MainWindow::WM_USER_ATRAC_STATUS_CHANGED, 0, 0);
#endif
@ -432,40 +459,15 @@ UI::EventReturn GameSettingsScreen::OnBack(UI::EventParams &e) {
return UI::EVENT_DONE;
}
/*
void GlobalSettingsScreen::CreateViews() {
using namespace UI;
root_ = new ScrollView(ORIENT_VERTICAL);
enableReports_ = g_Config.sReportHost != "";
}*/
I18NCategory *g = GetI18NCategory("General");
I18NCategory *s = GetI18NCategory("System");
I18NCategory *gs = GetI18NCategory("Graphics");
LinearLayout *list = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)));
list->SetSpacing(0);
list->Add(new ItemHeader(g->T("General")));
list->Add(new CheckBox(&enableReports_, s->T("Enable Compatibility Server Reports")));
#ifndef ANDROID
// Need to move the cheat config dir somewhere where it can be read/written on android
list->Add(new CheckBox(&g_Config.bEnableCheats, s->T("Enable Cheats")));
#endif
#ifdef _WIN32
// 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(s->T("Change Nickname")))->OnClick.Handle(this, &GlobalSettingsScreen::OnChangeNickname);
#endif
list->Add(new Choice(s->T("System Language")))->OnClick.Handle(this, &GlobalSettingsScreen::OnLanguage);
list->Add(new Choice(s->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) {
UI::EventReturn GameSettingsScreen::OnChangeNickname(UI::EventParams &e) {
#ifdef _WIN32
const size_t name_len = 256;
@ -480,17 +482,17 @@ UI::EventReturn GlobalSettingsScreen::OnChangeNickname(UI::EventParams &e) {
return UI::EVENT_DONE;
}
UI::EventReturn GlobalSettingsScreen::OnFactoryReset(UI::EventParams &e) {
UI::EventReturn GameSettingsScreen::OnFactoryReset(UI::EventParams &e) {
screenManager()->push(new PluginScreen());
return UI::EVENT_DONE;
}
UI::EventReturn GlobalSettingsScreen::OnLanguage(UI::EventParams &e) {
UI::EventReturn GameSettingsScreen::OnLanguage(UI::EventParams &e) {
screenManager()->push(new NewLanguageScreen());
return UI::EVENT_DONE;
}
UI::EventReturn GlobalSettingsScreen::OnDeveloperTools(UI::EventParams &e) {
UI::EventReturn GameSettingsScreen::OnDeveloperTools(UI::EventParams &e) {
screenManager()->push(new DeveloperToolsScreen());
return UI::EVENT_DONE;
}
@ -500,13 +502,6 @@ UI::EventReturn GameSettingsScreen::OnControlMapping(UI::EventParams &e) {
return UI::EVENT_DONE;
}
UI::EventReturn GlobalSettingsScreen::OnBack(UI::EventParams &e) {
screenManager()->finishDialog(this, DR_OK);
g_Config.sReportHost = enableReports_ ? "report.ppsspp.org" : "";
g_Config.Save();
return UI::EVENT_DONE;
}
void DeveloperToolsScreen::CreateViews() {
using namespace UI;
root_ = new ScrollView(ORIENT_VERTICAL);

View File

@ -24,7 +24,7 @@
// per game.
class GameSettingsScreen : public UIDialogScreenWithBackground {
public:
GameSettingsScreen(std::string gamePath, std::string gameID = "") : gamePath_(gamePath), gameID_(gameID), iAlternateSpeedPercent_(3) {}
GameSettingsScreen(std::string gamePath, std::string gameID = "") : gamePath_(gamePath), gameID_(gameID), iAlternateSpeedPercent_(3), enableReports_(false) {}
virtual void update(InputState &input);
@ -46,12 +46,19 @@ private:
UI::EventReturn OnBack(UI::EventParams &e);
UI::EventReturn OnReloadCheats(UI::EventParams &e);
// Global settings handlers
UI::EventReturn OnLanguage(UI::EventParams &e);
UI::EventReturn OnFactoryReset(UI::EventParams &e);
UI::EventReturn OnDeveloperTools(UI::EventParams &e);
UI::EventReturn OnChangeNickname(UI::EventParams &e);
// Temporaries to convert bools to int settings
bool cap60FPS_;
bool enableReports_;
int iAlternateSpeedPercent_;
};
// TODO: Move to its own file.
/*
class GlobalSettingsScreen : public UIDialogScreenWithBackground {
public:
GlobalSettingsScreen() {}
@ -60,15 +67,9 @@ protected:
virtual void CreateViews();
private:
// Event handlers
UI::EventReturn OnLanguage(UI::EventParams &e);
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_;
};
};*/
class DeveloperToolsScreen : public UIDialogScreenWithBackground {
public:

View File

@ -214,12 +214,13 @@ public:
}
std::string GetFriendlyPath() {
std::string str = GetPath();
/*
#ifdef ANDROID
if (!memcmp(str.c_str(), g_Config.memCardDirectory.c_str(), g_Config.memCardDirectory.size()))
{
str = str.substr(g_Config.memCardDirectory.size());
}
#endif
#endif*/
return str;
}
@ -245,8 +246,7 @@ void PathBrowser::GetListing(std::vector<FileInfo> &fileInfo, const char *filter
if (path_ == "/") {
// Special path that means root of file system.
std::vector<std::string> drives = getWindowsDrives();
for (auto drive = drives.begin(); drive != drives.end(); ++drive)
{
for (auto drive = drives.begin(); drive != drives.end(); ++drive) {
FileInfo fake;
fake.fullName = *drive;
fake.name = *drive;
@ -531,7 +531,6 @@ void MainScreen::CreateViews() {
rightColumnItems->Add(new Choice(m->T("Load","Load...")))->OnClick.Handle(this, &MainScreen::OnLoadFile);
#endif
rightColumnItems->Add(new Choice(m->T("Game Settings")))->OnClick.Handle(this, &MainScreen::OnGameSettings);
rightColumnItems->Add(new Choice(m->T("Main Settings")))->OnClick.Handle(this, &MainScreen::OnSettings);
rightColumnItems->Add(new Choice(m->T("Exit")))->OnClick.Handle(this, &MainScreen::OnExit);
rightColumnItems->Add(new Choice(m->T("Credits")))->OnClick.Handle(this, &MainScreen::OnCredits);
rightColumnItems->Add(new Choice(m->T("www.ppsspp.org")))->OnClick.Handle(this, &MainScreen::OnPPSSPPOrg);
@ -581,12 +580,6 @@ UI::EventReturn MainScreen::OnGameSettings(UI::EventParams &e) {
return UI::EVENT_DONE;
}
UI::EventReturn MainScreen::OnSettings(UI::EventParams &e) {
// screenManager()->push(new SettingsScreen());
screenManager()->push(new GlobalSettingsScreen());
return UI::EVENT_DONE;
}
UI::EventReturn MainScreen::OnCredits(UI::EventParams &e) {
screenManager()->push(new CreditsScreen());
return UI::EVENT_DONE;
@ -674,15 +667,9 @@ void GamePauseScreen::CreateViews() {
rightColumnItems->Add(new Choice(i->T("Continue")))->OnClick.Handle(this, &GamePauseScreen::OnContinue);
rightColumnItems->Add(new Choice(i->T("Game Settings")))->OnClick.Handle(this, &GamePauseScreen::OnGameSettings);
rightColumnItems->Add(new Choice(i->T("Main Settings")))->OnClick.Handle(this, &GamePauseScreen::OnMainSettings);
rightColumnItems->Add(new Choice(i->T("Exit to menu")))->OnClick.Handle(this, &GamePauseScreen::OnExitToMenu);
}
UI::EventReturn GamePauseScreen::OnMainSettings(UI::EventParams &e) {
screenManager()->push(new GlobalSettingsScreen());
return UI::EVENT_DONE;
}
UI::EventReturn GamePauseScreen::OnGameSettings(UI::EventParams &e) {
screenManager()->push(new GameSettingsScreen(gamePath_));
return UI::EVENT_DONE;

View File

@ -40,7 +40,6 @@ private:
UI::EventReturn OnGameSelectedInstant(UI::EventParams &e);
// Event handlers
UI::EventReturn OnLoadFile(UI::EventParams &e);
UI::EventReturn OnSettings(UI::EventParams &e);
UI::EventReturn OnGameSettings(UI::EventParams &e);
UI::EventReturn OnCredits(UI::EventParams &e);
UI::EventReturn OnSupport(UI::EventParams &e);

2
native

@ -1 +1 @@
Subproject commit 7b6245946372dd4ba140e287a53974d417676309
Subproject commit 0761e3cb21bb3e409aad8d9e8f46e86ed73af4f4