- Weird LuaCs Settings Menu bug present: package is loaded on startup but is then unloaded if the settingsmenu is opened and the package is not in the enabled list.
This commit is contained in:
@@ -30,12 +30,14 @@ public abstract class SettingBase : ISettingBase
|
||||
}
|
||||
|
||||
private int _isDisposed = 0;
|
||||
protected virtual bool IsDisposed
|
||||
public virtual bool IsDisposed
|
||||
{
|
||||
get => ModUtils.Threading.GetBool(ref _isDisposed);
|
||||
private set => ModUtils.Threading.SetBool(ref _isDisposed, value);
|
||||
}
|
||||
|
||||
protected abstract void OnDispose();
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
if (!ModUtils.Threading.CheckIfClearAndSetBool(ref _isDisposed))
|
||||
@@ -43,8 +45,8 @@ public abstract class SettingBase : ISettingBase
|
||||
return;
|
||||
}
|
||||
|
||||
OnDispose();
|
||||
ConfigInfo = null;
|
||||
OnValueChanged = null;
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
@@ -55,6 +57,6 @@ public abstract class SettingBase : ISettingBase
|
||||
public abstract string GetDefaultStringValue();
|
||||
|
||||
public abstract bool TrySetValue(OneOf<string, XElement> value);
|
||||
public event Action<ISettingBase> OnValueChanged;
|
||||
public abstract event Action<ISettingBase> OnValueChanged;
|
||||
public abstract OneOf<string, XElement> GetSerializableValue();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user