mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Config: Allow passing a DefaultState object to Set functions to delete keys.
This commit is contained in:
@ -100,32 +100,32 @@ LayerType GetActiveLayerForConfig(const Info<T>& info)
|
||||
return GetActiveLayerForConfig(info.GetLocation());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void Set(LayerType layer, const Info<T>& info, const std::common_type_t<T>& value)
|
||||
template <typename InfoT, typename ValueT>
|
||||
void Set(LayerType layer, const InfoT& info, const ValueT& value)
|
||||
{
|
||||
if (GetLayer(layer)->Set(info, value))
|
||||
OnConfigChanged();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void SetBase(const Info<T>& info, const std::common_type_t<T>& value)
|
||||
template <typename InfoT, typename ValueT>
|
||||
void SetBase(const Info<InfoT>& info, const ValueT& value)
|
||||
{
|
||||
Set<T>(LayerType::Base, info, value);
|
||||
Set(LayerType::Base, info, value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void SetCurrent(const Info<T>& info, const std::common_type_t<T>& value)
|
||||
template <typename InfoT, typename ValueT>
|
||||
void SetCurrent(const Info<InfoT>& info, const ValueT& value)
|
||||
{
|
||||
Set<T>(LayerType::CurrentRun, info, value);
|
||||
Set(LayerType::CurrentRun, info, value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void SetBaseOrCurrent(const Info<T>& info, const std::common_type_t<T>& value)
|
||||
template <typename InfoT, typename ValueT>
|
||||
void SetBaseOrCurrent(const Info<InfoT>& info, const ValueT& value)
|
||||
{
|
||||
if (GetActiveLayerForConfig(info) == LayerType::Base)
|
||||
Set<T>(LayerType::Base, info, value);
|
||||
Set(LayerType::Base, info, value);
|
||||
else
|
||||
Set<T>(LayerType::CurrentRun, info, value);
|
||||
Set(LayerType::CurrentRun, info, value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
Reference in New Issue
Block a user