Fixed an issue affecting parsing the required runstate to edit a setting.
This commit is contained in:
@@ -64,7 +64,7 @@ public class SettingsEntryRegistrar : ISettingsRegistrationProvider
|
||||
Func<OneOf<string, XElement, object>, bool> valueChangePredicate)
|
||||
{
|
||||
return !info.Element.GetAttributeBool("ReadOnly", false)
|
||||
|| !info.EditableStates.HasFlag(_infoProvider?.CurrentRunState ?? RunState.Running)
|
||||
|| info.EditableStates < _infoProvider.CurrentRunState
|
||||
|| valueChangePredicate is null
|
||||
|| valueChangePredicate.Invoke(newValue);
|
||||
}
|
||||
|
||||
@@ -92,9 +92,9 @@ public sealed class SettingsFileParserService :
|
||||
OwnerPackage = res.path.ContentPackage,
|
||||
DataType = element.GetAttributeString("Type", string.Empty),
|
||||
Element = element,
|
||||
EditableStates = element.GetAttributeBool("AllowChangesWhileExecuting", true) ? RunState.Running :
|
||||
element.GetAttributeBool("ReadOnly", false) ? RunState.LoadedNoExec :
|
||||
RunState.Unloaded,
|
||||
EditableStates = element.GetAttributeBool("ReadOnly", false) ? RunState.Unloaded :
|
||||
element.GetAttributeBool("AllowChangesWhileExecuting", true) ? RunState.Running :
|
||||
RunState.LoadedNoExec,
|
||||
NetSync = element.GetAttributeEnum("NetSync", NetSync.None),
|
||||
#if CLIENT
|
||||
DisplayName = $"{packageIdent}.{name}.DisplayName",
|
||||
|
||||
Reference in New Issue
Block a user