diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 0e52c3e6f6..d8c40d2f54 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -851,15 +851,17 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) { auto vr = GetI18NCategory(I18NCat::VR); auto th = GetI18NCategory(I18NCat::THEMES); - systemSettings->Add(new ItemHeader(sy->T("UI"))); - + systemSettings->Add(new ItemHeader(sy->T("RetroAchievements"))); auto retro = systemSettings->Add(new Choice(sy->T("RetroAchievements"))); + retro->OnClick.Add([&](UI::EventParams &) -> UI::EventReturn { screenManager()->push(new RetroAchievementsSettingsScreen(gamePath_)); return UI::EVENT_DONE; }); retro->SetIcon(ImageID("I_RETROACHIEVEMENTS_LOGO")); + systemSettings->Add(new ItemHeader(sy->T("UI"))); + auto langCodeToName = [](const char *value) -> std::string { auto &mapping = g_Config.GetLangValuesMapping(); auto iter = mapping.find(value); @@ -1232,20 +1234,21 @@ UI::EventReturn GameSettingsScreen::OnChangeBackground(UI::EventParams &e) { File::Delete(bgPng); File::Delete(bgJpg); UIBackgroundShutdown(); + RecreateViews(); } else { auto sy = GetI18NCategory(I18NCat::SYSTEM); - System_BrowseForImage(sy->T("Set UI background..."), [](const std::string &value, int) { + System_BrowseForImage(sy->T("Set UI background..."), [=](const std::string &value, int) { if (!value.empty()) { Path dest = GetSysDirectory(DIRECTORY_SYSTEM) / (endsWithNoCase(value, ".jpg") ? "background.jpg" : "background.png"); File::Copy(Path(value), dest); } // It will init again automatically. We can't init outside a frame on Vulkan. UIBackgroundShutdown(); + RecreateViews(); }); } // Change to a browse or clear button. - RecreateViews(); return UI::EVENT_DONE; } diff --git a/UI/MemStickScreen.cpp b/UI/MemStickScreen.cpp index 049e2c2f8e..7442aed6a7 100644 --- a/UI/MemStickScreen.cpp +++ b/UI/MemStickScreen.cpp @@ -48,6 +48,7 @@ #include "UI/MemStickScreen.h" #include "UI/MainScreen.h" #include "UI/MiscScreens.h" +#include "UI/OnScreenDisplay.h" static bool FolderSeemsToBeUsed(Path newMemstickFolder) { // Inspect the potential new folder, quickly. @@ -245,6 +246,9 @@ void MemStickScreen::CreateViews() { leftColumn->Add(new TextView(iz->T("DataCanBeShared", "Data can be shared between PPSSPP regular/Gold.")))->SetBullet(true); // TODO: Show current folder here if we have one set. } + errorNoticeView_ = leftColumn->Add(new NoticeView(NoticeLevel::WARN, iz->T("Cancelled - try again"), "")); + errorNoticeView_->SetVisibility(UI::V_GONE); + if (choice_ == CHOICE_BROWSE_FOLDER || choice_ == CHOICE_SET_MANUAL) { UI::View *extraView = nullptr; if (!g_Config.memStickDirectory.empty()) { @@ -312,7 +316,6 @@ UI::EventReturn MemStickScreen::OnChoiceClick(UI::EventParams ¶ms) { // Change the confirm button to match the choice, // and change the text that we show. RecreateViews(); - return UI::EVENT_DONE; } @@ -455,7 +458,10 @@ UI::EventReturn MemStickScreen::Browse(UI::EventParams ¶ms) { done_ = true; return; } + errorNoticeView_->SetVisibility(UI::V_GONE); screenManager()->push(new ConfirmMemstickMoveScreen(pendingMemStickFolder, initialSetup_)); + }, [=]() { + errorNoticeView_->SetVisibility(UI::V_VISIBLE); }); return UI::EVENT_DONE; } @@ -555,15 +561,15 @@ void ConfirmMemstickMoveScreen::CreateViews() { leftColumn->Add(new TextView(iz->T("Selected PSP Data Folder"), ALIGN_LEFT, false)); if (!initialSetup_) { - leftColumn->Add(new TextView(iz->T("PPSSPP will restart after the change"), ALIGN_LEFT, false)); + leftColumn->Add(new NoticeView(NoticeLevel::WARN, iz->T("PPSSPP will restart after the change"), "")); } leftColumn->Add(new TextView(newMemstickFolder_.ToVisualString(), ALIGN_LEFT, false)); std::string newFreeSpaceText = std::string(iz->T("Free space")) + ": " + FormatSpaceString(freeSpaceNew); leftColumn->Add(new TextView(newFreeSpaceText, ALIGN_LEFT, false)); if (existingFilesInNewFolder_) { - leftColumn->Add(new TextView(iz->T("Already contains PSP data"), ALIGN_LEFT, false)); + leftColumn->Add(new NoticeView(NoticeLevel::SUCCESS, iz->T("Already contains PSP data"), "")); if (!moveData_) { - leftColumn->Add(new TextView(iz->T("No data will be changed"), ALIGN_LEFT, false)); + leftColumn->Add(new NoticeView(NoticeLevel::INFO, iz->T("No data will be changed"), "")); } } if (!error_.empty()) { diff --git a/UI/MemStickScreen.h b/UI/MemStickScreen.h index 3912e095bc..457f4dfd0a 100644 --- a/UI/MemStickScreen.h +++ b/UI/MemStickScreen.h @@ -29,6 +29,8 @@ #include "UI/MiscScreens.h" +class NoticeView; + // MemStickScreen - let's you configure your memory stick directory. // Currently only useful for Android. class MemStickScreen : public UIDialogScreenWithBackground { @@ -75,6 +77,7 @@ private: UI::EventReturn OnChoiceClick(UI::EventParams ¶ms); SettingInfoMessage *settingInfo_ = nullptr; + NoticeView *errorNoticeView_ = nullptr; bool initialSetup_; bool storageBrowserWorking_;