mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Config: Add Get/Set on Layer
For convenience, when getting/setting from ConfigInfos.
This commit is contained in:
@ -66,9 +66,7 @@ LayerType GetActiveLayerForConfig(const ConfigLocation&);
|
||||
template <typename T>
|
||||
T Get(LayerType layer, const ConfigInfo<T>& info)
|
||||
{
|
||||
return GetLayer(layer)
|
||||
->GetOrCreateSection(info.location.system, info.location.section)
|
||||
->template Get<T>(info.location.key, info.default_value);
|
||||
return GetLayer(layer)->Get(info);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -92,9 +90,7 @@ LayerType GetActiveLayerForConfig(const ConfigInfo<T>& info)
|
||||
template <typename T>
|
||||
void Set(LayerType layer, const ConfigInfo<T>& info, const T& value)
|
||||
{
|
||||
GetLayer(layer)
|
||||
->GetOrCreateSection(info.location.system, info.location.section)
|
||||
->Set(info.location.key, value);
|
||||
GetLayer(layer)->Set(info, value);
|
||||
InvokeConfigChangedCallbacks();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user