- 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:
Maplewheels
2026-02-28 22:10:29 -05:00
parent 28b355911d
commit 09bc2d0891
9 changed files with 52 additions and 191 deletions
@@ -65,7 +65,7 @@ public class SettingEntry<T> : SettingBase, ISettingBase<T>, INetworkSyncVar whe
{
return false;
}
OnValueChanged?.Invoke(this);
#if CLIENT
if (GameMain.IsMultiplayer && SyncType is NetSync.ClientOneWay or NetSync.TwoWay)
{
@@ -96,6 +96,11 @@ public class SettingEntry<T> : SettingBase, ISettingBase<T>, INetworkSyncVar whe
return true;
}
protected override void OnDispose()
{
ValueChangePredicate = null;
}
public override Type GetValueType() => typeof(T);
public override string GetStringValue() => Value.ToString();
@@ -135,6 +140,8 @@ public class SettingEntry<T> : SettingBase, ISettingBase<T>, INetworkSyncVar whe
return !isFailed && TrySetValue(typeConvertedValue);
}
public override event Action<ISettingBase> OnValueChanged;
public override OneOf<string, XElement> GetSerializableValue() => Value.ToString();
// -- Networking