Track online-enable and network-service settings per-account instead of globally

This commit is contained in:
Exzap 2024-05-06 18:18:42 +02:00
parent 065fb7eb58
commit 3f8722f0a6
8 changed files with 164 additions and 102 deletions

View file

@ -8,6 +8,8 @@
#include <wx/language.h>
#include <wx/intl.h>
enum class NetworkService;
struct GameEntry
{
GameEntry() = default;
@ -483,8 +485,9 @@ struct CemuConfig
struct
{
ConfigValueBounds<uint32> m_persistent_id{ Account::kMinPersistendId, Account::kMinPersistendId, 0xFFFFFFFF };
ConfigValue<bool> online_enabled{false};
ConfigValue<int> active_service{0};
ConfigValue<bool> legacy_online_enabled{false};
ConfigValue<int> legacy_active_service{0};
std::unordered_map<uint32, NetworkService> service_select; // per-account service index. Key is persistentId
}account{};
// input
@ -509,6 +512,9 @@ struct CemuConfig
bool GetGameListCustomName(uint64 titleId, std::string& customName);
void SetGameListCustomName(uint64 titleId, std::string customName);
NetworkService GetAccountNetworkService(uint32 persistentId);
void SetAccountSelectedService(uint32 persistentId, NetworkService serviceIndex);
private:
GameEntry* GetGameEntryByTitleId(uint64 titleId);
GameEntry* CreateGameEntry(uint64 titleId);