Basic XML tweaking and export

This commit is contained in:
AbstractConcept 2022-09-14 00:25:58 -05:00
parent 3c7cc0c973
commit f78d85de3b
153 changed files with 7705 additions and 2512 deletions

View file

@ -9,15 +9,11 @@ namespace RimWorldAnimationStudio
public string defName = "Undefined";
public string label = "Undefined";
public bool sounds = false;
public int animationTimeTicks = 0;
public List<string> sexTypes = new List<string>();
public List<string> interactionDefTypes = new List<string>();
[XmlArray("actors"), XmlArrayItem("li")]
public List<Actor> actors = new List<Actor>();
[XmlArray("animationStages"), XmlArrayItem("li")]
public List<AnimationStage> animationStages = new List<AnimationStage>();
[XmlIgnore] public int animationTimeTicks = 0;
[XmlArray("sexTypes"), XmlArrayItem("li")] public List<string> sexTypes = new List<string>();
[XmlArray("interactionDefTypes"), XmlArrayItem("li")] public List<string> interactionDefTypes = new List<string>();
[XmlArray("actors"), XmlArrayItem("li")] public List<Actor> actors = new List<Actor>();
[XmlArray("animationStages"), XmlArrayItem("li")] public List<AnimationStage> animationStages = new List<AnimationStage>();
public void Initialize()
{

View file

@ -12,11 +12,25 @@ namespace RimWorldAnimationStudio
public string Hulk;
public string Fat;
public void SetOffset(string bodyType, Vector2 offset)
{
FieldInfo bodyTypeOffsetInfo = typeof(BodyTypeOffset).GetField(bodyType);
if (bodyTypeOffsetInfo == null)
{ return; }
bodyTypeOffsetInfo.SetValue(this, offset.ToString());
}
public Vector3 GetOffset(string bodyType)
{
Debug.Log(bodyType);
FieldInfo bodyTypeOffsetInfo = typeof(BodyTypeOffset).GetField(bodyType);
if (bodyTypeOffsetInfo == null)
{ return new Vector2(); }
string bodyTypeOffsetString = (string)bodyTypeOffsetInfo.GetValue(this);
if (bodyTypeOffsetString == null || bodyTypeOffsetString == "")