Added a field to the AnimationDef to prevent random selection

This commit is contained in:
Salacian 2023-02-21 01:25:23 +01:00
parent 8204a5698b
commit 447c4d61b6
2 changed files with 7 additions and 1 deletions

View File

@ -13,6 +13,7 @@ namespace Rimworld_Animations {
public List<Actor> actors;
public int animationTimeTicks = 0; //do not set manually
public bool sounds = false;
public bool randomlySelectable = true;
public List<rjw.xxx.rjwSextype> sexTypes = null;
public List<String> interactionDefTypes = null;
public List<string> tags = new List<string>();

View File

@ -33,7 +33,12 @@ namespace Rimworld_Animations {
List<Pawn> localParticipants = new List<Pawn>(participants);
IEnumerable<AnimationDef> options = DefDatabase<AnimationDef>.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)