コード例 #1
0
ファイル: ChromaRegistry.cs プロジェクト: Lionmeow/SRML
 /// <summary>
 /// See if a <see cref="RanchDirector.Palette"/> is modded
 /// </summary>
 /// <param name="id"></param>
 /// <returns>True if given <see cref="RanchDirector.Palette"/> is from a mod</returns>
 public static bool IsModdedPalette(RanchDirector.Palette id) => moddedPalettes.ContainsKey(id);
コード例 #2
0
 public static void Prefix(RanchModel __instance, RanchDirector.PaletteType type, ref RanchDirector.Palette pal)
 {
     if (!((RanchDirector)__instance.participant).paletteDict.ContainsKey(pal))
     {
         pal = ChromaRegistry.GetDefaultPaletteForType(type);
     }
 }
コード例 #3
0
 /// <summary>
 /// Check if a <see cref="RanchDirector.Palette"/> was registered by a mod
 /// </summary>
 /// <param name="palette"></param>
 /// <returns></returns>
 public static bool IsModdedPalette(this RanchDirector.Palette palette)
 {
     return(moddedPalettes.ContainsKey(palette));
 }
コード例 #4
0
 public static void Prefix(RanchModel __instance, RanchDirector.PaletteType type, ref RanchDirector.Palette pal)
 {
     if (!Enum.IsDefined(typeof(RanchDirector.Palette), pal))
     {
         pal = ChromaPackRegistry.GetDefaultPaletteForType(type);
     }
 }
コード例 #5
0
 internal static bool IsPaletteRegistered(RanchDirector.Palette palette) => PALETTE_ENTRIES.Count(p => p.palette == palette) > 0;