shadPS4/src/core/user_settings.h
georgemoralis 08168dc386
New config mode (part1 of 0.15.1 branch series) (#4145)
* using new emulator_settings

* the default user is now just player one

* transfer install, addon dirs

* fix load custom config issue

---------

Co-authored-by: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com>
2026-03-21 22:26:36 +02:00

46 lines
1.0 KiB
C++

// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <filesystem>
#include <functional>
#include <memory>
#include <mutex>
#include <sstream>
#include <string>
#include <vector>
#include <nlohmann/json.hpp>
#include "common/logging/log.h"
#include "common/types.h"
#include "core/user_manager.h"
#define UserSettings (*UserSettingsImpl::GetInstance())
#define UserManagement UserSettings.GetUserManager()
// -------------------------------
// User settings
// -------------------------------
class UserSettingsImpl {
public:
UserSettingsImpl();
~UserSettingsImpl();
UserManager& GetUserManager() {
return m_userManager;
}
bool Save() const;
bool Load();
static std::shared_ptr<UserSettingsImpl> GetInstance();
static void SetInstance(std::shared_ptr<UserSettingsImpl> instance);
private:
UserManager m_userManager;
static std::shared_ptr<UserSettingsImpl> s_instance;
static std::mutex s_mutex;
};