From 447c4d61b661c53c6c600c4783bc183088a0a176 Mon Sep 17 00:00:00 2001 From: Salacian Date: Tue, 21 Feb 2023 01:25:23 +0100 Subject: [PATCH] Added a field to the AnimationDef to prevent random selection --- 1.4/Source/Defs/AnimationDef.cs | 1 + 1.4/Source/Utilities/AnimationUtility.cs | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/1.4/Source/Defs/AnimationDef.cs b/1.4/Source/Defs/AnimationDef.cs index 395ff83..e2e8d28 100644 --- a/1.4/Source/Defs/AnimationDef.cs +++ b/1.4/Source/Defs/AnimationDef.cs @@ -13,6 +13,7 @@ namespace Rimworld_Animations { public List actors; public int animationTimeTicks = 0; //do not set manually public bool sounds = false; + public bool randomlySelectable = true; public List sexTypes = null; public List interactionDefTypes = null; public List tags = new List(); diff --git a/1.4/Source/Utilities/AnimationUtility.cs b/1.4/Source/Utilities/AnimationUtility.cs index 1ae89be..e03281d 100644 --- a/1.4/Source/Utilities/AnimationUtility.cs +++ b/1.4/Source/Utilities/AnimationUtility.cs @@ -33,7 +33,12 @@ namespace Rimworld_Animations { List localParticipants = new List(participants); IEnumerable options = DefDatabase.AllDefs.Where((AnimationDef x) => { - + if (!x.randomlySelectable) + { + if (AnimationSettings.debugMode) + Log.Message(x.defName.ToStringSafe() + " not selected -- isn't randomly selectable"); + return false; + } if (x.actors.Count != localParticipants.Count) { if (AnimationSettings.debugMode)