diff --git a/rcheevos b/rcheevos index f06b14aa4..f87c0de91 160000 --- a/rcheevos +++ b/rcheevos @@ -1 +1 @@ -Subproject commit f06b14aa41fa1ed41e0680c319314742c3cf1ebe +Subproject commit f87c0de911bb6f15dc8c1f6bf8a250d4b83e44db diff --git a/src/Exports.cpp b/src/Exports.cpp index 7633516ca..21525c05b 100644 --- a/src/Exports.cpp +++ b/src/Exports.cpp @@ -342,7 +342,7 @@ static void HandleLoginResponse(int nResult, const char* sErrorMessage, rc_clien if (bHardcore) vmMessage->SetDescription(ra::util::String::Printf(L"%u points", pUser->score)); else - vmMessage->SetDescription(ra::util::String::Printf(L"%u points (softcore)", pUser->score_softcore)); + vmMessage->SetDescription(ra::util::String::Printf(L"%u points (casual mode)", pUser->score_casual)); vmMessage->SetDetail((pUser->num_unread_messages == 1) ? L"You have 1 new message" diff --git a/src/data/context/GameContext.cpp b/src/data/context/GameContext.cpp index 477f940ac..a39784514 100644 --- a/src/data/context/GameContext.cpp +++ b/src/data/context/GameContext.cpp @@ -235,7 +235,7 @@ void GameContext::FinishLoadGame(int nResult, const char* sErrorMessage, bool bW EndLoadGame(nResult, bWasPaused, true); } -void GameContext::EndLoadGame(int nResult, bool bWasPaused, bool bShowSoftcoreWarning) +void GameContext::EndLoadGame(int nResult, bool bWasPaused, bool bShowCasualWarning) { { ra::data::models::RichPresenceModel* pRichPresence = nullptr; @@ -374,13 +374,13 @@ void GameContext::EndLoadGame(int nResult, bool bWasPaused, bool bShowSoftcoreWa if (vmWarning.ShowModal() == ra::ui::DialogResult::Yes) ra::services::ServiceLocator::GetMutable().EnableHardcoreMode(false); } - else if (bShowSoftcoreWarning) + else if (bShowCasualWarning) { const bool bLeaderboardsEnabled = pConfiguration.IsFeatureEnabled(ra::services::Feature::Leaderboards); ra::services::ServiceLocator::Get().PlayAudioFile(L"Overlay\\info.wav"); ra::services::ServiceLocator::GetMutable().QueueMessage( - L"Playing in Softcore Mode", + L"Playing in Casual Mode", bLeaderboardsEnabled ? L"Leaderboard entries will not be submitted." : L""); } } diff --git a/src/data/context/GameContext.hh b/src/data/context/GameContext.hh index d3e0ed283..9b3165600 100644 --- a/src/data/context/GameContext.hh +++ b/src/data/context/GameContext.hh @@ -144,7 +144,7 @@ private: friend class ra::services::AchievementRuntimeExports; bool BeginLoadGame(unsigned int nGameId, Mode nMode, bool& bWasPaused); - void EndLoadGame(int nResult, bool bWasPaused, bool bShowSoftcoreWarning); + void EndLoadGame(int nResult, bool bWasPaused, bool bShowCasualWarning); protected: void OnBeforeActiveGameChanged(); diff --git a/src/devkit/context/impl/RcClient.cpp b/src/devkit/context/impl/RcClient.cpp index e3dc14208..3d3713e1c 100644 --- a/src/devkit/context/impl/RcClient.cpp +++ b/src/devkit/context/impl/RcClient.cpp @@ -41,7 +41,7 @@ RcClient::RcClient() noexcept if (ra::services::ServiceLocator::Exists()) rc_client_enable_logging(m_pClient.get(), RC_CLIENT_LOG_LEVEL_VERBOSE, RcClient::LogMessage); - m_pClient->state.allow_leaderboards_in_softcore = true; + m_pClient->state.allow_leaderboards_in_casual = true; rc_client_set_unpromoted_enabled(m_pClient.get(), 1); } diff --git a/src/ui/viewmodels/OverlayViewModel.cpp b/src/ui/viewmodels/OverlayViewModel.cpp index c1163015c..b755f17aa 100644 --- a/src/ui/viewmodels/OverlayViewModel.cpp +++ b/src/ui/viewmodels/OverlayViewModel.cpp @@ -167,10 +167,10 @@ void OverlayViewModel::CreateRenderImage() const auto bHardcore = pConfiguration.IsFeatureEnabled(ra::services::Feature::Hardcore); const auto* pClient = ra::services::ServiceLocator::Get().GetClient(); const auto* pUser = rc_client_get_user_info(pClient); - const auto sPoints = ra::util::String::Printf(L"%u Points", !pUser ? 0 : bHardcore ? pUser->score : pUser->score_softcore); + const auto sPoints = ra::util::String::Printf(L"%u Points", !pUser ? 0 : bHardcore ? pUser->score : pUser->score_casual); const auto szPoints = m_pSurface->MeasureText(nSubFont, sPoints); - const auto sHardcore = bHardcore ? std::wstring(L"HARDCORE") : std::wstring(L"SOFTCORE"); + const auto sHardcore = bHardcore ? std::wstring(L"HARDCORE") : std::wstring(L"CASUAL MODE"); const auto szHardcore = m_pSurface->MeasureText(nDetailFont, sHardcore); constexpr auto nImageSize = 64; diff --git a/tests/Exports_Tests.cpp b/tests/Exports_Tests.cpp index b50b4a35e..d846bb45e 100644 --- a/tests/Exports_Tests.cpp +++ b/tests/Exports_Tests.cpp @@ -298,7 +298,7 @@ TEST_CLASS(Exports_Tests) Assert::IsTrue(bWasMenuRebuilt); } - TEST_METHOD(TestAttemptLoginSuccessWithPreviousSessionDataSoftcore) + TEST_METHOD(TestAttemptLoginSuccessWithPreviousSessionDataCasual) { AttemptLoginHarness harness; @@ -322,7 +322,7 @@ TEST_CLASS(Exports_Tests) Assert::IsNotNull(pPopup); Ensures(pPopup != nullptr); Assert::AreEqual(std::wstring(L"Welcome back User"), pPopup->GetTitle()); - Assert::AreEqual(std::wstring(L"123 points (softcore)"), pPopup->GetDescription()); + Assert::AreEqual(std::wstring(L"123 points (casual mode)"), pPopup->GetDescription()); Assert::AreEqual(std::wstring(L"You have 0 new messages"), pPopup->GetDetail()); Assert::AreEqual(ra::ui::ImageType::UserPic, pPopup->GetImage().Type()); Assert::AreEqual(std::string("User"), pPopup->GetImage().Name()); diff --git a/tests/data/context/EmulatorContext_Tests.cpp b/tests/data/context/EmulatorContext_Tests.cpp index b2b6829ef..bf385124e 100644 --- a/tests/data/context/EmulatorContext_Tests.cpp +++ b/tests/data/context/EmulatorContext_Tests.cpp @@ -411,7 +411,7 @@ TEST_CLASS(EmulatorContext_Tests) Assert::IsTrue(emulator.ValidateClientVersion()); Assert::IsTrue(emulator.mockDesktop.WasDialogShown()); Assert::AreEqual(std::string(), emulator.mockDesktop.LastOpenedUrl()); - // successful downgrade to softcore + // successful downgrade to casual Assert::IsFalse(emulator.mockConfiguration.IsFeatureEnabled(ra::services::Feature::Hardcore)); Assert::IsTrue(emulator.mockLoginService.IsLoggedIn()); @@ -660,7 +660,7 @@ TEST_CLASS(EmulatorContext_Tests) emulator.mockAchievementRuntime.MockLeaderboardWithLboard(32U); emulator.mockAchievementRuntime.MockAchievementWithTrigger(44U); auto* pAchievement45 = emulator.mockAchievementRuntime.MockAchievementWithTrigger(45U); - emulator.mockAchievementRuntime.UnlockAchievement(pAchievement45, RC_CLIENT_ACHIEVEMENT_UNLOCKED_SOFTCORE); + emulator.mockAchievementRuntime.UnlockAchievement(pAchievement45, RC_CLIENT_ACHIEVEMENT_UNLOCKED_CASUAL); auto* pAchievement46 = emulator.mockAchievementRuntime.MockAchievementWithTrigger(46U); emulator.mockAchievementRuntime.UnlockAchievement(pAchievement46, RC_CLIENT_ACHIEVEMENT_UNLOCKED_BOTH); emulator.mockGameContext.InitializeFromAchievementRuntime(); @@ -746,7 +746,7 @@ TEST_CLASS(EmulatorContext_Tests) emulator.mockAchievementRuntime.MockLeaderboardWithLboard(32U); emulator.mockAchievementRuntime.MockAchievementWithTrigger(44U); auto* pAchievement45 = emulator.mockAchievementRuntime.MockAchievementWithTrigger(45U); - emulator.mockAchievementRuntime.UnlockAchievement(pAchievement45, RC_CLIENT_ACHIEVEMENT_UNLOCKED_SOFTCORE); + emulator.mockAchievementRuntime.UnlockAchievement(pAchievement45, RC_CLIENT_ACHIEVEMENT_UNLOCKED_CASUAL); auto* pAchievement46 = emulator.mockAchievementRuntime.MockAchievementWithTrigger(46U); emulator.mockAchievementRuntime.UnlockAchievement(pAchievement46, RC_CLIENT_ACHIEVEMENT_UNLOCKED_BOTH); emulator.mockGameContext.InitializeFromAchievementRuntime(); @@ -918,7 +918,7 @@ TEST_CLASS(EmulatorContext_Tests) emulator.mockAchievementRuntime.MockLeaderboardWithLboard(32U); emulator.mockAchievementRuntime.MockAchievementWithTrigger(44U); auto* pAchievement45 = emulator.mockAchievementRuntime.MockAchievementWithTrigger(45U); - emulator.mockAchievementRuntime.UnlockAchievement(pAchievement45, RC_CLIENT_ACHIEVEMENT_UNLOCKED_SOFTCORE); + emulator.mockAchievementRuntime.UnlockAchievement(pAchievement45, RC_CLIENT_ACHIEVEMENT_UNLOCKED_CASUAL); auto* pAchievement46 = emulator.mockAchievementRuntime.MockAchievementWithTrigger(46U); emulator.mockAchievementRuntime.UnlockAchievement(pAchievement46, RC_CLIENT_ACHIEVEMENT_UNLOCKED_BOTH); emulator.mockGameContext.InitializeFromAchievementRuntime(); diff --git a/tests/data/context/GameContext_Tests.cpp b/tests/data/context/GameContext_Tests.cpp index 5714dfaa0..a7a46d24d 100644 --- a/tests/data/context/GameContext_Tests.cpp +++ b/tests/data/context/GameContext_Tests.cpp @@ -1431,13 +1431,13 @@ TEST_CLASS(GameContext_Tests) game.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true); game.LoadGame(1U, "0123456789abcdeffedcba987654321"); - // should get popup message indicating leaderboards not supported in softcore + // should get popup message indicating leaderboards not supported in casual mode game.mockFrameEventQueue.DoFrame(); // hardcore warning gets queued for the UI thread Assert::IsFalse(game.mockDesktop.WasDialogShown()); const auto* pPopup = game.mockOverlayManager.GetMessage(2U); Expects(pPopup != nullptr); - Assert::AreEqual(std::wstring(L"Playing in Softcore Mode"), pPopup->GetTitle()); + Assert::AreEqual(std::wstring(L"Playing in Casual Mode"), pPopup->GetTitle()); Assert::AreEqual(std::wstring(L"Leaderboard entries will not be submitted."), pPopup->GetDescription()); } @@ -1458,13 +1458,13 @@ TEST_CLASS(GameContext_Tests) game.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, false); game.LoadGame(1U, "0123456789abcdeffedcba987654321"); - // should get popup message indicating playing in softcore + // should get popup message indicating playing in casual mode game.mockFrameEventQueue.DoFrame(); // hardcore warning gets queued for the UI thread Assert::IsFalse(game.mockDesktop.WasDialogShown()); const auto* pPopup = game.mockOverlayManager.GetMessage(2U); Expects(pPopup != nullptr); - Assert::AreEqual(std::wstring(L"Playing in Softcore Mode"), pPopup->GetTitle()); + Assert::AreEqual(std::wstring(L"Playing in Casual Mode"), pPopup->GetTitle()); Assert::AreEqual(std::wstring(L""), pPopup->GetDescription()); } @@ -1552,13 +1552,13 @@ TEST_CLASS(GameContext_Tests) game.LoadGame(1U, "0123456789abcdeffedcba987654321"); - // should only get softcore popup + // should only get casual mode popup game.mockFrameEventQueue.DoFrame(); // hardcore warning gets queued for the UI thread Assert::IsFalse(game.mockDesktop.WasDialogShown()); const auto* pPopup = game.mockOverlayManager.GetMessage(2U); Expects(pPopup != nullptr); - Assert::AreEqual(std::wstring(L"Playing in Softcore Mode"), pPopup->GetTitle()); + Assert::AreEqual(std::wstring(L"Playing in Casual Mode"), pPopup->GetTitle()); Assert::AreEqual(std::wstring(L""), pPopup->GetDescription()); // hardcore should remain disabled diff --git a/tests/mocks/MockAchievementRuntime.cpp b/tests/mocks/MockAchievementRuntime.cpp index 851a1a45d..0b7e80f7d 100644 --- a/tests/mocks/MockAchievementRuntime.cpp +++ b/tests/mocks/MockAchievementRuntime.cpp @@ -190,8 +190,8 @@ void MockAchievementRuntime::UnlockAchievement(rc_client_achievement_info_t* pAc { pAchievement->public_.unlocked |= nMode; - if (pAchievement->unlock_time_softcore == 0) - pAchievement->unlock_time_softcore = time(nullptr); + if (pAchievement->unlock_time_casual == 0) + pAchievement->unlock_time_casual = time(nullptr); if (nMode == RC_CLIENT_ACHIEVEMENT_UNLOCKED_BOTH) { @@ -203,7 +203,7 @@ void MockAchievementRuntime::UnlockAchievement(rc_client_achievement_info_t* pAc if (pAchievement->trigger) pAchievement->trigger->state = RC_TRIGGER_STATE_TRIGGERED; } - else if (nMode == RC_CLIENT_ACHIEVEMENT_UNLOCKED_SOFTCORE && + else if (nMode == RC_CLIENT_ACHIEVEMENT_UNLOCKED_CASUAL && !rc_client_get_hardcore_enabled(GetClient())) { pAchievement->public_.state = RC_CLIENT_ACHIEVEMENT_STATE_UNLOCKED; diff --git a/tests/services/AchievementRuntime_Tests.cpp b/tests/services/AchievementRuntime_Tests.cpp index e07f3f81f..9dcd41166 100644 --- a/tests/services/AchievementRuntime_Tests.cpp +++ b/tests/services/AchievementRuntime_Tests.cpp @@ -1921,7 +1921,7 @@ TEST_CLASS(AchievementRuntime_Tests) Assert::IsTrue(runtime.mockAudioSystem.WasAudioFilePlayed(L"Overlay\\acherror.wav")); } - TEST_METHOD(TestHandleAchievementTriggeredEventMemoryInsecureSoftcore) + TEST_METHOD(TestHandleAchievementTriggeredEventMemoryInsecureCasual) { AchievementRuntimeHarness runtime; auto* pAch6 = runtime.MockAchievement(6U, "0xH0000=1"); @@ -2351,7 +2351,7 @@ TEST_CLASS(AchievementRuntime_Tests) Assert::IsTrue(runtime.mockAudioSystem.WasAudioFilePlayed(L"Overlay\\unlock.wav")); } - TEST_METHOD(TestHandleGameCompletedEventSoftcore) + TEST_METHOD(TestHandleGameCompletedEventCasual) { AchievementRuntimeHarness runtime; runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, false); @@ -2420,7 +2420,7 @@ TEST_CLASS(AchievementRuntime_Tests) Assert::IsTrue(runtime.mockAudioSystem.WasAudioFilePlayed(L"Overlay\\unlock.wav")); } - TEST_METHOD(TestHandleSubsetCompletedEventSoftcore) + TEST_METHOD(TestHandleSubsetCompletedEventCasual) { AchievementRuntimeHarness runtime; runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, false); @@ -2781,7 +2781,7 @@ TEST_CLASS(AchievementRuntime_Tests) AssertSimpleScoreboard(runtime, 4U); } - TEST_METHOD(TestHandleLeaderboardSubmittedEventSoftcore) + TEST_METHOD(TestHandleLeaderboardSubmittedEventCasual) { AchievementRuntimeHarness runtime; runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, false);