protected string SettingsQuery(string name) { if (SettingsOverrides.TryGetValue(name, out var val)) { // use override } else { // try to get actual value from settings if (NonSyncSettingNames.Contains(name)) { _settings.MednafenValues.TryGetValue(name, out val); } else { _syncSettings.MednafenValues.TryGetValue(name, out val); } } // in either case, might need defaults if (val == null) { SettingsInfo.AllSettingsByKey.TryGetValue(name, out var info); val = info?.DefaultValue; } if (val == null) { throw new InvalidOperationException($"Core asked for setting {name} which was not found in the defaults"); } return(val); }
protected string SettingsQuery(string name) { SettingsOverrides.TryGetValue(name, out var val); if (val == null) { if (!_syncSettingsActual.MednafenValues.TryGetValue(name, out val)) { if (SettingsInfo.SettingsByKey.TryGetValue(name, out var info)) { val = info.DefaultValue; } else { throw new InvalidOperationException($"Core asked for setting {name} which was not found in the defaults"); } } } return(val); }