internal static void Prefix(ref TechData.SoundType type) { if (IsFoodSoundType(type)) { type = (TechData.SoundType) int.MaxValue; } }
static void Prefix(ref TechData.SoundType type) { $"Trying to play use sound: {type}".logDbg(); if (restrictedSounds.contains(type)) { type = TechData.SoundType.Default; } }
private static bool IsFoodSoundType(TechData.SoundType soundType) { return(soundType == TechData.SoundType.Meat || soundType == TechData.SoundType.Food || soundType == TechData.SoundType.Liquid); }
/// <summary> /// Sets the type of the sound. /// </summary> /// <param name="techType">Type of the tech.</param> /// <param name="soundType">Type of the sound.</param> void ICraftDataHandler.SetSoundType(TechType techType, TechData.SoundType soundType) { AddJsonProperty(techType, "soundType", new JsonValue((int)soundType)); }
/// <summary> /// Sets the type of the sound. /// </summary> /// <param name="techType">Type of the tech.</param> /// <param name="soundType">Type of the sound.</param> public static void SetSoundType(TechType techType, TechData.SoundType soundType) { Main.SetSoundType(techType, soundType); }