Improved undo redo function and timelines

This commit is contained in:
AbstractConcept 2022-09-21 00:40:58 -05:00
parent 1af7f41d63
commit e36ef6a368
372 changed files with 4086 additions and 211 deletions

View file

@ -10,9 +10,7 @@ namespace RimWorldAnimationStudio
{
public class SelectBodyPartsDialog : DialogBox
{
private Actor actor;
public void Start()
public void OnEnable()
{
Initialize();
}
@ -30,18 +28,12 @@ namespace RimWorldAnimationStudio
Debug.Log("Add new body part: " + field.text);
Workspace.bodyParts.Add(field.text);
Initialize(null, true);
Initialize(true);
}
public void Initialize(Actor actor = null, bool addedNewTag = false)
public void Initialize(bool addedNewTag = false)
{
if (actor != null)
{ this.actor = actor; }
if (actor == null)
{ actor = this.actor; }
if (actor == null) return;
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
foreach (string bodyPart in actor.requiredGenitals)
{
@ -69,7 +61,7 @@ namespace RimWorldAnimationStudio
else if (toggleComp.isOn == false && actor.requiredGenitals.Contains(bodyPart))
{ actor.requiredGenitals.Remove(bodyPart); }
Workspace.Instance.MakeDirty();
Workspace.Instance.RecordEvent("Actor required body part");
});
if (addedNewTag && i == Workspace.sexTypes.Count - 1)