Settings: Add netplay layer

This commit is contained in:
Stenzek 2023-08-30 18:19:49 +10:00
parent bdebd8bdef
commit fd6aeefd93
3 changed files with 11 additions and 1 deletions

View File

@ -10,6 +10,7 @@ class LayeredSettingsInterface final : public SettingsInterface
public:
enum Layer : u32
{
LAYER_NETPLAY,
LAYER_CMDLINE,
LAYER_GAME,
LAYER_INPUT,
@ -61,7 +62,7 @@ public:
using SettingsInterface::GetUIntValue;
private:
static constexpr Layer FIRST_LAYER = LAYER_CMDLINE;
static constexpr Layer FIRST_LAYER = LAYER_NETPLAY;
static constexpr Layer LAST_LAYER = LAYER_BASE;
std::array<SettingsInterface*, NUM_LAYERS> m_layers{};

View File

@ -69,5 +69,8 @@ void SetGameSettingsLayer(SettingsInterface* sif);
/// Sets the input profile settings layer. Called by VMManager when the game changes.
void SetInputSettingsLayer(SettingsInterface* sif);
/// Sets the netplay settings layer. Use once a session is established.
void SetNetplaySettingsLayer(SettingsInterface* sif);
} // namespace Internal
} // namespace Host

View File

@ -190,3 +190,9 @@ void Host::Internal::SetInputSettingsLayer(SettingsInterface* sif)
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.SetLayer(LayeredSettingsInterface::LAYER_INPUT, sif);
}
void Host::Internal::SetNetplaySettingsLayer(SettingsInterface* sif)
{
std::unique_lock lock(s_settings_mutex);
s_layered_settings_interface.SetLayer(LayeredSettingsInterface::LAYER_NETPLAY, sif);
}