diff --git a/CMakeLists.txt b/CMakeLists.txt index 849c972e13..a2e49dd691 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1420,8 +1420,6 @@ list(APPEND NativeAppSource UI/CustomButtonMappingScreen.cpp UI/Theme.h UI/Theme.cpp - UI/RetroAchievements.cpp - UI/RetroAchievements.h UI/RetroAchievementScreens.cpp UI/RetroAchievementScreens.h ) @@ -1825,6 +1823,8 @@ add_library(${CoreLibName} ${CoreLinkType} Core/KeyMap.h Core/KeyMapDefaults.cpp Core/KeyMapDefaults.h + Core/RetroAchievements.h + Core/RetroAchievements.cpp Core/ThreadEventQueue.h Core/TiltEventProcessor.h Core/TiltEventProcessor.cpp diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index bacf3c18be..5a347d4006 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -1037,6 +1037,7 @@ + @@ -1394,6 +1395,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index ea4f7321fa..49c2a10c7b 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -1201,6 +1201,9 @@ Core + + Core + @@ -1944,6 +1947,9 @@ Core + + Core + diff --git a/UI/RetroAchievements.cpp b/Core/RetroAchievements.cpp similarity index 98% rename from UI/RetroAchievements.cpp rename to Core/RetroAchievements.cpp index 68fffcae21..492fbc7b6c 100644 --- a/UI/RetroAchievements.cpp +++ b/Core/RetroAchievements.cpp @@ -24,7 +24,6 @@ #include "ext/rcheevos/include/rc_hash.h" #include "ext/rcheevos/src/rhash/md5.h" -#include "UI/RetroAchievements.h" #include "ext/rapidjson/include/rapidjson/document.h" #include "Common/Log.h" @@ -47,8 +46,7 @@ #include "Core/ELF/ParamSFO.h" #include "Core/System.h" #include "Core/FileSystems/MetaFileSystem.h" - -#include "UI/Root.h" +#include "Core/RetroAchievements.h" // Simply wrap our current HTTP backend to fit the DuckStation-derived code. namespace Common { @@ -152,11 +150,6 @@ enum : s32 NO_RICH_PRESENCE_PING_FREQUENCY = RICH_PRESENCE_PING_FREQUENCY * 2, }; -// temporary sounds -static constexpr UI::UISound INFO_SOUND_NAME = UI::UISound::SELECT; -static constexpr UI::UISound UNLOCK_SOUND_NAME = UI::UISound::TOGGLE_ON; -static constexpr UI::UISound LBSUBMIT_SOUND_NAME = UI::UISound::TOGGLE_OFF; - // It's the name of the secret, not a secret name - the value is not secret :) static const char *RA_TOKEN_SECRET_NAME = "retroachievements"; @@ -981,8 +974,6 @@ void Achievements::DisplayAchievementSummary() std::string summary = GetGameAchievementSummary(); OSDAddNotification(10.0f, title, summary, s_game_icon); - - // play info sound? } void Achievements::DisplayMasteredNotification() @@ -1718,10 +1709,6 @@ void Achievements::SubmitLeaderboardCallback(s32 status_code, std::string conten submitted_score, best_score, response.new_rank, response.num_entries); OSDAddNotification(10.0f, lb->title, std::move(summary), s_game_icon); - - // Technically not going through the resource API, but since we're passing this to something else, we can't. - if (g_Config.bAchievementsSoundEffects) - UI::PlayUISound(LBSUBMIT_SOUND_NAME); } void Achievements::UnlockAchievement(u32 achievement_id, bool add_notification /* = true*/) @@ -1767,9 +1754,6 @@ void Achievements::UnlockAchievement(u32 achievement_id, bool add_notification / GetAchievementBadgePath(*achievement)); } - if (g_Config.bAchievementsSoundEffects) - UI::PlayUISound(UNLOCK_SOUND_NAME); - if (IsMastered()) DisplayMasteredNotification(); diff --git a/UI/RetroAchievements.h b/Core/RetroAchievements.h similarity index 100% rename from UI/RetroAchievements.h rename to Core/RetroAchievements.h diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 0203082ad2..a23d2d3289 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -69,6 +69,7 @@ using namespace std::placeholders; #include "Core/HLE/sceCtrl.h" #include "Core/HLE/sceSas.h" #include "Core/Debugger/SymbolMap.h" +#include "Core/RetroAchievements.h" #include "Core/SaveState.h" #include "Core/MIPS/MIPS.h" #include "Core/HLE/__sceAudio.h" @@ -91,7 +92,6 @@ using namespace std::placeholders; #include "UI/ProfilerDraw.h" #include "UI/DiscordIntegration.h" #include "UI/ChatScreen.h" -#include "UI/RetroAchievements.h" #include "Core/Reporting.h" diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index db3300e223..caa7c8c5b6 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -91,6 +91,7 @@ #include "Core/FileLoaders/DiskCachingFileLoader.h" #include "Core/KeyMap.h" #include "Core/Reporting.h" +#include "Core/RetroAchievements.h" #include "Core/SaveState.h" #include "Core/Screenshot.h" #include "Core/System.h" @@ -111,7 +112,6 @@ #include "UI/BackgroundAudio.h" #include "UI/ControlMappingScreen.h" #include "UI/DiscordIntegration.h" -#include "UI/RetroAchievements.h" #include "UI/EmuScreen.h" #include "UI/GameInfoCache.h" #include "UI/GPUDriverTestScreen.h" diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index c1d6d5385d..84f3c749f4 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -36,6 +36,7 @@ #include "Core/SaveState.h" #include "Core/System.h" #include "Core/Config.h" +#include "Core/RetroAchievements.h" #include "Core/ELF/ParamSFO.h" #include "Core/HLE/sceDisplay.h" #include "Core/HLE/sceUmd.h" @@ -51,7 +52,6 @@ #include "UI/OnScreenDisplay.h" #include "UI/GameInfoCache.h" #include "UI/DisplayLayoutScreen.h" -#include "UI/RetroAchievements.h" #include "UI/RetroAchievementScreens.h" static void AfterSaveStateAction(SaveState::Status status, const std::string &message, void *) { diff --git a/UI/RetroAchievementScreens.cpp b/UI/RetroAchievementScreens.cpp index 1748db96b5..6535f35daa 100644 --- a/UI/RetroAchievementScreens.cpp +++ b/UI/RetroAchievementScreens.cpp @@ -1,5 +1,4 @@ #include "UI/RetroAchievementScreens.h" -#include "UI/RetroAchievements.h" #include "Common/System/OSD.h" #include "Common/System/Request.h" #include "Common/UI/View.h" @@ -9,6 +8,7 @@ #include "Common/UI/IconCache.h" #include "Core/Config.h" +#include "Core/RetroAchievements.h" void RetroAchievementsListScreen::CreateTabs() { auto ac = GetI18NCategory(I18NCat::ACHIEVEMENTS); diff --git a/UI/RetroAchievementScreens.h b/UI/RetroAchievementScreens.h index dc90a4e874..e7a2fe19ee 100644 --- a/UI/RetroAchievementScreens.h +++ b/UI/RetroAchievementScreens.h @@ -1,12 +1,12 @@ #pragma once +#include "Common/File/Path.h" #include "Common/UI/View.h" #include "Common/UI/UIScreen.h" #include "Common/UI/ViewGroup.h" +#include "Core/RetroAchievements.h" #include "UI/MiscScreens.h" #include "UI/TabbedDialogScreen.h" -#include "Common/File/Path.h" -#include "UI/RetroAchievements.h" // Lists the achievements and leaderboards for one game. class RetroAchievementsListScreen : public TabbedUIDialogScreenWithGameBackground { diff --git a/UI/UI.vcxproj b/UI/UI.vcxproj index 8546cf28a8..7cac1f3c79 100644 --- a/UI/UI.vcxproj +++ b/UI/UI.vcxproj @@ -59,7 +59,6 @@ - @@ -96,7 +95,6 @@ - diff --git a/UI/UI.vcxproj.filters b/UI/UI.vcxproj.filters index 767dc2b4e0..4ce9a0676a 100644 --- a/UI/UI.vcxproj.filters +++ b/UI/UI.vcxproj.filters @@ -86,7 +86,6 @@ Screens - Screens @@ -176,7 +175,6 @@ Screens - Screens @@ -189,4 +187,4 @@ {071baa63-c681-4ad6-945b-e126645d1b55} - + \ No newline at end of file diff --git a/UWP/CoreUWP/CoreUWP.vcxproj b/UWP/CoreUWP/CoreUWP.vcxproj index 87e4ce9796..ca53e7d496 100644 --- a/UWP/CoreUWP/CoreUWP.vcxproj +++ b/UWP/CoreUWP/CoreUWP.vcxproj @@ -330,6 +330,7 @@ + @@ -594,6 +595,7 @@ + @@ -615,459 +617,573 @@ NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing - + + NotUsing diff --git a/UWP/CoreUWP/CoreUWP.vcxproj.filters b/UWP/CoreUWP/CoreUWP.vcxproj.filters index f909a0f3c2..f6ccb537f0 100644 --- a/UWP/CoreUWP/CoreUWP.vcxproj.filters +++ b/UWP/CoreUWP/CoreUWP.vcxproj.filters @@ -1130,6 +1130,7 @@ MIPS + @@ -1692,9 +1693,6 @@ Debugger\WebSocket - - Debugger\WebSocket - Debugger\WebSocket @@ -1788,6 +1786,8 @@ MIPS + + diff --git a/UWP/UI_UWP/UI_UWP.vcxproj b/UWP/UI_UWP/UI_UWP.vcxproj index c0dbf319dd..ceb1d347cf 100644 --- a/UWP/UI_UWP/UI_UWP.vcxproj +++ b/UWP/UI_UWP/UI_UWP.vcxproj @@ -135,7 +135,6 @@ - @@ -173,7 +172,6 @@ - diff --git a/UWP/UI_UWP/UI_UWP.vcxproj.filters b/UWP/UI_UWP/UI_UWP.vcxproj.filters index 0914752d27..179a0bf35a 100644 --- a/UWP/UI_UWP/UI_UWP.vcxproj.filters +++ b/UWP/UI_UWP/UI_UWP.vcxproj.filters @@ -35,7 +35,6 @@ - @@ -73,7 +72,6 @@ - - + \ No newline at end of file diff --git a/android/jni/Android.mk b/android/jni/Android.mk index b50301efa4..1c29b20489 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -494,6 +494,7 @@ EXEC_AND_LIB_FILES := \ $(SRC)/Core/MemMapFunctions.cpp \ $(SRC)/Core/Reporting.cpp \ $(SRC)/Core/Replay.cpp \ + $(SRC)/Core/RetroAchievements.cpp \ $(SRC)/Core/SaveState.cpp \ $(SRC)/Core/Screenshot.cpp \ $(SRC)/Core/System.cpp \ @@ -784,7 +785,6 @@ LOCAL_SRC_FILES := \ $(SRC)/UI/NativeApp.cpp \ $(SRC)/UI/Theme.cpp \ $(SRC)/UI/CustomButtonMappingScreen.cpp \ - $(SRC)/UI/RetroAchievements.cpp \ $(SRC)/UI/RetroAchievementScreens.cpp ifneq ($(SKIPAPP),1) diff --git a/libretro/Makefile.common b/libretro/Makefile.common index 6bcdb192ab..bbff1ac654 100644 --- a/libretro/Makefile.common +++ b/libretro/Makefile.common @@ -666,6 +666,7 @@ SOURCES_CXX += \ $(COREDIR)/PSPLoaders.cpp \ $(COREDIR)/Replay.cpp \ $(COREDIR)/Reporting.cpp \ + $(COREDIR)/RetroAchievements.cpp \ $(COREDIR)/SaveState.cpp \ $(COREDIR)/Screenshot.cpp \ $(COREDIR)/System.cpp \