diff --git a/src/RA_Integration.vcxproj b/src/RA_Integration.vcxproj
index 0dae967e..fbdecff4 100644
--- a/src/RA_Integration.vcxproj
+++ b/src/RA_Integration.vcxproj
@@ -222,7 +222,8 @@
-
+
+
diff --git a/src/RA_Integration.vcxproj.filters b/src/RA_Integration.vcxproj.filters
index da122679..66152c94 100644
--- a/src/RA_Integration.vcxproj.filters
+++ b/src/RA_Integration.vcxproj.filters
@@ -404,7 +404,7 @@
Services
-
+
Services
@@ -938,6 +938,9 @@
Services
+
+ Services\Impl
+
diff --git a/src/devkit/RADevKit.vcxproj b/src/devkit/RADevKit.vcxproj
index 9fffc599..e9d7ba5d 100644
--- a/src/devkit/RADevKit.vcxproj
+++ b/src/devkit/RADevKit.vcxproj
@@ -123,6 +123,7 @@
+
diff --git a/src/devkit/RADevKit.vcxproj.filters b/src/devkit/RADevKit.vcxproj.filters
index 6e4a8169..8caaac06 100644
--- a/src/devkit/RADevKit.vcxproj.filters
+++ b/src/devkit/RADevKit.vcxproj.filters
@@ -219,6 +219,9 @@
data\models
+
+ services
+
diff --git a/src/services/IConfiguration.hh b/src/devkit/services/IConfiguration.hh
similarity index 62%
rename from src/services/IConfiguration.hh
rename to src/devkit/services/IConfiguration.hh
index 3146edd4..bc45e82a 100644
--- a/src/services/IConfiguration.hh
+++ b/src/devkit/services/IConfiguration.hh
@@ -2,8 +2,7 @@
#define RA_SERVICES_ICONFIGURATION
#pragma once
-#include "ui\Types.hh"
-#include "ui\viewmodels\PopupViewModelBase.hh"
+#include
namespace ra {
namespace services {
@@ -21,7 +20,6 @@ enum class Feature
Offline,
};
-
class IConfiguration
{
public:
@@ -61,46 +59,20 @@ public:
///
virtual void SetFeatureEnabled(Feature nFeature, bool bEnabled) = 0;
- ///
- /// Gets where the specified popup should be displayed.
- ///
- virtual ra::ui::viewmodels::PopupLocation GetPopupLocation(ra::ui::viewmodels::Popup nPopup) const = 0;
-
- ///
- /// Sets where the specified popup should be displayed.
- ///
- virtual void SetPopupLocation(ra::ui::viewmodels::Popup nPopup, ra::ui::viewmodels::PopupLocation nPopupLocation) = 0;
-
///
/// Gets the number of background threads to spawn.
///
virtual unsigned int GetNumBackgroundThreads() const = 0;
- virtual const std::wstring& GetRomDirectory() const = 0;
- virtual void SetRomDirectory(const std::wstring& sValue) = 0;
-
- virtual const std::wstring& GetScreenshotDirectory() const = 0;
- virtual void SetScreenshotDirectory(const std::wstring& sValue) = 0;
-
///
- /// Gets the remembered position of the window identified by .
+ /// Gets the directory where screenshots should be stored.
///
- virtual ra::ui::Position GetWindowPosition(const std::string& sPositionKey) const = 0;
-
- ///
- /// Sets the position to remember for the window identified by .
- ///
- virtual void SetWindowPosition(const std::string& sPositionKey, const ra::ui::Position& oPosition) = 0;
-
- ///
- /// Gets the remembered size of the window identified by .
- ///
- virtual ra::ui::Size GetWindowSize(const std::string& sPositionKey) const = 0;
+ virtual const std::wstring& GetScreenshotDirectory() const = 0;
///
- /// Sets the size to remember for the window identified by .
+ /// Sets the directory where screenshots should be stored.
///
- virtual void SetWindowSize(const std::string& sPositionKey, const ra::ui::Size& oSize) = 0;
+ virtual void SetScreenshotDirectory(const std::wstring& sValue) = 0;
///
/// Gets whether or not a custom host was provided.
@@ -117,11 +89,6 @@ public:
///
virtual const std::string& GetHostUrl() const = 0;
- ///
- /// Gets the URL to the host to communicate with (includes protocol) for image retrieval.
- ///
- virtual const std::string& GetImageHostUrl() const = 0;
-
///
/// Saves the current configuration so it can be used in a future session.
///
diff --git a/src/services/AchievementRuntime.cpp b/src/services/AchievementRuntime.cpp
index a0ffb4bd..15f48b51 100644
--- a/src/services/AchievementRuntime.cpp
+++ b/src/services/AchievementRuntime.cpp
@@ -1136,7 +1136,8 @@ static void HandleAchievementTriggeredEvent(const rc_client_achievement_t& pAchi
ra::services::ServiceLocator::Get().PlayAudioFile(sAudioPath);
- if (pConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered) !=
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ if (pWindowConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered) !=
ra::ui::viewmodels::PopupLocation::None)
{
auto& pOverlayManager = ra::services::ServiceLocator::GetMutable();
@@ -1163,8 +1164,8 @@ static void HandleChallengeIndicatorShowEvent(const rc_client_achievement_t& pAc
return;
}
- const auto& pConfiguration = ra::services::ServiceLocator::Get();
- if (pConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::Challenge) !=
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ if (pWindowConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::Challenge) !=
ra::ui::viewmodels::PopupLocation::None)
{
auto& pOverlayManager = ra::services::ServiceLocator::GetMutable();
@@ -1189,8 +1190,8 @@ static void HandleProgressIndicatorUpdateEvent(const rc_client_achievement_t& pA
return;
}
- const auto& pConfiguration = ra::services::ServiceLocator::Get();
- if (pConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::Progress) != ra::ui::viewmodels::PopupLocation::None)
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ if (pWindowConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::Progress) != ra::ui::viewmodels::PopupLocation::None)
{
auto& pOverlayManager = ra::services::ServiceLocator::GetMutable();
@@ -1217,10 +1218,11 @@ static void HandleProgressIndicatorHideEvent()
static void ShowCompletionPopup(uint32_t nGameId, const std::wstring& sTitle, uint32_t nAchievements, uint32_t nPoints, const std::string& sBadgeName)
{
- const auto& pConfiguration = ra::services::ServiceLocator::Get();
- if (pConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::Mastery) == ra::ui::viewmodels::PopupLocation::None)
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ if (pWindowConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::Mastery) == ra::ui::viewmodels::PopupLocation::None)
return;
+ const auto& pConfiguration = ra::services::ServiceLocator::Get();
const bool bHardcore = pConfiguration.IsFeatureEnabled(ra::services::Feature::Hardcore);
const auto& pGameContext = ra::services::ServiceLocator::Get();
@@ -1293,7 +1295,8 @@ static void HandleLeaderboardStartedEvent(const rc_client_leaderboard_t& pLeader
}
const auto& pConfiguration = ra::services::ServiceLocator::Get();
- if (pConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardStarted) !=
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ if (pWindowConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardStarted) !=
ra::ui::viewmodels::PopupLocation::None &&
pConfiguration.IsFeatureEnabled(ra::services::Feature::Leaderboards))
{
@@ -1315,7 +1318,8 @@ static void HandleLeaderboardFailedEvent(const rc_client_leaderboard_t& pLeaderb
}
const auto& pConfiguration = ra::services::ServiceLocator::Get();
- if (pConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardCanceled) !=
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ if (pWindowConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardCanceled) !=
ra::ui::viewmodels::PopupLocation::None &&
pConfiguration.IsFeatureEnabled(ra::services::Feature::Leaderboards))
{
@@ -1329,7 +1333,8 @@ static void HandleLeaderboardFailedEvent(const rc_client_leaderboard_t& pLeaderb
static void ShowSimplifiedScoreboard(const rc_client_leaderboard_t& pLeaderboard)
{
auto& pConfiguration = ra::services::ServiceLocator::Get();
- if (pConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard) ==
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ if (pWindowConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard) ==
ra::ui::viewmodels::PopupLocation::None ||
!pConfiguration.IsFeatureEnabled(ra::services::Feature::Leaderboards))
{
@@ -1455,7 +1460,8 @@ static void HandleLeaderboardTrackerUpdateEvent(const rc_client_leaderboard_trac
static void HandleLeaderboardTrackerShowEvent(const rc_client_leaderboard_tracker_t& pTracker)
{
const auto& pConfiguration = ra::services::ServiceLocator::Get();
- if (pConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker) !=
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ if (pWindowConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker) !=
ra::ui::viewmodels::PopupLocation::None &&
pConfiguration.IsFeatureEnabled(ra::services::Feature::Leaderboards))
{
@@ -1475,7 +1481,8 @@ static void HandleLeaderboardScoreboardEvent(const rc_client_leaderboard_scorebo
const rc_client_leaderboard_t& pLeaderboard)
{
auto& pConfiguration = ra::services::ServiceLocator::Get();
- if (pConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard) ==
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ if (pWindowConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard) ==
ra::ui::viewmodels::PopupLocation::None ||
!pConfiguration.IsFeatureEnabled(ra::services::Feature::Leaderboards))
{
diff --git a/src/services/IWindowConfiguration.hh b/src/services/IWindowConfiguration.hh
new file mode 100644
index 00000000..a4341b06
--- /dev/null
+++ b/src/services/IWindowConfiguration.hh
@@ -0,0 +1,57 @@
+#ifndef RA_SERVICES_IWINDOWCONFIGURATION
+#define RA_SERVICES_IWINDOWCONFIGURATION
+#pragma once
+
+#include "ui\Types.hh"
+#include "ui\viewmodels\PopupViewModelBase.hh"
+
+namespace ra {
+namespace services {
+
+class IWindowConfiguration
+{
+public:
+ virtual ~IWindowConfiguration() noexcept = default;
+ IWindowConfiguration(const IWindowConfiguration&) noexcept = delete;
+ IWindowConfiguration& operator=(const IWindowConfiguration&) noexcept = delete;
+ IWindowConfiguration(IWindowConfiguration&&) noexcept = delete;
+ IWindowConfiguration& operator=(IWindowConfiguration&&) noexcept = delete;
+
+ ///
+ /// Gets where the specified popup should be displayed.
+ ///
+ virtual ra::ui::viewmodels::PopupLocation GetPopupLocation(ra::ui::viewmodels::Popup nPopup) const = 0;
+
+ ///
+ /// Sets where the specified popup should be displayed.
+ ///
+ virtual void SetPopupLocation(ra::ui::viewmodels::Popup nPopup, ra::ui::viewmodels::PopupLocation nPopupLocation) = 0;
+
+ ///
+ /// Gets the remembered position of the window identified by .
+ ///
+ virtual ra::ui::Position GetWindowPosition(const std::string& sPositionKey) const = 0;
+
+ ///
+ /// Sets the position to remember for the window identified by .
+ ///
+ virtual void SetWindowPosition(const std::string& sPositionKey, const ra::ui::Position& oPosition) = 0;
+
+ ///
+ /// Gets the remembered size of the window identified by .
+ ///
+ virtual ra::ui::Size GetWindowSize(const std::string& sPositionKey) const = 0;
+
+ ///
+ /// Sets the size to remember for the window identified by .
+ ///
+ virtual void SetWindowSize(const std::string& sPositionKey, const ra::ui::Size& oSize) = 0;
+
+protected:
+ IWindowConfiguration() noexcept = default;
+};
+
+} // namespace services
+} // namespace ra
+
+#endif // !RA_SERVICES_IWINDOWCONFIGURATION
diff --git a/src/services/Initialization.cpp b/src/services/Initialization.cpp
index 13a7b395..4a3788da 100644
--- a/src/services/Initialization.cpp
+++ b/src/services/Initialization.cpp
@@ -20,6 +20,7 @@
#include "services\impl\Clock.hh"
#include "services\impl\FileLocalStorage.hh"
#include "services\impl\JsonFileConfiguration.hh"
+#include "services\impl\JsonFileWindowConfiguration.hh"
#include "services\impl\LoginService.hh"
#include "services\impl\MessageDispatcher.hh"
#include "services\impl\ThreadPool.hh"
@@ -141,6 +142,9 @@ void Initialization::RegisterServices(EmulatorID nEmulatorId, const char* sClien
const auto sFilename = ra::util::String::Printf(L"%sRAPrefs_%s.cfg", pFileSystem.BaseDirectory(), sClientName);
pConfiguration->Load(sFilename);
+ auto pWindowConfiguration = std::make_unique(*pConfiguration);
+ ra::services::ServiceLocator::Provide(std::move(pWindowConfiguration));
+
auto pLocalStorage = std::make_unique(pFileSystem);
ra::services::ServiceLocator::Provide(std::move(pLocalStorage));
diff --git a/src/services/impl/JsonFileConfiguration.cpp b/src/services/impl/JsonFileConfiguration.cpp
index a65c37ba..dab8b33e 100644
--- a/src/services/impl/JsonFileConfiguration.cpp
+++ b/src/services/impl/JsonFileConfiguration.cpp
@@ -7,6 +7,8 @@
#include "services\IFileSystem.hh"
#include "services\ServiceLocator.hh"
+#include
+
#ifndef RA_UTEST
#include "services\impl\StringTextWriter.hh"
#include "services\impl\WindowsHttpRequester.hh"
@@ -69,7 +71,6 @@ bool JsonFileConfiguration::Load(const std::wstring& sFilename)
// default values
m_sUsername.clear();
m_sApiToken.clear();
- m_sRomDirectory.clear();
m_mWindowPositions.clear();
m_nBackgroundThreads = 8;
m_vEnabledFeatures =
@@ -133,8 +134,6 @@ bool JsonFileConfiguration::Load(const std::wstring& sFilename)
if (doc.HasMember("Num Background Threads"))
m_nBackgroundThreads = doc["Num Background Threads"].GetUint();
- if (doc.HasMember("ROM Directory"))
- m_sRomDirectory = ra::util::String::Widen(doc["ROM Directory"].GetString());
if (doc.HasMember("Window Positions"))
{
@@ -223,9 +222,6 @@ void JsonFileConfiguration::Save() const
doc.AddMember("Prefer Decimal", IsFeatureEnabled(Feature::PreferDecimal), a);
doc.AddMember("Num Background Threads", m_nBackgroundThreads, a);
- if (!m_sRomDirectory.empty())
- doc.AddMember("ROM Directory", ra::util::String::Narrow(m_sRomDirectory), a);
-
if (!m_sScreenshotDirectory.empty())
doc.AddMember("Screenshot Directory", ra::util::String::Narrow(m_sScreenshotDirectory), a);
@@ -330,14 +326,6 @@ const std::string& JsonFileConfiguration::GetHostUrl() const
return m_sHostUrl;
}
-const std::string& JsonFileConfiguration::GetImageHostUrl() const
-{
- if (m_sImageHostUrl.empty())
- GSL_SUPPRESS_TYPE3 const_cast(this)->ReadHostFile();
-
- return m_sImageHostUrl;
-}
-
void JsonFileConfiguration::ReadHostFile()
{
const auto& pFileSystem = ra::services::ServiceLocator::Get();
@@ -356,9 +344,7 @@ void JsonFileConfiguration::UpdateHost()
if (m_sHostName.empty())
{
m_bCustomHost = false;
- m_sHostName = "retroachievements.org";
- m_sHostUrl = "https://retroachievements.org";
- m_sImageHostUrl = "http://i.retroachievements.org";
+ m_sHostUrl = rc_api_default_host();
#ifndef RA_UTEST
const auto sOSVersion = ra::ui::win32::Desktop::GetWindowsVersionString();
@@ -389,7 +375,7 @@ void JsonFileConfiguration::UpdateHost()
"An error occurred trying to communicate with the server via secure protocols. Switching to non-secure protocols.\n\n"
"retroachievements.org requires TLS 1.2 or higher. You may need to manually enable it on this operating system. Note that non-secure protocols are deprecated and will no longer be allowed at some point in the future.",
"Security Error", MB_OK);
- m_sHostUrl = "http://retroachievements.org";
+ m_sHostUrl.erase(m_sHostUrl.begin() + 4, m_sHostUrl.begin() + 5);
}
}
}
@@ -402,18 +388,13 @@ void JsonFileConfiguration::UpdateHost()
const auto nIndex = m_sHostName.find("://");
if (nIndex == std::string::npos)
- {
m_sHostUrl = "http://" + m_sHostName;
- }
else
- {
m_sHostUrl.swap(m_sHostName);
- m_sHostName = m_sHostUrl.substr(nIndex + 3);
- }
-
- m_sImageHostUrl = m_sHostUrl;
}
+ m_sHostName = m_sHostUrl.substr(m_sHostUrl.find("://") + 3);
+
RA_LOG_INFO("Using server: %s", m_sHostUrl.c_str());
}
diff --git a/src/services/impl/JsonFileConfiguration.hh b/src/services/impl/JsonFileConfiguration.hh
index 271cb1ed..5b7e5622 100644
--- a/src/services/impl/JsonFileConfiguration.hh
+++ b/src/services/impl/JsonFileConfiguration.hh
@@ -3,12 +3,13 @@
#pragma once
#include "services\IConfiguration.hh"
+#include "services\IWindowConfiguration.hh"
namespace ra {
namespace services {
namespace impl {
-class JsonFileConfiguration : public IConfiguration
+class JsonFileConfiguration : public IConfiguration, public IWindowConfiguration
{
public:
bool Load(const std::wstring& sFilename);
@@ -26,9 +27,6 @@ public:
unsigned int GetNumBackgroundThreads() const noexcept override { return m_nBackgroundThreads; }
- const std::wstring& GetRomDirectory() const noexcept override { return m_sRomDirectory; }
- void SetRomDirectory(const std::wstring& sValue) override { m_sRomDirectory = sValue; }
-
const std::wstring& GetScreenshotDirectory() const noexcept override { return m_sScreenshotDirectory; }
void SetScreenshotDirectory(const std::wstring& sValue) override { m_sScreenshotDirectory = sValue; }
@@ -42,7 +40,6 @@ public:
bool IsCustomHost() const noexcept override { return m_bCustomHost; }
const std::string& GetHostName() const override;
const std::string& GetHostUrl() const override;
- const std::string& GetImageHostUrl() const override;
void Save() const override;
@@ -58,7 +55,6 @@ private:
std::array m_vPopupLocations = {};
unsigned int m_nBackgroundThreads = 8;
- std::wstring m_sRomDirectory;
std::wstring m_sScreenshotDirectory;
typedef struct WindowPosition
@@ -73,7 +69,6 @@ private:
bool m_bCustomHost = false;
std::string m_sHostName;
std::string m_sHostUrl;
- std::string m_sImageHostUrl;
std::wstring m_sFilename;
};
diff --git a/src/services/impl/JsonFileWindowConfiguration.hh b/src/services/impl/JsonFileWindowConfiguration.hh
new file mode 100644
index 00000000..e75bb5b2
--- /dev/null
+++ b/src/services/impl/JsonFileWindowConfiguration.hh
@@ -0,0 +1,54 @@
+#ifndef RA_SERVICES_JSON_FILE_WINDOWCONFIGUATION_HH
+#define RA_SERVICES_JSON_FILE_WINDOWCONFIGUATION_HH
+#pragma once
+
+#include "services\IWindowConfiguration.hh"
+
+namespace ra {
+namespace services {
+namespace impl {
+
+class JsonFileWindowConfiguration : public IWindowConfiguration
+{
+public:
+ JsonFileWindowConfiguration(IWindowConfiguration& pParent) noexcept
+ : m_pParent(pParent)
+ {
+ }
+
+ ra::ui::viewmodels::PopupLocation GetPopupLocation(ra::ui::viewmodels::Popup nPopup) const override
+ {
+ return m_pParent.GetPopupLocation(nPopup);
+ }
+ void SetPopupLocation(ra::ui::viewmodels::Popup nPopup, ra::ui::viewmodels::PopupLocation nPopupLocation) override
+ {
+ m_pParent.SetPopupLocation(nPopup, nPopupLocation);
+ }
+
+ ra::ui::Position GetWindowPosition(const std::string& sPositionKey) const override
+ {
+ return m_pParent.GetWindowPosition(sPositionKey);
+ }
+ void SetWindowPosition(const std::string& sPositionKey, const ra::ui::Position& oPosition) override
+ {
+ m_pParent.SetWindowPosition(sPositionKey, oPosition);
+ }
+
+ ra::ui::Size GetWindowSize(const std::string& sPositionKey) const override
+ {
+ return m_pParent.GetWindowSize(sPositionKey);
+ }
+ void SetWindowSize(const std::string& sPositionKey, const ra::ui::Size& oSize) override
+ {
+ m_pParent.SetWindowSize(sPositionKey, oSize);
+ }
+
+private:
+ IWindowConfiguration& m_pParent;
+};
+
+} // namespace impl
+} // namespace services
+} // namespace ra
+
+#endif // !RA_SERVICES_JSON_FILE_WINDOWCONFIGUATION_HH
diff --git a/src/ui/drawing/gdi/ImageRepository.cpp b/src/ui/drawing/gdi/ImageRepository.cpp
index b8a1fb6f..e6fe8913 100644
--- a/src/ui/drawing/gdi/ImageRepository.cpp
+++ b/src/ui/drawing/gdi/ImageRepository.cpp
@@ -6,6 +6,8 @@
#include "RA_md5factory.h"
#include "util\Log.hh"
+#include "context\IRcClient.hh"
+
#include "data\context\GameContext.hh"
#include "services\Http.hh"
@@ -14,6 +16,8 @@
#include "services\IThreadPool.hh"
#include "services\ServiceLocator.hh"
+#include
+
namespace ra {
namespace ui {
namespace drawing {
@@ -185,26 +189,32 @@ void ImageRepository::FetchImage(ImageType nType, const std::string& sName, cons
std::string sUrl = sSourceUrl;
if (sSourceUrl.empty())
{
+ const auto& pRcClient = ra::services::ServiceLocator::Get();
+ rc_api_fetch_image_request_t api_params;
+ memset(&api_params, 0, sizeof(api_params));
+ api_params.image_name = sName.c_str();
switch (nType)
{
case ImageType::Badge:
- sUrl = pConfiguration.GetImageHostUrl();
- sUrl += "/Badge/";
+ api_params.image_type = RC_IMAGE_TYPE_ACHIEVEMENT;
break;
+
case ImageType::UserPic:
- sUrl = pConfiguration.GetHostUrl();
- sUrl += "/UserPic/";
+ api_params.image_type = RC_IMAGE_TYPE_USER;
break;
+
case ImageType::Icon:
- sUrl = pConfiguration.GetImageHostUrl();
- sUrl += "/Images/";
+ api_params.image_type = RC_IMAGE_TYPE_GAME;
break;
- default:
- Expects(!"Unsupported image type");
- return;
}
- sUrl += sName;
- sUrl += ".png";
+
+ rc_api_request_t api_request;
+ if (rc_api_init_fetch_image_request_hosted(&api_request, &api_params, pRcClient.GetHost()) == RC_OK)
+ sUrl = api_request.url;
+
+ rc_api_destroy_request(&api_request);
+ if (sUrl.empty())
+ return;
}
RA_LOG_INFO("Downloading %s", sUrl.c_str());
diff --git a/src/ui/viewmodels/OverlayManager.cpp b/src/ui/viewmodels/OverlayManager.cpp
index 608d750c..88bafa2b 100644
--- a/src/ui/viewmodels/OverlayManager.cpp
+++ b/src/ui/viewmodels/OverlayManager.cpp
@@ -3,8 +3,8 @@
#include "util\Log.hh"
#include "services\IClock.hh"
-#include "services\IConfiguration.hh"
#include "services\IThreadPool.hh"
+#include "services\IWindowConfiguration.hh"
#include "services\ServiceLocator.hh"
#include "ui\IDesktop.hh"
@@ -433,8 +433,8 @@ void OverlayManager::ClearLeaderboardPopups()
ra::ui::Position OverlayManager::GetRenderLocation(const ra::ui::viewmodels::PopupViewModelBase& vmPopup,
int nX, int nY, const ra::ui::drawing::ISurface& pSurface, const PopupLocations& pPopupLocations)
{
- const auto& pConfiguration = ra::services::ServiceLocator::Get();
- const auto nPopupLocation = pConfiguration.GetPopupLocation(vmPopup.GetPopupType());
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ const auto nPopupLocation = pWindowConfiguration.GetPopupLocation(vmPopup.GetPopupType());
Position nPos;
nPos.X = nX;
@@ -563,8 +563,8 @@ void OverlayManager::UpdatePopup(ra::ui::drawing::ISurface& pSurface, const Popu
void OverlayManager::AdjustLocationForPopup(PopupLocations& pPopupLocations, const ra::ui::viewmodels::PopupViewModelBase& vmPopup)
{
- const auto& pConfiguration = ra::services::ServiceLocator::Get();
- const auto nPopupLocation = pConfiguration.GetPopupLocation(vmPopup.GetPopupType());
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ const auto nPopupLocation = pWindowConfiguration.GetPopupLocation(vmPopup.GetPopupType());
const auto nHeight = vmPopup.GetRenderImage().GetHeight();
const auto nOffset = vmPopup.GetVerticalOffset() + nHeight;
@@ -642,8 +642,8 @@ void OverlayManager::UpdateScoreTrackers(ra::ui::drawing::ISurface& pSurface, Po
assert(!m_vScoreTrackers.empty());
const auto& pAssets = ra::services::ServiceLocator::Get().Assets();
- const auto& pConfiguration = ra::services::ServiceLocator::Get();
- const auto bEnabled = (pConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker) != ra::ui::viewmodels::PopupLocation::None);
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ const auto bEnabled = (pWindowConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker) != ra::ui::viewmodels::PopupLocation::None);
std::set vDisplayedValues;
auto pIter = m_vScoreTrackers.begin();
@@ -696,8 +696,8 @@ void OverlayManager::UpdateChallengeIndicators(ra::ui::drawing::ISurface& pSurfa
constexpr int nSpacing = 10;
auto nRenderX = nSpacing;
- const auto& pConfiguration = ra::services::ServiceLocator::Get();
- const auto bEnabled = (pConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::Challenge) != ra::ui::viewmodels::PopupLocation::None);
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ const auto bEnabled = (pWindowConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::Challenge) != ra::ui::viewmodels::PopupLocation::None);
if (bEnabled)
{
// adjust offsets so the items appear horizontally stacked
@@ -750,8 +750,8 @@ void OverlayManager::UpdateProgressTracker(ra::ui::drawing::ISurface& pSurface,
}
else
{
- const auto& pConfiguration = ra::services::ServiceLocator::Get();
- const auto bEnabled = (pConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::Progress) != ra::ui::viewmodels::PopupLocation::None);
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ const auto bEnabled = (pWindowConfiguration.GetPopupLocation(ra::ui::viewmodels::Popup::Progress) != ra::ui::viewmodels::PopupLocation::None);
if (bEnabled)
AdjustLocationForPopup(pPopupLocations, *m_vmProgressTracker);
diff --git a/src/ui/viewmodels/OverlaySettingsViewModel.cpp b/src/ui/viewmodels/OverlaySettingsViewModel.cpp
index fcd8bd75..103ee920 100644
--- a/src/ui/viewmodels/OverlaySettingsViewModel.cpp
+++ b/src/ui/viewmodels/OverlaySettingsViewModel.cpp
@@ -1,6 +1,7 @@
#include "OverlaySettingsViewModel.hh"
#include "services\IConfiguration.hh"
+#include "services\IWindowConfiguration.hh"
#include "services\ServiceLocator.hh"
#include "ui\viewmodels\FileDialogViewModel.hh"
@@ -44,22 +45,24 @@ OverlaySettingsViewModel::OverlaySettingsViewModel() noexcept
void OverlaySettingsViewModel::Initialize()
{
const auto& pConfiguration = ra::services::ServiceLocator::Get();
- SetMessageLocation(pConfiguration.GetPopupLocation(Popup::Message));
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+
+ SetMessageLocation(pWindowConfiguration.GetPopupLocation(Popup::Message));
// set screenshot before location so location is given preference
SetScreenshotAchievementTrigger(pConfiguration.IsFeatureEnabled(ra::services::Feature::AchievementTriggeredScreenshot));
- SetAchievementTriggerLocation(pConfiguration.GetPopupLocation(Popup::AchievementTriggered));
+ SetAchievementTriggerLocation(pWindowConfiguration.GetPopupLocation(Popup::AchievementTriggered));
SetScreenshotMastery(pConfiguration.IsFeatureEnabled(ra::services::Feature::MasteryNotificationScreenshot));
- SetMasteryLocation(pConfiguration.GetPopupLocation(Popup::Mastery));
+ SetMasteryLocation(pWindowConfiguration.GetPopupLocation(Popup::Mastery));
- SetLeaderboardStartedLocation(pConfiguration.GetPopupLocation(Popup::LeaderboardStarted));
- SetLeaderboardCanceledLocation(pConfiguration.GetPopupLocation(Popup::LeaderboardCanceled));
- SetLeaderboardTrackerLocation(pConfiguration.GetPopupLocation(Popup::LeaderboardTracker));
- SetLeaderboardScoreboardLocation(pConfiguration.GetPopupLocation(Popup::LeaderboardScoreboard));
+ SetLeaderboardStartedLocation(pWindowConfiguration.GetPopupLocation(Popup::LeaderboardStarted));
+ SetLeaderboardCanceledLocation(pWindowConfiguration.GetPopupLocation(Popup::LeaderboardCanceled));
+ SetLeaderboardTrackerLocation(pWindowConfiguration.GetPopupLocation(Popup::LeaderboardTracker));
+ SetLeaderboardScoreboardLocation(pWindowConfiguration.GetPopupLocation(Popup::LeaderboardScoreboard));
- SetActiveChallengeLocation(pConfiguration.GetPopupLocation(Popup::Challenge));
- SetProgressTrackerLocation(pConfiguration.GetPopupLocation(Popup::Progress));
+ SetActiveChallengeLocation(pWindowConfiguration.GetPopupLocation(Popup::Challenge));
+ SetProgressTrackerLocation(pWindowConfiguration.GetPopupLocation(Popup::Progress));
SetScreenshotLocation(pConfiguration.GetScreenshotDirectory());
}
@@ -67,18 +70,19 @@ void OverlaySettingsViewModel::Initialize()
void OverlaySettingsViewModel::Commit()
{
auto& pConfiguration = ra::services::ServiceLocator::GetMutable();
+ auto& pWindowConfiguration = ra::services::ServiceLocator::GetMutable();
- pConfiguration.SetPopupLocation(Popup::Message, GetMessageLocation());
- pConfiguration.SetPopupLocation(Popup::AchievementTriggered, GetAchievementTriggerLocation());
+ pWindowConfiguration.SetPopupLocation(Popup::Message, GetMessageLocation());
+ pWindowConfiguration.SetPopupLocation(Popup::AchievementTriggered, GetAchievementTriggerLocation());
pConfiguration.SetFeatureEnabled(ra::services::Feature::AchievementTriggeredScreenshot, ScreenshotAchievementTrigger());
- pConfiguration.SetPopupLocation(Popup::Mastery, GetMasteryLocation());
+ pWindowConfiguration.SetPopupLocation(Popup::Mastery, GetMasteryLocation());
pConfiguration.SetFeatureEnabled(ra::services::Feature::MasteryNotificationScreenshot, ScreenshotMastery());
- pConfiguration.SetPopupLocation(Popup::LeaderboardStarted, GetLeaderboardStartedLocation());
- pConfiguration.SetPopupLocation(Popup::LeaderboardCanceled, GetLeaderboardCanceledLocation());
- pConfiguration.SetPopupLocation(Popup::LeaderboardTracker, GetLeaderboardTrackerLocation());
- pConfiguration.SetPopupLocation(Popup::LeaderboardScoreboard, GetLeaderboardScoreboardLocation());
- pConfiguration.SetPopupLocation(Popup::Challenge, GetActiveChallengeLocation());
- pConfiguration.SetPopupLocation(Popup::Progress, GetProgressTrackerLocation());
+ pWindowConfiguration.SetPopupLocation(Popup::LeaderboardStarted, GetLeaderboardStartedLocation());
+ pWindowConfiguration.SetPopupLocation(Popup::LeaderboardCanceled, GetLeaderboardCanceledLocation());
+ pWindowConfiguration.SetPopupLocation(Popup::LeaderboardTracker, GetLeaderboardTrackerLocation());
+ pWindowConfiguration.SetPopupLocation(Popup::LeaderboardScoreboard, GetLeaderboardScoreboardLocation());
+ pWindowConfiguration.SetPopupLocation(Popup::Challenge, GetActiveChallengeLocation());
+ pWindowConfiguration.SetPopupLocation(Popup::Progress, GetProgressTrackerLocation());
std::wstring sLocation = ScreenshotLocation();
if (!sLocation.empty() && sLocation.back() != '\\')
diff --git a/src/ui/win32/bindings/WindowBinding.cpp b/src/ui/win32/bindings/WindowBinding.cpp
index 9a399e0d..49ac2f2a 100644
--- a/src/ui/win32/bindings/WindowBinding.cpp
+++ b/src/ui/win32/bindings/WindowBinding.cpp
@@ -6,7 +6,7 @@
#include "data\ModelProperty.hh"
-#include "services\IConfiguration.hh"
+#include "services\IWindowConfiguration.hh"
#include "services\ServiceLocator.hh"
#include "ui\IDesktop.hh"
@@ -171,9 +171,9 @@ void WindowBinding::RestoreSizeAndPosition()
const auto& pDesktop = ra::services::ServiceLocator::Get();
pDesktop.GetWorkArea(oWorkAreaPosition, oWorkAreaSize);
- const auto& pConfiguration = ra::services::ServiceLocator::Get();
- auto oPosition = pConfiguration.GetWindowPosition(m_sSizeAndPositionKey);
- auto oSize = pConfiguration.GetWindowSize(m_sSizeAndPositionKey);
+ const auto& pWindowConfiguration = ra::services::ServiceLocator::Get();
+ auto oPosition = pWindowConfiguration.GetWindowPosition(m_sSizeAndPositionKey);
+ auto oSize = pWindowConfiguration.GetWindowSize(m_sSizeAndPositionKey);
if (oSize.Width == INT32_MIN || oSize.Height == INT32_MIN)
{
@@ -303,7 +303,7 @@ void WindowBinding::OnSizeChanged(_UNUSED ra::ui::Size oSize)
GetWindowRect(m_hWnd, &rcDialog);
const ra::ui::Size oDialogSize{ rcDialog.right - rcDialog.left, rcDialog.bottom - rcDialog.top };
- ra::services::ServiceLocator::GetMutable().SetWindowSize(m_sSizeAndPositionKey, oDialogSize);
+ ra::services::ServiceLocator::GetMutable().SetWindowSize(m_sSizeAndPositionKey, oDialogSize);
}
ControlBinding::ForceRepaint(m_hWnd);
@@ -322,7 +322,7 @@ void WindowBinding::OnPositionChanged(_UNUSED ra::ui::Position oPosition)
GetWindowRect(g_RAMainWnd, &rcMainWindow);
const ra::ui::Position oRelativePosition{ rcDialog.left - rcMainWindow.left, rcDialog.top - rcMainWindow.top };
- ra::services::ServiceLocator::GetMutable().SetWindowPosition(m_sSizeAndPositionKey, oRelativePosition);
+ ra::services::ServiceLocator::GetMutable().SetWindowPosition(m_sSizeAndPositionKey, oRelativePosition);
}
}
diff --git a/tests/Exports_Tests.cpp b/tests/Exports_Tests.cpp
index 69f6cf9a..b50b4a35 100644
--- a/tests/Exports_Tests.cpp
+++ b/tests/Exports_Tests.cpp
@@ -9,11 +9,11 @@
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
#include "tests\devkit\services\mocks\MockClock.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
#include "tests\devkit\ui\mocks\MockImageRepository.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
#include "tests\mocks\MockAudioSystem.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockEmulatorContext.hh"
#include "tests\mocks\MockFrameEventQueue.hh"
diff --git a/tests/RA_Integration.Tests.vcxproj b/tests/RA_Integration.Tests.vcxproj
index 2500f5a2..004d93a0 100644
--- a/tests/RA_Integration.Tests.vcxproj
+++ b/tests/RA_Integration.Tests.vcxproj
@@ -207,7 +207,7 @@
-
+
diff --git a/tests/RA_Integration.Tests.vcxproj.filters b/tests/RA_Integration.Tests.vcxproj.filters
index 60471cd0..00c5b4ae 100644
--- a/tests/RA_Integration.Tests.vcxproj.filters
+++ b/tests/RA_Integration.Tests.vcxproj.filters
@@ -416,7 +416,7 @@
Mocks
-
+
Mocks
diff --git a/tests/data/context/EmulatorContext_Tests.cpp b/tests/data/context/EmulatorContext_Tests.cpp
index 81ca4236..b2b6829e 100644
--- a/tests/data/context/EmulatorContext_Tests.cpp
+++ b/tests/data/context/EmulatorContext_Tests.cpp
@@ -9,13 +9,13 @@
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
#include "tests\devkit\services\mocks\MockClock.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockFileSystem.hh"
#include "tests\devkit\services\mocks\MockHttpRequester.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
#include "tests\devkit\testutil\AssetAsserts.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockGameContext.hh"
#include "tests\mocks\MockLoginService.hh"
diff --git a/tests/data/context/GameContext_Tests.cpp b/tests/data/context/GameContext_Tests.cpp
index f117c4e2..748f813d 100644
--- a/tests/data/context/GameContext_Tests.cpp
+++ b/tests/data/context/GameContext_Tests.cpp
@@ -21,6 +21,7 @@
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
#include "tests\devkit\services\mocks\MockClock.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\services\mocks\MockMessageDispatcher.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
@@ -30,7 +31,6 @@
#include "tests\mocks\MockAchievementRuntime.hh"
#include "tests\mocks\MockAudioSystem.hh"
#include "tests\mocks\MockEmulatorContext.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockFrameEventQueue.hh"
#include "tests\mocks\MockGameContext.hh"
diff --git a/tests/data/context/SessionTracker_Tests.cpp b/tests/data/context/SessionTracker_Tests.cpp
index c3a3f483..6171c2b1 100644
--- a/tests/data/context/SessionTracker_Tests.cpp
+++ b/tests/data/context/SessionTracker_Tests.cpp
@@ -7,10 +7,10 @@
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\services\mocks\MockClock.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockGameContext.hh"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
diff --git a/tests/devkit/RADevKit.Tests.vcxproj b/tests/devkit/RADevKit.Tests.vcxproj
index 90b3261b..5b6c8c8c 100644
--- a/tests/devkit/RADevKit.Tests.vcxproj
+++ b/tests/devkit/RADevKit.Tests.vcxproj
@@ -87,6 +87,7 @@
+
diff --git a/tests/devkit/RADevKit.Tests.vcxproj.filters b/tests/devkit/RADevKit.Tests.vcxproj.filters
index 737a2531..0b8944ad 100644
--- a/tests/devkit/RADevKit.Tests.vcxproj.filters
+++ b/tests/devkit/RADevKit.Tests.vcxproj.filters
@@ -200,5 +200,6 @@
context\mocks
+
\ No newline at end of file
diff --git a/tests/mocks/MockConfiguration.hh b/tests/devkit/services/mocks/MockConfiguration.hh
similarity index 55%
rename from tests/mocks/MockConfiguration.hh
rename to tests/devkit/services/mocks/MockConfiguration.hh
index 02db0ea2..b9f23838 100644
--- a/tests/mocks/MockConfiguration.hh
+++ b/tests/devkit/services/mocks/MockConfiguration.hh
@@ -5,6 +5,8 @@
#include "services\IConfiguration.hh"
#include "services\ServiceLocator.hh"
+#include
+
namespace ra {
namespace services {
namespace mocks {
@@ -36,63 +38,23 @@ public:
m_vEnabledFeatures.erase(nFeature);
}
- ra::ui::viewmodels::PopupLocation GetPopupLocation(ra::ui::viewmodels::Popup nPopup) const override
- {
- return m_vPopupLocations.at(ra::etoi(nPopup));
- }
-
- void SetPopupLocation(ra::ui::viewmodels::Popup nPopup, ra::ui::viewmodels::PopupLocation nPopupLocation) override
- {
- m_vPopupLocations.at(ra::etoi(nPopup)) = nPopupLocation;
- }
-
unsigned int GetNumBackgroundThreads() const noexcept override { return m_nBackgroundThreads; }
- const std::wstring& GetRomDirectory() const noexcept override { return m_sRomDirectory; }
- void SetRomDirectory(const std::wstring& sValue) override { m_sRomDirectory = sValue; }
-
const std::wstring& GetScreenshotDirectory() const noexcept override { return m_sScreenshotDirectory; }
void SetScreenshotDirectory(const std::wstring& sValue) override { m_sScreenshotDirectory = sValue; }
- ra::ui::Position GetWindowPosition([[maybe_unused]] const std::string& /*sPositionKey*/) const noexcept override
- {
- assert(!"Not implemented");
- return ra::ui::Position();
- }
-
- void SetWindowPosition([[maybe_unused]] const std::string& /*sPositionKey*/,
- [[maybe_unused]] const ra::ui::Position& /*oPosition*/) noexcept override
- {
- assert(!"Not implemented");
- }
-
- ra::ui::Size GetWindowSize([[maybe_unused]] const std::string& /*sPositionKey*/) const noexcept override
- {
- assert(!"Not implemented");
- return ra::ui::Size();
- }
-
- void SetWindowSize([[maybe_unused]] const std::string& /*sPositionKey*/,
- [[maybe_unused]] const ra::ui::Size& /*oSize*/) noexcept override
- {
- assert(!"Not implemented");
- }
-
bool IsCustomHost() const noexcept override { return !m_sHostName.empty(); }
const std::string& GetHostName() const noexcept override { return m_sHostName; }
void SetHostName(const std::string& sHostName)
{
m_sHostName = sHostName;
- m_sHostUrl = m_sImageHostUrl = "http://" + sHostName;
+ m_sHostUrl = "http://" + sHostName;
}
const std::string& GetHostUrl() const noexcept override { return m_sHostUrl; }
void SetHostUrl(const std::string& sHostUrl) { m_sHostUrl = sHostUrl; }
- const std::string& GetImageHostUrl() const noexcept override { return m_sImageHostUrl; }
- void SetImageHostUrl(const std::string& sHostUrl) { m_sImageHostUrl = sHostUrl; }
-
void Save() const noexcept override
{
}
@@ -102,16 +64,13 @@ private:
std::string m_sUsername;
std::string m_sApiToken;
- std::wstring m_sRomDirectory;
std::wstring m_sScreenshotDirectory;
std::string m_sHostName;
std::string m_sHostUrl;
- std::string m_sImageHostUrl;
unsigned int m_nBackgroundThreads = 0;
std::set m_vEnabledFeatures;
- std::array m_vPopupLocations = {};
};
} // namespace mocks
diff --git a/tests/mocks/MockEmulatorContext.hh b/tests/mocks/MockEmulatorContext.hh
index 6676fa07..83350a25 100644
--- a/tests/mocks/MockEmulatorContext.hh
+++ b/tests/mocks/MockEmulatorContext.hh
@@ -7,6 +7,8 @@
#include "services\IConfiguration.hh"
#include "services\ServiceLocator.hh"
+#include "ui\WindowViewModelBase.hh"
+
#include
namespace ra {
diff --git a/tests/mocks/MockWindowConfiguration.hh b/tests/mocks/MockWindowConfiguration.hh
new file mode 100644
index 00000000..e1355ada
--- /dev/null
+++ b/tests/mocks/MockWindowConfiguration.hh
@@ -0,0 +1,64 @@
+#ifndef RA_SERVICES_MOCK_WINDOWCONFIGURATION_HH
+#define RA_SERVICES_MOCK_WINDOWCONFIGURATION_HH
+#pragma once
+
+#include "services\IWindowConfiguration.hh"
+#include "services\ServiceLocator.hh"
+
+namespace ra {
+namespace services {
+namespace mocks {
+
+class MockWindowConfiguration : public IWindowConfiguration
+{
+public:
+ MockWindowConfiguration() noexcept
+ : m_Override(this)
+ {
+ }
+
+ ra::ui::viewmodels::PopupLocation GetPopupLocation(ra::ui::viewmodels::Popup nPopup) const override
+ {
+ return m_vPopupLocations.at(ra::etoi(nPopup));
+ }
+
+ void SetPopupLocation(ra::ui::viewmodels::Popup nPopup, ra::ui::viewmodels::PopupLocation nPopupLocation) override
+ {
+ m_vPopupLocations.at(ra::etoi(nPopup)) = nPopupLocation;
+ }
+
+ ra::ui::Position GetWindowPosition([[maybe_unused]] const std::string& /*sPositionKey*/) const noexcept override
+ {
+ assert(!"Not implemented");
+ return ra::ui::Position();
+ }
+
+ void SetWindowPosition([[maybe_unused]] const std::string& /*sPositionKey*/,
+ [[maybe_unused]] const ra::ui::Position& /*oPosition*/) noexcept override
+ {
+ assert(!"Not implemented");
+ }
+
+ ra::ui::Size GetWindowSize([[maybe_unused]] const std::string& /*sPositionKey*/) const noexcept override
+ {
+ assert(!"Not implemented");
+ return ra::ui::Size();
+ }
+
+ void SetWindowSize([[maybe_unused]] const std::string& /*sPositionKey*/,
+ [[maybe_unused]] const ra::ui::Size& /*oSize*/) noexcept override
+ {
+ assert(!"Not implemented");
+ }
+
+private:
+ ra::services::ServiceLocator::ServiceOverride m_Override;
+
+ std::array m_vPopupLocations = {};
+};
+
+} // namespace mocks
+} // namespace services
+} // namespace ra
+
+#endif // !RA_SERVICES_MOCK_WINDOWCONFIGURATION_HH
diff --git a/tests/services/AchievementRuntimeExports_Tests.cpp b/tests/services/AchievementRuntimeExports_Tests.cpp
index 92c5d326..2c9417d7 100644
--- a/tests/services/AchievementRuntimeExports_Tests.cpp
+++ b/tests/services/AchievementRuntimeExports_Tests.cpp
@@ -8,7 +8,7 @@
#include "tests\devkit\context\mocks\MockEmulatorMemoryContext.hh"
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
-#include "tests\mocks\MockConfiguration.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockEmulatorContext.hh"
#include "tests\mocks\MockGameContext.hh"
diff --git a/tests/services/AchievementRuntime_Tests.cpp b/tests/services/AchievementRuntime_Tests.cpp
index ee52eda5..91360f5d 100644
--- a/tests/services/AchievementRuntime_Tests.cpp
+++ b/tests/services/AchievementRuntime_Tests.cpp
@@ -7,13 +7,13 @@
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
#include "tests\devkit\services\mocks\MockClock.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockFileSystem.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
#include "tests\devkit\testutil\AssetAsserts.hh"
#include "tests\devkit\ui\mocks\MockImageRepository.hh"
#include "tests\mocks\MockAudioSystem.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockEmulatorContext.hh"
#include "tests\mocks\MockFrameEventQueue.hh"
@@ -24,6 +24,7 @@
#include "tests\mocks\MockOverlayTheme.hh"
#include "tests\mocks\MockSessionTracker.hh"
#include "tests\mocks\MockSurface.hh"
+#include "tests\mocks\MockWindowConfiguration.hh"
#include "tests\mocks\MockWindowManager.hh"
#include "tests\ui\UIAsserts.hh"
@@ -72,6 +73,7 @@ class AchievementRuntimeHarness : public AchievementRuntime
ra::services::mocks::MockFrameEventQueue mockFrameEventQueue;
ra::services::mocks::MockLoginService mockLoginService;
ra::services::mocks::MockThreadPool mockThreadPool;
+ ra::services::mocks::MockWindowConfiguration mockWindowConfiguration;
ra::ui::drawing::mocks::MockSurfaceFactory mockSurfaceFactory;
ra::ui::mocks::MockDesktop mockDesktop;
ra::ui::mocks::MockImageRepository mockImageRepository;
@@ -1560,7 +1562,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, false);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -1595,7 +1597,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -1630,7 +1632,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
runtime.mockFileSystem.MockFileSize(runtime.mockFileSystem.BaseDirectory() + L"Overlay\\rareunlock.wav", 12345);
@@ -1663,7 +1665,7 @@ TEST_CLASS(AchievementRuntime_Tests)
pAch6->public_.rarity = 23.45f;
pAch6->public_.rarity_hardcore = 12.34f;
auto* vmAch6 = runtime.WrapAchievement(pAch6);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -1695,7 +1697,7 @@ TEST_CLASS(AchievementRuntime_Tests)
auto* vmAch6 = runtime.WrapAchievement(pAch6);
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -1728,7 +1730,7 @@ TEST_CLASS(AchievementRuntime_Tests)
auto* vmAch6 = runtime.WrapAchievement(pAch6);
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -1761,7 +1763,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockGameContext.SetMode(ra::data::context::GameContext::Mode::CompatibilityTest);
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -1794,7 +1796,7 @@ TEST_CLASS(AchievementRuntime_Tests)
vmAch6->SetTrigger("0xH0000=2");
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -1827,7 +1829,7 @@ TEST_CLASS(AchievementRuntime_Tests)
vmAch6->SetTrigger("0xH0000=2");
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -1860,7 +1862,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
runtime.mockEmulatorMemoryContext.SetMemoryModified();
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -1895,7 +1897,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
runtime.mockEmulatorMemoryContext.MockMemoryInsecure(true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -1932,7 +1934,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
runtime.mockEmulatorMemoryContext.MockMemoryInsecure(true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -1965,7 +1967,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Offline, true);
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -1999,7 +2001,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::OnlyHardcoreUnlocks, true);
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -2035,7 +2037,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::OnlyHardcoreUnlocks, true);
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -2067,7 +2069,7 @@ TEST_CLASS(AchievementRuntime_Tests)
auto* vmAch6 = runtime.WrapAchievement(pAch6);
runtime.mockGameContext.SetRichPresenceDisplayString(L"Titles");
runtime.mockGameContext.Assets().FindRichPresence()->Activate();
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered,
ra::ui::viewmodels::PopupLocation::None);
rc_client_event_t event;
@@ -2124,7 +2126,7 @@ TEST_CLASS(AchievementRuntime_Tests)
auto* pAch6 = runtime.MockAchievement(6U, "0xH0000=1");
memcpy(pAch6->public_.badge_name, "012345", 7);
runtime.WrapAchievement(pAch6);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_event_t event;
@@ -2146,7 +2148,7 @@ TEST_CLASS(AchievementRuntime_Tests)
auto* pAch6 = runtime.MockAchievement(6U, "0xH0000=1");
memcpy(pAch6->public_.badge_name, "012345", 7);
runtime.WrapAchievement(pAch6);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge,
ra::ui::viewmodels::PopupLocation::None);
rc_client_event_t event;
@@ -2164,7 +2166,7 @@ TEST_CLASS(AchievementRuntime_Tests)
AchievementRuntimeHarness runtime;
auto* pAch6 = runtime.MockAchievement(6U, "0xH0000=1");
runtime.WrapAchievement(pAch6);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge,
ra::ui::viewmodels::PopupLocation::BottomRight);
runtime.mockOverlayManager.AddChallengeIndicator(6U, ra::ui::ImageType::Badge, "55223");
auto* pPopup = runtime.mockOverlayManager.GetChallengeIndicator(6U);
@@ -2185,7 +2187,7 @@ TEST_CLASS(AchievementRuntime_Tests)
AchievementRuntimeHarness runtime;
auto* pAch6 = runtime.MockAchievement(6U, "0xH0000=1");
runtime.WrapAchievement(pAch6);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge,
ra::ui::viewmodels::PopupLocation::BottomRight);
auto* pPopup = runtime.mockOverlayManager.GetChallengeIndicator(6U);
Assert::IsNull(pPopup);
@@ -2207,7 +2209,7 @@ TEST_CLASS(AchievementRuntime_Tests)
snprintf(pAch6->public_.measured_progress, sizeof(pAch6->public_.measured_progress), "6/10");
memcpy(pAch6->public_.badge_name, "012345", 7);
runtime.WrapAchievement(pAch6);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Progress,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Progress,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_event_t event;
@@ -2231,7 +2233,7 @@ TEST_CLASS(AchievementRuntime_Tests)
snprintf(pAch6->public_.measured_progress, sizeof(pAch6->public_.measured_progress), "6/10");
memcpy(pAch6->public_.badge_name, "012345", 7);
runtime.WrapAchievement(pAch6);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Progress,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Progress,
ra::ui::viewmodels::PopupLocation::None);
rc_client_event_t event;
@@ -2252,7 +2254,7 @@ TEST_CLASS(AchievementRuntime_Tests)
memcpy(pAch6->public_.badge_name, "012345", 7);
auto* vmAch6 = runtime.WrapAchievement(pAch6);
vmAch6->SetBadge(L"local\\abcdefg.png");
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Progress,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Progress,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_event_t event;
@@ -2276,7 +2278,7 @@ TEST_CLASS(AchievementRuntime_Tests)
snprintf(pAch6->public_.measured_progress, sizeof(pAch6->public_.measured_progress), "6/10");
memcpy(pAch6->public_.badge_name, "012345", 7);
runtime.WrapAchievement(pAch6);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Progress,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Progress,
ra::ui::viewmodels::PopupLocation::BottomRight);
runtime.mockOverlayManager.UpdateProgressTracker(ra::ui::ImageType::Badge, "000001", L"4/10");
@@ -2301,7 +2303,7 @@ TEST_CLASS(AchievementRuntime_Tests)
snprintf(pAch6->public_.measured_progress, sizeof(pAch6->public_.measured_progress), "6/10");
memcpy(pAch6->public_.badge_name, "012345", 7);
runtime.WrapAchievement(pAch6);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Progress,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Progress,
ra::ui::viewmodels::PopupLocation::BottomRight);
runtime.mockOverlayManager.UpdateProgressTracker(ra::ui::ImageType::Badge, "000001", L"4/10");
auto* pPopup = runtime.mockOverlayManager.GetProgressTracker();
@@ -2329,7 +2331,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.MockAchievement(11U, "0xH0000=1")->public_.points = 5;
runtime.MockAchievement(12U, "0xH0000=1")->public_.points = 10;
runtime.MockAchievement(13U, "0xH0000=1")->public_.points = 5;
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Mastery,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Mastery,
ra::ui::viewmodels::PopupLocation::TopMiddle);
runtime.mockSessionTracker.MockSession(1U, time(NULL), std::chrono::seconds(20000));
@@ -2362,7 +2364,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.MockAchievement(11U, "0xH0000=1")->public_.points = 5;
runtime.MockAchievement(12U, "0xH0000=1")->public_.points = 10;
runtime.MockAchievement(13U, "0xH0000=1")->public_.points = 5;
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Mastery,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Mastery,
ra::ui::viewmodels::PopupLocation::TopMiddle);
runtime.mockSessionTracker.MockSession(1U, time(NULL), std::chrono::seconds(20000));
@@ -2397,7 +2399,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.WrapAchievement(runtime.MockSubsetAchievement(11U, "0xH0000=1", pSubset))->SetPoints(5);
runtime.WrapAchievement(runtime.MockSubsetAchievement(12U, "0xH0000=1", pSubset))->SetPoints(10);
runtime.WrapAchievement(runtime.MockSubsetAchievement(13U, "0xH0000=1", pSubset))->SetPoints(5);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Mastery,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Mastery,
ra::ui::viewmodels::PopupLocation::TopMiddle);
runtime.mockSessionTracker.MockSession(1U, time(NULL), std::chrono::seconds(20000));
@@ -2433,7 +2435,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.WrapAchievement(runtime.MockSubsetAchievement(11U, "0xH0000=1", pSubset))->SetPoints(5);
runtime.WrapAchievement(runtime.MockSubsetAchievement(12U, "0xH0000=1", pSubset))->SetPoints(10);
runtime.WrapAchievement(runtime.MockSubsetAchievement(13U, "0xH0000=1", pSubset))->SetPoints(5);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Mastery,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Mastery,
ra::ui::viewmodels::PopupLocation::TopMiddle);
runtime.mockSessionTracker.MockSession(1U, time(NULL), std::chrono::seconds(20000));
@@ -2460,7 +2462,7 @@ TEST_CLASS(AchievementRuntime_Tests)
auto *pLbd4 = runtime.MockLeaderboard(4U, "STA:0xH0000=1::CAN:0xH0000=1::SUB:0xH0000=2::VAL:0xH0001");
runtime.WrapLeaderboard(pLbd4);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardStarted,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardStarted,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -2486,7 +2488,7 @@ TEST_CLASS(AchievementRuntime_Tests)
auto* pLbd4 = runtime.MockLeaderboard(4U, "STA:0xH0000=1::CAN:0xH0000=1::SUB:0xH0000=2::VAL:0xH0001");
runtime.WrapLeaderboard(pLbd4);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardStarted,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardStarted,
ra::ui::viewmodels::PopupLocation::None);
rc_client_event_t event;
@@ -2505,7 +2507,7 @@ TEST_CLASS(AchievementRuntime_Tests)
auto* pLbd4 = runtime.MockLeaderboard(4U, "STA:0xH0000=1::CAN:0xH0000=1::SUB:0xH0000=2::VAL:0xH0001");
runtime.WrapLeaderboard(pLbd4);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, false);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardStarted,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardStarted,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -2524,7 +2526,7 @@ TEST_CLASS(AchievementRuntime_Tests)
auto* pLbd4 = runtime.MockLeaderboard(4U, "STA:0xH0000=1::CAN:0xH0000=1::SUB:0xH0000=2::VAL:0xH0001");
runtime.WrapLeaderboard(pLbd4);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardCanceled,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardCanceled,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -2550,7 +2552,7 @@ TEST_CLASS(AchievementRuntime_Tests)
auto* pLbd4 = runtime.MockLeaderboard(4U, "STA:0xH0000=1::CAN:0xH0000=1::SUB:0xH0000=2::VAL:0xH0001");
runtime.WrapLeaderboard(pLbd4);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardCanceled,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardCanceled,
ra::ui::viewmodels::PopupLocation::None);
rc_client_event_t event;
@@ -2569,7 +2571,7 @@ TEST_CLASS(AchievementRuntime_Tests)
auto* pLbd4 = runtime.MockLeaderboard(4U, "STA:0xH0000=1::CAN:0xH0000=1::SUB:0xH0000=2::VAL:0xH0001");
runtime.WrapLeaderboard(pLbd4);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, false);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardCanceled,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardCanceled,
ra::ui::viewmodels::PopupLocation::BottomLeft);
rc_client_event_t event;
@@ -2590,7 +2592,7 @@ TEST_CLASS(AchievementRuntime_Tests)
pLbd4->public_.tracker_value = "1:23.45";
runtime.WrapLeaderboard(pLbd4);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_event_t event;
@@ -2632,7 +2634,7 @@ TEST_CLASS(AchievementRuntime_Tests)
pLbd4->public_.tracker_value = "1:23.45";
runtime.WrapLeaderboard(pLbd4);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_event_t event;
@@ -2663,7 +2665,7 @@ TEST_CLASS(AchievementRuntime_Tests)
pLbd4->public_.tracker_value = "1:23.45";
runtime.WrapLeaderboard(pLbd4);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_event_t event;
@@ -2694,7 +2696,7 @@ TEST_CLASS(AchievementRuntime_Tests)
auto* vmLbd4 = runtime.WrapLeaderboard(pLbd4);
vmLbd4->SetDescription(L"Modified Description");
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_event_t event;
@@ -2726,7 +2728,7 @@ TEST_CLASS(AchievementRuntime_Tests)
vmLbd4->SetDescription(L"Modified Description");
vmLbd4->UpdateLocalCheckpoint();
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_event_t event;
@@ -2757,7 +2759,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.WrapLeaderboard(pLbd4);
runtime.mockEmulatorMemoryContext.MockMemoryModified(true);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_event_t event;
@@ -2787,7 +2789,7 @@ TEST_CLASS(AchievementRuntime_Tests)
pLbd4->public_.tracker_value = "1:23.45";
runtime.WrapLeaderboard(pLbd4);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_event_t event;
@@ -2818,7 +2820,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.WrapLeaderboard(pLbd4);
runtime.mockEmulatorMemoryContext.MockMemoryInsecure(true);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_event_t event;
@@ -2849,7 +2851,7 @@ TEST_CLASS(AchievementRuntime_Tests)
pLbd4->public_.tracker_value = "1:23.45";
runtime.WrapLeaderboard(pLbd4);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_event_t event;
@@ -2876,7 +2878,7 @@ TEST_CLASS(AchievementRuntime_Tests)
AchievementRuntimeHarness runtime;
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_leaderboard_tracker_t tracker;
@@ -2901,7 +2903,7 @@ TEST_CLASS(AchievementRuntime_Tests)
AchievementRuntimeHarness runtime;
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
ra::ui::viewmodels::PopupLocation::None);
rc_client_leaderboard_tracker_t tracker;
@@ -2924,7 +2926,7 @@ TEST_CLASS(AchievementRuntime_Tests)
AchievementRuntimeHarness runtime;
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, false);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_leaderboard_tracker_t tracker;
@@ -2947,7 +2949,7 @@ TEST_CLASS(AchievementRuntime_Tests)
AchievementRuntimeHarness runtime;
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
ra::ui::viewmodels::PopupLocation::BottomRight);
runtime.mockOverlayManager.AddScoreTracker(1U).SetDisplayText(L"XXX");
@@ -2973,7 +2975,7 @@ TEST_CLASS(AchievementRuntime_Tests)
AchievementRuntimeHarness runtime;
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
ra::ui::viewmodels::PopupLocation::None);
rc_client_leaderboard_tracker_t tracker;
@@ -2996,7 +2998,7 @@ TEST_CLASS(AchievementRuntime_Tests)
AchievementRuntimeHarness runtime;
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, false);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_leaderboard_tracker_t tracker;
@@ -3019,7 +3021,7 @@ TEST_CLASS(AchievementRuntime_Tests)
AchievementRuntimeHarness runtime;
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
ra::ui::viewmodels::PopupLocation::BottomRight);
runtime.mockOverlayManager.AddScoreTracker(1U).SetDisplayText(L"XXX");
@@ -3044,7 +3046,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
auto* pLbd4 = runtime.MockLeaderboard(4U, "STA:0xH0000=1::CAN:0xH0000=1::SUB:0xH0000=2::VAL:0xH0001");
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_leaderboard_scoreboard_entry_t entries[3];
@@ -3111,7 +3113,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
auto* pLbd4 = runtime.MockLeaderboard(4U, "STA:0xH0000=1::CAN:0xH0000=1::SUB:0xH0000=2::VAL:0xH0001");
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
ra::ui::viewmodels::PopupLocation::None);
rc_client_leaderboard_scoreboard_entry_t entries[3];
@@ -3152,7 +3154,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, false);
auto* pLbd4 = runtime.MockLeaderboard(4U, "STA:0xH0000=1::CAN:0xH0000=1::SUB:0xH0000=2::VAL:0xH0001");
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_leaderboard_scoreboard_entry_t entries[3];
@@ -3193,7 +3195,7 @@ TEST_CLASS(AchievementRuntime_Tests)
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Leaderboards, true);
auto* pLbd4 = runtime.MockLeaderboard(4U, "STA:0xH0000=1::CAN:0xH0000=1::SUB:0xH0000=2::VAL:0xH0001");
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardScoreboard,
ra::ui::viewmodels::PopupLocation::BottomRight);
rc_client_leaderboard_scoreboard_entry_t entries[7];
@@ -3331,7 +3333,7 @@ TEST_CLASS(AchievementRuntime_Tests)
{
AchievementRuntimeHarness runtime;
runtime.mockConfiguration.SetFeatureEnabled(ra::services::Feature::Hardcore, true);
- runtime.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
+ runtime.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker,
ra::ui::viewmodels::PopupLocation::BottomRight);
bool bWasReset = false;
diff --git a/tests/services/GameIdentifier_Tests.cpp b/tests/services/GameIdentifier_Tests.cpp
index 6e8e3841..1a050ff5 100644
--- a/tests/services/GameIdentifier_Tests.cpp
+++ b/tests/services/GameIdentifier_Tests.cpp
@@ -10,11 +10,11 @@
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
#include "tests\devkit\services\mocks\MockClock.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
#include "tests\mocks\MockAudioSystem.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockEmulatorContext.hh"
#include "tests\mocks\MockGameContext.hh"
diff --git a/tests/services/JsonFileConfiguration_Tests.cpp b/tests/services/JsonFileConfiguration_Tests.cpp
index 9fbe35ae..b1a0f372 100644
--- a/tests/services/JsonFileConfiguration_Tests.cpp
+++ b/tests/services/JsonFileConfiguration_Tests.cpp
@@ -250,7 +250,6 @@ TEST_CLASS(JsonFileConfiguration_Tests)
JsonFileConfiguration config;
Assert::AreEqual(std::string("retroachievements.org"), config.GetHostName());
Assert::AreEqual(std::string("https://retroachievements.org"), config.GetHostUrl());
- Assert::AreEqual(std::string("http://i.retroachievements.org"), config.GetImageHostUrl());
}
TEST_METHOD(TestHostNameFromFile)
@@ -260,13 +259,11 @@ TEST_CLASS(JsonFileConfiguration_Tests)
JsonFileConfiguration config;
Assert::AreEqual(std::string("stage.retroachievements.org"), config.GetHostName());
Assert::AreEqual(std::string("http://stage.retroachievements.org"), config.GetHostUrl());
- Assert::AreEqual(std::string("http://stage.retroachievements.org"), config.GetImageHostUrl());
// file should only be read once
mockFileSystem.MockFile(L"host.txt", "dev.retroachievements.org");
Assert::AreEqual(std::string("stage.retroachievements.org"), config.GetHostName());
Assert::AreEqual(std::string("http://stage.retroachievements.org"), config.GetHostUrl());
- Assert::AreEqual(std::string("http://stage.retroachievements.org"), config.GetImageHostUrl());
}
TEST_METHOD(TestHostNameFromFileWithProtocol)
@@ -276,13 +273,11 @@ TEST_CLASS(JsonFileConfiguration_Tests)
JsonFileConfiguration config;
Assert::AreEqual(std::string("stage.retroachievements.org"), config.GetHostName());
Assert::AreEqual(std::string("https://stage.retroachievements.org"), config.GetHostUrl());
- Assert::AreEqual(std::string("https://stage.retroachievements.org"), config.GetImageHostUrl());
// file should only be read once
mockFileSystem.MockFile(L"host.txt", "https://dev.retroachievements.org");
Assert::AreEqual(std::string("stage.retroachievements.org"), config.GetHostName());
Assert::AreEqual(std::string("https://stage.retroachievements.org"), config.GetHostUrl());
- Assert::AreEqual(std::string("https://stage.retroachievements.org"), config.GetImageHostUrl());
}
TEST_METHOD(TestHostNameFromRcClient)
@@ -293,7 +288,6 @@ TEST_CLASS(JsonFileConfiguration_Tests)
config.SetHost("localhost");
Assert::AreEqual(std::string("localhost"), config.GetHostName());
Assert::AreEqual(std::string("http://localhost"), config.GetHostUrl());
- Assert::AreEqual(std::string("http://localhost"), config.GetImageHostUrl());
}
};
diff --git a/tests/services/LoginService_Tests.cpp b/tests/services/LoginService_Tests.cpp
index 17408e91..094e299c 100644
--- a/tests/services/LoginService_Tests.cpp
+++ b/tests/services/LoginService_Tests.cpp
@@ -5,8 +5,8 @@
#include "tests\ui\UIAsserts.hh"
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockEmulatorContext.hh"
#include "tests\mocks\MockLoginService.hh"
diff --git a/tests/ui/viewmodels/AssetEditorViewModel_Tests.cpp b/tests/ui/viewmodels/AssetEditorViewModel_Tests.cpp
index 2ca25ce0..fd655dd2 100644
--- a/tests/ui/viewmodels/AssetEditorViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/AssetEditorViewModel_Tests.cpp
@@ -15,6 +15,7 @@
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
#include "tests\devkit\services\mocks\MockClock.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockFileSystem.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
#include "tests\devkit\testutil\AchievementAsserts.hh"
@@ -25,7 +26,6 @@
#include "tests\devkit\ui\mocks\MockImageRepository.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
#include "tests\mocks\MockClipboard.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockEmulatorContext.hh"
#include "tests\mocks\MockGameContext.hh"
diff --git a/tests/ui/viewmodels/AssetListViewModel_Tests.cpp b/tests/ui/viewmodels/AssetListViewModel_Tests.cpp
index 9299673c..ee00997c 100644
--- a/tests/ui/viewmodels/AssetListViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/AssetListViewModel_Tests.cpp
@@ -19,6 +19,7 @@
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
#include "tests\devkit\services\mocks\MockClock.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockFileSystem.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\services\mocks\MockLogger.hh"
@@ -28,7 +29,6 @@
#include "tests\devkit\testutil\ValueAsserts.hh"
#include "tests\devkit\ui\mocks\MockImageRepository.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockEmulatorContext.hh"
#include "tests\mocks\MockGameContext.hh"
diff --git a/tests/ui/viewmodels/BrokenAchievementsViewModel_Tests.cpp b/tests/ui/viewmodels/BrokenAchievementsViewModel_Tests.cpp
index 0940a118..2d82fedc 100644
--- a/tests/ui/viewmodels/BrokenAchievementsViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/BrokenAchievementsViewModel_Tests.cpp
@@ -3,8 +3,8 @@
#include "ui\viewmodels\BrokenAchievementsViewModel.hh"
#include "tests\ui\UIAsserts.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockGameContext.hh"
#include "tests\mocks\MockWindowManager.hh"
diff --git a/tests/ui/viewmodels/IntegrationMenuViewModel_Tests.cpp b/tests/ui/viewmodels/IntegrationMenuViewModel_Tests.cpp
index e6dec335..968d88fa 100644
--- a/tests/ui/viewmodels/IntegrationMenuViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/IntegrationMenuViewModel_Tests.cpp
@@ -21,16 +21,17 @@
#include "tests\devkit\context\mocks\MockEmulatorMemoryContext.hh"
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockEmulatorContext.hh"
#include "tests\mocks\MockGameContext.hh"
#include "tests\mocks\MockLoginService.hh"
#include "tests\mocks\MockOverlayManager.hh"
#include "tests\mocks\MockServer.hh"
+#include "tests\mocks\MockWindowConfiguration.hh"
#include "tests\mocks\MockWindowManager.hh"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
@@ -58,6 +59,7 @@ TEST_CLASS(IntegrationMenuViewModel_Tests)
ra::services::mocks::MockLocalStorage mockLocalStorage;
ra::services::mocks::MockLoginService mockLoginService;
ra::services::mocks::MockThreadPool mockThreadPool;
+ ra::services::mocks::MockWindowConfiguration mockWindowConfiguration;
ra::ui::mocks::MockDesktop mockDesktop;
ra::ui::viewmodels::mocks::MockWindowManager mockWindowManager;
diff --git a/tests/ui/viewmodels/LoginViewModel_Tests.cpp b/tests/ui/viewmodels/LoginViewModel_Tests.cpp
index 8f2d58e7..8e858b6d 100644
--- a/tests/ui/viewmodels/LoginViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/LoginViewModel_Tests.cpp
@@ -5,7 +5,7 @@
#include "tests\ui\UIAsserts.hh"
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
-#include "tests\mocks\MockConfiguration.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockLoginService.hh"
diff --git a/tests/ui/viewmodels/MemoryBookmarksViewModel_Tests.cpp b/tests/ui/viewmodels/MemoryBookmarksViewModel_Tests.cpp
index c08434c5..95f95b41 100644
--- a/tests/ui/viewmodels/MemoryBookmarksViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/MemoryBookmarksViewModel_Tests.cpp
@@ -10,11 +10,11 @@
#include "tests\devkit\context\mocks\MockEmulatorMemoryContext.hh"
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockFileSystem.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\testutil\MemoryAsserts.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockFrameEventQueue.hh"
#include "tests\mocks\MockGameContext.hh"
diff --git a/tests/ui/viewmodels/MemoryInspectorViewModel_Tests.cpp b/tests/ui/viewmodels/MemoryInspectorViewModel_Tests.cpp
index 9e1b6e08..a73c1a54 100644
--- a/tests/ui/viewmodels/MemoryInspectorViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/MemoryInspectorViewModel_Tests.cpp
@@ -9,11 +9,11 @@
#include "tests\devkit\context\mocks\MockEmulatorMemoryContext.hh"
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
#include "tests\devkit\testutil\MemoryAsserts.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockGameContext.hh"
#include "tests\mocks\MockServer.hh"
diff --git a/tests/ui/viewmodels/MemoryNotesViewModel_Tests.cpp b/tests/ui/viewmodels/MemoryNotesViewModel_Tests.cpp
index 4b6c744b..425dd544 100644
--- a/tests/ui/viewmodels/MemoryNotesViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/MemoryNotesViewModel_Tests.cpp
@@ -11,11 +11,11 @@
#include "tests\devkit\context\mocks\MockEmulatorMemoryContext.hh"
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\services\mocks\MockLogger.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
#include "tests\devkit\testutil\MemoryAsserts.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockGameContext.hh"
#include "tests\mocks\MockServer.hh"
diff --git a/tests/ui/viewmodels/MemoryRegionsViewModel_Tests.cpp b/tests/ui/viewmodels/MemoryRegionsViewModel_Tests.cpp
index 2a82bae8..2418a0ae 100644
--- a/tests/ui/viewmodels/MemoryRegionsViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/MemoryRegionsViewModel_Tests.cpp
@@ -6,11 +6,11 @@
#include "tests\devkit\context\mocks\MockConsoleContext.hh"
#include "tests\devkit\context\mocks\MockDevKitContext.hh"
#include "tests\devkit\context\mocks\MockEmulatorMemoryContext.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\services\mocks\MockLogger.hh"
#include "tests\ui\UIAsserts.hh"
#include "tests\RA_UnitTestHelpers.h"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockEmulatorContext.hh"
#include "tests\mocks\MockGameContext.hh"
diff --git a/tests/ui/viewmodels/MemorySearchViewModel_Tests.cpp b/tests/ui/viewmodels/MemorySearchViewModel_Tests.cpp
index d15c97ce..706d486a 100644
--- a/tests/ui/viewmodels/MemorySearchViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/MemorySearchViewModel_Tests.cpp
@@ -10,9 +10,9 @@
#include "tests\devkit\context\mocks\MockEmulatorMemoryContext.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
#include "tests\devkit\services\mocks\MockClock.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockFileSystem.hh"
#include "tests\devkit\testutil\MemoryAsserts.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockGameContext.hh"
#include "tests\mocks\MockWindowManager.hh"
diff --git a/tests/ui/viewmodels/MemoryWatchListViewModel_Tests.cpp b/tests/ui/viewmodels/MemoryWatchListViewModel_Tests.cpp
index 7c3aa2d6..76190e08 100644
--- a/tests/ui/viewmodels/MemoryWatchListViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/MemoryWatchListViewModel_Tests.cpp
@@ -9,11 +9,11 @@
#include "tests\devkit\context\mocks\MockEmulatorMemoryContext.hh"
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockFileSystem.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\testutil\MemoryAsserts.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockFrameEventQueue.hh"
#include "tests\mocks\MockGameContext.hh"
diff --git a/tests/ui/viewmodels/OverlayManager_Tests.cpp b/tests/ui/viewmodels/OverlayManager_Tests.cpp
index a6ebfdc2..9154f463 100644
--- a/tests/ui/viewmodels/OverlayManager_Tests.cpp
+++ b/tests/ui/viewmodels/OverlayManager_Tests.cpp
@@ -7,15 +7,16 @@
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
#include "tests\devkit\services\mocks\MockClock.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
#include "tests\devkit\ui\mocks\MockImageRepository.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockEmulatorContext.hh"
#include "tests\mocks\MockGameContext.hh"
#include "tests\mocks\MockOverlayTheme.hh"
#include "tests\mocks\MockSurface.hh"
+#include "tests\mocks\MockWindowConfiguration.hh"
#include "tests\mocks\MockWindowManager.hh"
#include "tests\ui\UIAsserts.hh"
@@ -41,6 +42,7 @@ TEST_CLASS(OverlayManager_Tests)
ra::services::mocks::MockClock mockClock;
ra::services::mocks::MockConfiguration mockConfiguration;
ra::services::mocks::MockThreadPool mockThreadPool;
+ ra::services::mocks::MockWindowConfiguration mockWindowConfiguration;
ra::ui::mocks::MockDesktop mockDesktop;
ra::ui::mocks::MockImageRepository mockImageRepository;
ra::ui::mocks::MockOverlayTheme mockTheme;
@@ -258,7 +260,7 @@ TEST_CLASS(OverlayManager_Tests)
TEST_METHOD(TestAddRemoveScoreTrackerLeaderboardEnabled)
{
OverlayManagerHarness overlay;
- overlay.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker, ra::ui::viewmodels::PopupLocation::BottomRight);
+ overlay.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker, ra::ui::viewmodels::PopupLocation::BottomRight);
const auto& vmScoreTracker = overlay.AddScoreTracker(3);
Assert::AreEqual(3, vmScoreTracker.GetPopupId());
@@ -286,7 +288,7 @@ TEST_CLASS(OverlayManager_Tests)
TEST_METHOD(TestAddRemoveScoreTrackerLeaderboardDisabled)
{
OverlayManagerHarness overlay;
- overlay.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker, ra::ui::viewmodels::PopupLocation::None);
+ overlay.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker, ra::ui::viewmodels::PopupLocation::None);
const auto& vmScoreTracker = overlay.AddScoreTracker(3);
Assert::AreEqual(3, vmScoreTracker.GetPopupId());
@@ -314,7 +316,7 @@ TEST_CLASS(OverlayManager_Tests)
TEST_METHOD(TestAddMultipleScoreTrackers)
{
OverlayManagerHarness overlay;
- overlay.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker, ra::ui::viewmodels::PopupLocation::BottomRight);
+ overlay.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker, ra::ui::viewmodels::PopupLocation::BottomRight);
overlay.AddLeaderboard(3, "0xH1234");
overlay.AddLeaderboard(4, "0xH2345");
@@ -347,7 +349,7 @@ TEST_CLASS(OverlayManager_Tests)
TEST_METHOD(TestAddMultipleScoreTrackersSharedValue)
{
OverlayManagerHarness overlay;
- overlay.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker, ra::ui::viewmodels::PopupLocation::BottomRight);
+ overlay.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::LeaderboardTracker, ra::ui::viewmodels::PopupLocation::BottomRight);
overlay.AddLeaderboard(3, "0xH1234");
overlay.AddLeaderboard(4, "0xH1234"); // same value definition
@@ -483,7 +485,7 @@ TEST_CLASS(OverlayManager_Tests)
TEST_METHOD(TestAddRemoveChallengeIndicator)
{
OverlayManagerHarness overlay;
- overlay.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge, ra::ui::viewmodels::PopupLocation::BottomRight);
+ overlay.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge, ra::ui::viewmodels::PopupLocation::BottomRight);
const auto& vmIndicator = overlay.AddChallengeIndicator(6, ra::ui::ImageType::Badge, "12345");
Assert::AreEqual(6, vmIndicator.GetPopupId());
@@ -512,7 +514,7 @@ TEST_CLASS(OverlayManager_Tests)
TEST_METHOD(TestAddRemoveChallengeIndicatorDestroyPending)
{
OverlayManagerHarness overlay;
- overlay.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge, ra::ui::viewmodels::PopupLocation::BottomRight);
+ overlay.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge, ra::ui::viewmodels::PopupLocation::BottomRight);
const auto& vmIndicator = overlay.AddChallengeIndicator(6, ra::ui::ImageType::Badge, "12345");
Assert::IsFalse(vmIndicator.IsDestroyPending());
@@ -543,7 +545,7 @@ TEST_CLASS(OverlayManager_Tests)
TEST_METHOD(TestAddMultipleChallengeIndicator)
{
OverlayManagerHarness overlay;
- overlay.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge, ra::ui::viewmodels::PopupLocation::BottomRight);
+ overlay.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge, ra::ui::viewmodels::PopupLocation::BottomRight);
const auto& vmIndicator = overlay.AddChallengeIndicator(6, ra::ui::ImageType::Badge, "12345");
const auto& vmIndicator2 = overlay.AddChallengeIndicator(7, ra::ui::ImageType::Badge, "22222");
@@ -588,7 +590,7 @@ TEST_CLASS(OverlayManager_Tests)
TEST_METHOD(TestAddExistingChallengeIndicator)
{
OverlayManagerHarness overlay;
- overlay.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge, ra::ui::viewmodels::PopupLocation::BottomRight);
+ overlay.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Challenge, ra::ui::viewmodels::PopupLocation::BottomRight);
const auto& vmIndicator = overlay.AddChallengeIndicator(6, ra::ui::ImageType::Badge, "12345");
Assert::AreEqual(6, vmIndicator.GetPopupId());
@@ -607,7 +609,7 @@ TEST_CLASS(OverlayManager_Tests)
TEST_METHOD(TestAddRemoveProgressIndicator)
{
OverlayManagerHarness overlay;
- overlay.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Progress, ra::ui::viewmodels::PopupLocation::BottomRight);
+ overlay.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Progress, ra::ui::viewmodels::PopupLocation::BottomRight);
overlay.UpdateProgressTracker(ra::ui::ImageType::Badge, "12345_lock", L"3/7");
auto* pTracker = overlay.GetProgressTracker();
diff --git a/tests/ui/viewmodels/OverlayRecentGamesPageViewModel_Tests.cpp b/tests/ui/viewmodels/OverlayRecentGamesPageViewModel_Tests.cpp
index 6970a975..45cb5200 100644
--- a/tests/ui/viewmodels/OverlayRecentGamesPageViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/OverlayRecentGamesPageViewModel_Tests.cpp
@@ -4,12 +4,12 @@
#include "tests\devkit\context\mocks\MockRcClient.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockHttpRequester.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
#include "tests\devkit\ui\mocks\MockImageRepository.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockGameContext.hh"
#include "tests\mocks\MockOverlayManager.hh"
#include "tests\mocks\MockServer.hh"
diff --git a/tests/ui/viewmodels/OverlaySettingsViewModel_Tests.cpp b/tests/ui/viewmodels/OverlaySettingsViewModel_Tests.cpp
index b373f741..a71ce541 100644
--- a/tests/ui/viewmodels/OverlaySettingsViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/OverlaySettingsViewModel_Tests.cpp
@@ -5,8 +5,9 @@
#include "ui\viewmodels\FileDialogViewModel.hh"
#include "tests\RA_UnitTestHelpers.h"
-#include "tests\mocks\MockConfiguration.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
+#include "tests\mocks\MockWindowConfiguration.hh"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
@@ -55,37 +56,38 @@ TEST_CLASS(OverlaySettingsViewModel_Tests)
{
public:
ra::services::mocks::MockConfiguration mockConfiguration;
+ ra::services::mocks::MockWindowConfiguration mockWindowConfiguration;
ra::ui::mocks::MockDesktop mockDesktop;
};
void ValidatePopupLocationInitialize(ra::ui::viewmodels::Popup nPopup, std::function fGetValue)
{
OverlaySettingsViewModelHarness vmSettings;
- vmSettings.mockConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::None);
+ vmSettings.mockWindowConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::None);
vmSettings.Initialize();
Assert::AreEqual(ra::ui::viewmodels::PopupLocation::None, fGetValue(vmSettings));
- vmSettings.mockConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::TopLeft);
+ vmSettings.mockWindowConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::TopLeft);
vmSettings.Initialize();
Assert::AreEqual(ra::ui::viewmodels::PopupLocation::TopLeft, fGetValue(vmSettings));
- vmSettings.mockConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::TopMiddle);
+ vmSettings.mockWindowConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::TopMiddle);
vmSettings.Initialize();
Assert::AreEqual(ra::ui::viewmodels::PopupLocation::TopMiddle, fGetValue(vmSettings));
- vmSettings.mockConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::TopRight);
+ vmSettings.mockWindowConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::TopRight);
vmSettings.Initialize();
Assert::AreEqual(ra::ui::viewmodels::PopupLocation::TopRight, fGetValue(vmSettings));
- vmSettings.mockConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::BottomLeft);
+ vmSettings.mockWindowConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::BottomLeft);
vmSettings.Initialize();
Assert::AreEqual(ra::ui::viewmodels::PopupLocation::BottomLeft, fGetValue(vmSettings));
- vmSettings.mockConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::BottomMiddle);
+ vmSettings.mockWindowConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::BottomMiddle);
vmSettings.Initialize();
Assert::AreEqual(ra::ui::viewmodels::PopupLocation::BottomMiddle, fGetValue(vmSettings));
- vmSettings.mockConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::BottomRight);
+ vmSettings.mockWindowConfiguration.SetPopupLocation(nPopup, ra::ui::viewmodels::PopupLocation::BottomRight);
vmSettings.Initialize();
Assert::AreEqual(ra::ui::viewmodels::PopupLocation::BottomRight, fGetValue(vmSettings));
}
@@ -95,31 +97,31 @@ TEST_CLASS(OverlaySettingsViewModel_Tests)
OverlaySettingsViewModelHarness vmSettings;
fSetValue(vmSettings, ra::ui::viewmodels::PopupLocation::None);
vmSettings.Commit();
- Assert::AreEqual(ra::ui::viewmodels::PopupLocation::None, vmSettings.mockConfiguration.GetPopupLocation(nPopup));
+ Assert::AreEqual(ra::ui::viewmodels::PopupLocation::None, vmSettings.mockWindowConfiguration.GetPopupLocation(nPopup));
fSetValue(vmSettings, ra::ui::viewmodels::PopupLocation::TopLeft);
vmSettings.Commit();
- Assert::AreEqual(ra::ui::viewmodels::PopupLocation::TopLeft, vmSettings.mockConfiguration.GetPopupLocation(nPopup));
+ Assert::AreEqual(ra::ui::viewmodels::PopupLocation::TopLeft, vmSettings.mockWindowConfiguration.GetPopupLocation(nPopup));
fSetValue(vmSettings, ra::ui::viewmodels::PopupLocation::TopMiddle);
vmSettings.Commit();
- Assert::AreEqual(ra::ui::viewmodels::PopupLocation::TopMiddle, vmSettings.mockConfiguration.GetPopupLocation(nPopup));
+ Assert::AreEqual(ra::ui::viewmodels::PopupLocation::TopMiddle, vmSettings.mockWindowConfiguration.GetPopupLocation(nPopup));
fSetValue(vmSettings, ra::ui::viewmodels::PopupLocation::TopRight);
vmSettings.Commit();
- Assert::AreEqual(ra::ui::viewmodels::PopupLocation::TopRight, vmSettings.mockConfiguration.GetPopupLocation(nPopup));
+ Assert::AreEqual(ra::ui::viewmodels::PopupLocation::TopRight, vmSettings.mockWindowConfiguration.GetPopupLocation(nPopup));
fSetValue(vmSettings, ra::ui::viewmodels::PopupLocation::BottomLeft);
vmSettings.Commit();
- Assert::AreEqual(ra::ui::viewmodels::PopupLocation::BottomLeft, vmSettings.mockConfiguration.GetPopupLocation(nPopup));
+ Assert::AreEqual(ra::ui::viewmodels::PopupLocation::BottomLeft, vmSettings.mockWindowConfiguration.GetPopupLocation(nPopup));
fSetValue(vmSettings, ra::ui::viewmodels::PopupLocation::BottomMiddle);
vmSettings.Commit();
- Assert::AreEqual(ra::ui::viewmodels::PopupLocation::BottomMiddle, vmSettings.mockConfiguration.GetPopupLocation(nPopup));
+ Assert::AreEqual(ra::ui::viewmodels::PopupLocation::BottomMiddle, vmSettings.mockWindowConfiguration.GetPopupLocation(nPopup));
fSetValue(vmSettings, ra::ui::viewmodels::PopupLocation::BottomRight);
vmSettings.Commit();
- Assert::AreEqual(ra::ui::viewmodels::PopupLocation::BottomRight, vmSettings.mockConfiguration.GetPopupLocation(nPopup));
+ Assert::AreEqual(ra::ui::viewmodels::PopupLocation::BottomRight, vmSettings.mockWindowConfiguration.GetPopupLocation(nPopup));
}
void ValidateFeatureInitialize(ra::services::Feature feature, std::function fGetValue)
@@ -127,8 +129,8 @@ TEST_CLASS(OverlaySettingsViewModel_Tests)
OverlaySettingsViewModelHarness vmSettings;
// screenshot toggles require the associated notification to be enabled
- vmSettings.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered, ra::ui::viewmodels::PopupLocation::BottomLeft);
- vmSettings.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Mastery, ra::ui::viewmodels::PopupLocation::BottomLeft);
+ vmSettings.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered, ra::ui::viewmodels::PopupLocation::BottomLeft);
+ vmSettings.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Mastery, ra::ui::viewmodels::PopupLocation::BottomLeft);
vmSettings.mockConfiguration.SetFeatureEnabled(feature, false);
vmSettings.Initialize();
@@ -266,10 +268,10 @@ TEST_CLASS(OverlaySettingsViewModel_Tests)
OverlaySettingsViewModelHarness vmSettings;
// popup off has precedence over screenshot on (should disable screenshot)
- vmSettings.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered, ra::ui::viewmodels::PopupLocation::None);
+ vmSettings.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::AchievementTriggered, ra::ui::viewmodels::PopupLocation::None);
vmSettings.mockConfiguration.SetFeatureEnabled(ra::services::Feature::AchievementTriggeredScreenshot, true);
- vmSettings.mockConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Mastery, ra::ui::viewmodels::PopupLocation::None);
+ vmSettings.mockWindowConfiguration.SetPopupLocation(ra::ui::viewmodels::Popup::Mastery, ra::ui::viewmodels::PopupLocation::None);
vmSettings.mockConfiguration.SetFeatureEnabled(ra::services::Feature::MasteryNotificationScreenshot, true);
vmSettings.Initialize();
diff --git a/tests/ui/viewmodels/PointerFinderViewModel_Tests.cpp b/tests/ui/viewmodels/PointerFinderViewModel_Tests.cpp
index fd3d1e81..ef62f45d 100644
--- a/tests/ui/viewmodels/PointerFinderViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/PointerFinderViewModel_Tests.cpp
@@ -10,10 +10,10 @@
#include "tests\devkit\context\mocks\MockConsoleContext.hh"
#include "tests\devkit\context\mocks\MockEmulatorMemoryContext.hh"
#include "tests\devkit\context\mocks\MockRcClient.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockFileSystem.hh"
#include "tests\mocks\MockClipboard.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockGameContext.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockWindowManager.hh"
diff --git a/tests/ui/viewmodels/PointerInspectorViewModel_Tests.cpp b/tests/ui/viewmodels/PointerInspectorViewModel_Tests.cpp
index 4292eb4f..59f51d8a 100644
--- a/tests/ui/viewmodels/PointerInspectorViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/PointerInspectorViewModel_Tests.cpp
@@ -9,12 +9,12 @@
#include "tests\devkit\context\mocks\MockDevKitContext.hh"
#include "tests\devkit\context\mocks\MockEmulatorMemoryContext.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\devkit\services\mocks\MockLogger.hh"
#include "tests\devkit\services\mocks\MockThreadPool.hh"
#include "tests\devkit\testutil\MemoryAsserts.hh"
#include "tests\mocks\MockClipboard.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockGameContext.hh"
#include "tests\mocks\MockServer.hh"
diff --git a/tests/ui/viewmodels/RichPresenceMonitorViewModel_Tests.cpp b/tests/ui/viewmodels/RichPresenceMonitorViewModel_Tests.cpp
index 556af8ab..9afce90d 100644
--- a/tests/ui/viewmodels/RichPresenceMonitorViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/RichPresenceMonitorViewModel_Tests.cpp
@@ -9,9 +9,9 @@
#include "tests\RA_UnitTestHelpers.h"
#include "tests\data\DataAsserts.hh"
#include "tests\devkit\context\mocks\MockRcClient.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\services\mocks\MockLocalStorage.hh"
#include "tests\mocks\MockAchievementRuntime.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockGameContext.hh"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
diff --git a/tests/ui/viewmodels/TriggerConditionViewModel_Tests.cpp b/tests/ui/viewmodels/TriggerConditionViewModel_Tests.cpp
index 5b1ce6db..17cebe4d 100644
--- a/tests/ui/viewmodels/TriggerConditionViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/TriggerConditionViewModel_Tests.cpp
@@ -10,8 +10,8 @@
#include "tests\devkit\context\mocks\MockConsoleContext.hh"
#include "tests\devkit\context\mocks\MockEmulatorMemoryContext.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\testutil\MemoryAsserts.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockGameContext.hh"
#include "tests\ui\viewmodels\TriggerConditionAsserts.hh"
diff --git a/tests/ui/viewmodels/TriggerViewModel_Tests.cpp b/tests/ui/viewmodels/TriggerViewModel_Tests.cpp
index 1085581e..a777cdd0 100644
--- a/tests/ui/viewmodels/TriggerViewModel_Tests.cpp
+++ b/tests/ui/viewmodels/TriggerViewModel_Tests.cpp
@@ -6,9 +6,9 @@
#include "tests\devkit\context\mocks\MockConsoleContext.hh"
#include "tests\devkit\context\mocks\MockEmulatorMemoryContext.hh"
#include "tests\devkit\context\mocks\MockUserContext.hh"
+#include "tests\devkit\services\mocks\MockConfiguration.hh"
#include "tests\devkit\ui\mocks\MockImageRepository.hh"
#include "tests\mocks\MockClipboard.hh"
-#include "tests\mocks\MockConfiguration.hh"
#include "tests\mocks\MockDesktop.hh"
#include "tests\mocks\MockGameContext.hh"
#include "tests\mocks\MockWindowManager.hh"