Factor out CSync hack into a separate method
We gonna register more synced entries in debug-only builds, but marking nullable fields with the [SyncedEntryField] attribute is not an option.
This commit is contained in:
parent
f158e7728c
commit
b15e93ac34
|
@ -354,20 +354,20 @@ namespace MuzikaGromche
|
|||
CanModifyCallback = CanModifyWeightsNow,
|
||||
});
|
||||
LethalConfigManager.AddConfigItem(slider);
|
||||
}
|
||||
|
||||
// HACK because CSync doesn't provide an API to register a list of config entries
|
||||
// See https://github.com/lc-sigurd/CSync/issues/11
|
||||
foreach (var track in Plugin.Tracks)
|
||||
{
|
||||
// This is basically what ConfigFile.PopulateEntryContainer does
|
||||
SyncedEntryBase entryBase = track.Weight;
|
||||
EntryContainer.Add(entryBase.BoxedEntry.ToSyncedEntryIdentifier(), entryBase);
|
||||
CSyncHackAddSyncedEntry(track.Weight);
|
||||
}
|
||||
|
||||
ConfigManager.Register(this);
|
||||
}
|
||||
|
||||
// HACK because CSync doesn't provide an API to register a list of config entries
|
||||
// See https://github.com/lc-sigurd/CSync/issues/11
|
||||
private void CSyncHackAddSyncedEntry(SyncedEntryBase entryBase)
|
||||
{
|
||||
// This is basically what ConfigFile.PopulateEntryContainer does
|
||||
EntryContainer.Add(entryBase.BoxedEntry.ToSyncedEntryIdentifier(), entryBase);
|
||||
}
|
||||
|
||||
public static CanModifyResult CanModifyWeightsNow()
|
||||
{
|
||||
var startOfRound = StartOfRound.Instance;
|
||||
|
|
Loading…
Reference in New Issue