File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ public override void OnNetworkSpawn()
6969 if ( ! ReferenceEquals ( syncedEntryBase . BoxedEntry , args . ChangedSetting ) ) return ;
7070 _deltas [ currentIndex ] = syncedEntryBase . ToDelta ( ) ;
7171 } ;
72+
73+ syncedEntryBase . SyncEnabledChanged += ( _ , args ) =>
74+ {
75+ _deltas [ currentIndex ] = syncedEntryBase . ToDelta ( ) ;
76+ } ;
7277 }
7378
7479 InitialSyncCompletedHandler ? . Invoke ( this , EventArgs . Empty ) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,17 @@ public abstract class SyncedEntryBase
99 public abstract ConfigEntryBase BoxedEntry { get ; protected init ; }
1010
1111 public abstract object ? BoxedValueOverride { get ; set ; }
12- public virtual bool SyncEnabled { get ; set ; }
12+
13+ private bool _syncEnabled ;
14+ public bool SyncEnabled {
15+ get => _syncEnabled ;
16+ set {
17+ if ( value == _syncEnabled ) return ;
18+ _syncEnabled = value ;
19+ SyncEnabledChanged ? . Invoke ( this , EventArgs . Empty ) ;
20+ }
21+ }
22+
1323 public virtual bool ValueOverridden { get ; internal set ; } = false ;
1424
1525 internal SyncedEntryBase ( ConfigEntryBase configEntry )
@@ -18,6 +28,8 @@ internal SyncedEntryBase(ConfigEntryBase configEntry)
1828 BoxedValueOverride = configEntry . DefaultValue ;
1929 }
2030
31+ internal event EventHandler ? SyncEnabledChanged ;
32+
2133 public void SetSerializedValueOverride ( string value )
2234 {
2335 BoxedValueOverride = TomlTypeConverter . ConvertToValue ( value , BoxedEntry . SettingType ) ;
You can’t perform that action at this time.
0 commit comments