From e0d68e476801ea962e03a12c5fea3e8e65eaa7e6 Mon Sep 17 00:00:00 2001 From: raven02 Date: Sun, 4 Aug 2013 15:49:51 +0800 Subject: [PATCH] Add game direct load support for new UI --- Core/Config.cpp | 2 ++ Core/Config.h | 6 +++--- UI/GameSettingsScreen.cpp | 5 ++--- UI/MainScreen.cpp | 8 +++++++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 5a1cabedc6..730286a141 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -54,6 +54,7 @@ void Config::Load(const char *iniFileName) general->Get("AutoLoadLast", &bAutoLoadLast, false); general->Get("AutoRun", &bAutoRun, true); general->Get("Browse", &bBrowse, false); + general->Get("DirectLoad", &bDirectLoad, false); general->Get("ConfirmOnQuit", &bConfirmOnQuit, false); general->Get("IgnoreBadMemAccess", &bIgnoreBadMemAccess, true); general->Get("CurrentDirectory", ¤tDirectory, ""); @@ -201,6 +202,7 @@ void Config::Save() general->Set("AutoLoadLast", bAutoLoadLast); general->Set("AutoRun", bAutoRun); general->Set("Browse", bBrowse); + general->Set("DirectLoad", bDirectLoad); general->Set("ConfirmOnQuit", bConfirmOnQuit); general->Set("IgnoreBadMemAccess", bIgnoreBadMemAccess); general->Set("CurrentDirectory", currentDirectory); diff --git a/Core/Config.h b/Core/Config.h index 50ca10d8c3..d2c45c9666 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -33,7 +33,6 @@ public: // Whether to save the config on close. bool bSaveSettings; - bool bFirstRun; // These are broken @@ -47,10 +46,11 @@ public: #endif // General - bool bNewUI; // "Hidden" setting, does not get saved to ini file. + bool bNewUI; int iNumWorkerThreads; bool bScreenshotsAsPNG; bool bEnableLogging; + bool bDirectLoad; // Core bool bIgnoreBadMemAccess; @@ -77,7 +77,7 @@ public: int iWindowX; int iWindowY; int iWindowZoom; // for Windows - bool bAntiAliasing; // for Windows, too + bool bAntiAliasing; bool bVertexCache; bool bFullScreen; #ifdef _WIN32 diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 1ad63a64c1..5608ac4bcd 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -181,10 +181,9 @@ void GameSettingsScreen::CreateViews() { root_->Add(leftColumn); leftColumn->Add(new Spacer(new LinearLayoutParams(1.0))); - leftColumn->Add(new Choice(g->T("Back"), "", false, new AnchorLayoutParams(150, WRAP_CONTENT, 10, NONE, NONE, 10)))->OnClick.Handle(this, &UIScreen::OnBack); + leftColumn->Add(new Choice(g->T("Back"), "", false, new AnchorLayoutParams(205, WRAP_CONTENT, 30, NONE, NONE, 10)))->OnClick.Handle(this, &UIScreen::OnBack); - - TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, 200, new LinearLayoutParams(800, FILL_PARENT, actionMenuMargins)); + TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, 200, new LinearLayoutParams(910, FILL_PARENT, actionMenuMargins)); root_->Add(tabHolder); diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 9ef5c78075..6c6970a8b2 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -409,7 +409,13 @@ UI::EventReturn MainScreen::OnLoadFile(UI::EventParams &e) { } UI::EventReturn MainScreen::OnGameSelected(UI::EventParams &e) { - screenManager()->push(new GameScreen(e.s)); + if(g_Config.bDirectLoad) { + // Go directly into the game. + screenManager()->switchScreen(new EmuScreen(e.s)); + } else { + // Goto Game Menu. + screenManager()->push(new GameScreen(e.s)); + } return UI::EVENT_DONE; }