void convertCustomProperties(SerializableDictionary old, InGame.CustomProperties @new) { old.ForEach( pair => @new.Add( pair.Key, new InGame.CustomProperty(pair.Value.name, pair.Value.value, pair.Value.type, pair.Value.description))); }
private static void ValidateSounds(SerializableDictionary <string, ConfigurationV4.Sound> configuration, HashSet <string> nonExistingPacks, Func <SoundPacksFileV1.SoundPack, SoundPacksFileV1.Audio[]> selector) { configuration.ForEach(kvp => { var soundName = kvp.Value.SoundPack; if (soundName == null) { return; } if (SoundPacksManager.instance.SoundPacks. SelectMany(p => selector.Invoke(p.Value)). Any(a => a?.Name == soundName)) { return; } Mod.Instance.Log.Warning($"Sound {soundName} wasn't found in any of sound packs. Falling back to default value."); kvp.Value.SoundPack = null; nonExistingPacks.Add(soundName); }); }
void convertCustomProperties( SerializableDictionary old, CustomProperties @new ) { old.ForEach( pair => @new.Add( pair.Key, new CustomProperty( pair.Value.name, pair.Value.value, pair.Value.type, pair.Value.description ) ) ) ; }