Bug fixes plus better layout

This commit is contained in:
AbstractConcept 2022-09-19 00:35:34 -05:00
parent b0a965e0b2
commit 18c0473f39
192 changed files with 4773 additions and 5746 deletions

View file

@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using System.IO;
using UnityEngine.UI;
using SFB;
@ -54,6 +55,7 @@ namespace RimWorldAnimationStudio
Workspace.Instance.ClearHistory();
Workspace.Instance.MakeDirty();
AnimationController.Instance.MakeDirty();
var animationDefCards = Resources.FindObjectsOfTypeAll(typeof(AnimationDefCard)) as AnimationDefCard[];
@ -93,19 +95,14 @@ namespace RimWorldAnimationStudio
public void NewAnimation()
{
return;
var path = Path.Combine(Application.streamingAssetsPath, "AnimationDefs/newAnimationDef.xml");
AnimationDef animationDef = new AnimationDef();
Defs defs = XmlUtility.ReadXML<Defs>(path);
// Add one stage, add one actor, add one clip, add one frame
if (defs?.animationDefs == null)
{ Debug.LogError("Default animation def file contains no animation data"); return; }
Workspace.animationDef = new AnimationDef();
Workspace.Instance.MakeDirty();
var animationDefCards = Resources.FindObjectsOfTypeAll(typeof(AnimationDefCard)) as GameObject[];
if (animationDefCards != null)
{ animationDefCards[0].SetActive(true); }
LoadAnimation(defs.animationDefs[0]);
}
}
}