mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Standalone exported
This commit is contained in:
parent
1e2c4fa6bf
commit
7e1680a7fb
605 changed files with 2169 additions and 3312 deletions
|
@ -32,7 +32,7 @@ namespace RimWorldAnimationStudio
|
|||
public bool ShouldSerializeraceOffsets() { return raceOffsets.NotNullOrEmpty(); }
|
||||
public bool ShouldSerializeblacklistedRaces() { return blacklistedRaces.NotNullOrEmpty(); }
|
||||
public bool ShouldSerializetags() { return tags.NotNullOrEmpty(); }
|
||||
|
||||
public bool ShouldSerializeinitiator() { return initiator; }
|
||||
public bool ShouldSerializecontrolGenitalAngle() { return controlGenitalAngle; }
|
||||
public bool ShouldSerializeisFucking() { return isFucking; }
|
||||
public bool ShouldSerializeisFucked() { return isFucked; }
|
||||
|
@ -89,6 +89,7 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
bodyDefTypes = bodyDefTypes.Intersect(Tags.bodyDefTypes.Concat(CustomTags.bodyDefTypes))?.ToList();
|
||||
requiredGenitals = requiredGenitals.Intersect(Tags.bodyParts.Concat(CustomTags.bodyParts))?.ToList();
|
||||
raceOffsets = raceOffsets.Except(raceOffsets.Where(x => x.OffsetIsZero()))?.ToList();
|
||||
}
|
||||
|
||||
public bool MakeNew()
|
||||
|
|
|
@ -8,6 +8,7 @@ using UnityEngine;
|
|||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
[Serializable]
|
||||
public class AlienRaceDef
|
||||
{
|
||||
public string defName;
|
||||
|
@ -17,10 +18,7 @@ namespace RimWorldAnimationStudio
|
|||
public List<MultiDirectionalGraphic> bodyTypeGraphics = new List<MultiDirectionalGraphic>();
|
||||
public MultiDirectionalGraphic headGraphics = new MultiDirectionalGraphic();
|
||||
|
||||
public AlienRaceDef()
|
||||
{
|
||||
|
||||
}
|
||||
public AlienRaceDef() { }
|
||||
|
||||
public AlienRaceDef(string defName)
|
||||
{
|
||||
|
@ -101,31 +99,17 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public void SetHeadGraphicPath(string path, CardinalDirection facing)
|
||||
{
|
||||
if (path == null || path.Any() == false || File.Exists(path) == false || Path.GetExtension(path) != ".png")
|
||||
{ path = "Invalid file path"; }
|
||||
|
||||
switch (facing)
|
||||
{
|
||||
case CardinalDirection.North:
|
||||
headGraphics.northGraphic.path = path;
|
||||
headGraphics.northGraphic.sprite = LoadSprite(path); break;
|
||||
case CardinalDirection.East:
|
||||
headGraphics.eastGraphic.path = path;
|
||||
headGraphics.eastGraphic.sprite = LoadSprite(path); break;
|
||||
case CardinalDirection.South:
|
||||
headGraphics.southGraphic.path = path;
|
||||
headGraphics.southGraphic.sprite = LoadSprite(path); break;
|
||||
default:
|
||||
headGraphics.eastGraphic.path = path;
|
||||
headGraphics.eastGraphic.sprite = LoadSprite(path); break;
|
||||
case CardinalDirection.North: headGraphics.northGraphic.SetPath(path); break;
|
||||
case CardinalDirection.East: headGraphics.eastGraphic.SetPath(path); break;
|
||||
case CardinalDirection.South: headGraphics.southGraphic.SetPath(path); break;
|
||||
default: headGraphics.eastGraphic.SetPath(path); break;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetBodyTypeGraphicPath(string path, CardinalDirection facing, string bodyType = "None")
|
||||
{
|
||||
if (path == null || path.Any() == false || File.Exists(path) == false || Path.GetExtension(path) != ".png")
|
||||
{ path = "Invalid file path"; }
|
||||
|
||||
MultiDirectionalGraphic bodyTypeGraphic = bodyTypeGraphics.FirstOrDefault(x => x.bodyType == bodyType);
|
||||
|
||||
if (bodyTypeGraphic == null)
|
||||
|
@ -136,36 +120,16 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
switch (facing)
|
||||
{
|
||||
case CardinalDirection.North:
|
||||
bodyTypeGraphic.northGraphic.path = path;
|
||||
bodyTypeGraphic.northGraphic.sprite = LoadSprite(path); break;
|
||||
case CardinalDirection.East:
|
||||
bodyTypeGraphic.eastGraphic.path = path;
|
||||
bodyTypeGraphic.eastGraphic.sprite = LoadSprite(path); break;
|
||||
case CardinalDirection.South:
|
||||
bodyTypeGraphic.southGraphic.path = path;
|
||||
bodyTypeGraphic.southGraphic.sprite = LoadSprite(path); break;
|
||||
default:
|
||||
bodyTypeGraphic.eastGraphic.path = path;
|
||||
bodyTypeGraphic.eastGraphic.sprite = LoadSprite(path); break;
|
||||
case CardinalDirection.North: bodyTypeGraphic.northGraphic.SetPath(path); break;
|
||||
case CardinalDirection.East: bodyTypeGraphic.eastGraphic.SetPath(path); break;
|
||||
case CardinalDirection.South:bodyTypeGraphic.southGraphic.SetPath(path); break;
|
||||
default: bodyTypeGraphic.eastGraphic.SetPath(path); break;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasValidHeadGraphicPath(CardinalDirection facing)
|
||||
{
|
||||
string path;
|
||||
|
||||
switch (facing)
|
||||
{
|
||||
case CardinalDirection.North: path = headGraphics.northGraphic.path; break;
|
||||
case CardinalDirection.East: path = headGraphics.eastGraphic.path; break;
|
||||
case CardinalDirection.South: path = headGraphics.southGraphic.path; break;
|
||||
default: path = headGraphics.eastGraphic.path; break;
|
||||
}
|
||||
|
||||
if (path == null || path.Any() == false || File.Exists(path) == false || Path.GetExtension(path) != ".png") return false;
|
||||
|
||||
return true;
|
||||
return headGraphics.HasValidPathForDirection(facing);
|
||||
}
|
||||
|
||||
public bool HasValidBodyTypeGraphicPath(CardinalDirection facing, string bodyType = "None")
|
||||
|
@ -178,33 +142,7 @@ namespace RimWorldAnimationStudio
|
|||
bodyTypeGraphics.Add(bodyTypeGraphic);
|
||||
}
|
||||
|
||||
string path;
|
||||
|
||||
switch (facing)
|
||||
{
|
||||
case CardinalDirection.North: path = bodyTypeGraphic.northGraphic.path; break;
|
||||
case CardinalDirection.East: path = bodyTypeGraphic.eastGraphic.path; break;
|
||||
case CardinalDirection.South: path = bodyTypeGraphic.southGraphic.path; break;
|
||||
default: path = bodyTypeGraphic.eastGraphic.path; break;
|
||||
}
|
||||
|
||||
if (path == null || path.Any() == false || File.Exists(path) == false || Path.GetExtension(path) != ".png") return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public Sprite LoadSprite(string path)
|
||||
{
|
||||
if (path == null || path.Any() == false || File.Exists(path) == false || Path.GetExtension(path) != ".png") return null;
|
||||
|
||||
byte[] pngBytes = File.ReadAllBytes(path);
|
||||
|
||||
Texture2D tex = new Texture2D(2, 2);
|
||||
tex.LoadImage(pngBytes);
|
||||
|
||||
Sprite sprite = Sprite.Create(tex, new Rect(0.0f, 0.0f, tex.width, tex.height), new Vector2(0.5f, 0.5f), 85.0f);
|
||||
|
||||
return sprite;
|
||||
return bodyTypeGraphic.HasValidPathForDirection(facing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,10 +10,10 @@ namespace RimWorldAnimationStudio
|
|||
public string defName = "Human";
|
||||
public string offset = "(0, 0)";
|
||||
|
||||
public AlienRaceOffset()
|
||||
{
|
||||
public bool ShouldSerializedefName() { return OffsetIsZero() == false; }
|
||||
public bool ShouldSerializeoffset() { return OffsetIsZero() == false; }
|
||||
|
||||
}
|
||||
public AlienRaceOffset() { }
|
||||
|
||||
public AlienRaceOffset(string defName)
|
||||
{
|
||||
|
@ -35,5 +35,11 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
return new Vector3(float.Parse(raceOffsets[0]), 0f, float.Parse(raceOffsets[1]));
|
||||
}
|
||||
|
||||
public bool OffsetIsZero()
|
||||
{
|
||||
Vector3 vec = GetOffset();
|
||||
return Mathf.Approximately(vec.x, 0f) && Mathf.Approximately(vec.y, 0f) && Mathf.Approximately(vec.x, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,18 +9,12 @@ namespace RimWorldAnimationStudio
|
|||
public string layer = "Pawn";
|
||||
public List<string> tags;
|
||||
|
||||
//[XmlIgnore] public Dictionary<int, string> SoundEffects = new Dictionary<int, string>();
|
||||
//[XmlIgnore] public int duration;
|
||||
|
||||
public virtual int duration { get { return 0; } }
|
||||
|
||||
public abstract void BuildSimpleCurves();
|
||||
|
||||
public bool ShouldSerializetags() { return tags.NotNullOrEmpty(); }
|
||||
|
||||
public virtual void ValidateData()
|
||||
{
|
||||
|
||||
}
|
||||
public virtual void ValidateData() { }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,10 +88,7 @@ namespace RimWorldAnimationStudio
|
|||
keyframes[keyframes.Count - 1].tickDuration = 1;
|
||||
}
|
||||
|
||||
public override void ValidateData()
|
||||
{
|
||||
|
||||
}
|
||||
public override void ValidateData() { }
|
||||
|
||||
public bool MakeNew()
|
||||
{
|
||||
|
|
|
@ -18,6 +18,11 @@ namespace RimWorldAnimationStudio
|
|||
[XmlArray("animationStages"), XmlArrayItem("li")] public List<AnimationStage> animationStages = new List<AnimationStage>();
|
||||
[XmlIgnore] public int animationTimeTicks = 0;
|
||||
|
||||
public bool ShouldSerializesexTypes() { return sexTypes.NotNullOrEmpty(); }
|
||||
public bool ShouldSerializeinteractionDefTypes() { return interactionDefTypes.NotNullOrEmpty(); }
|
||||
public bool ShouldSerializeactors() { return actors.NotNullOrEmpty(); }
|
||||
public bool ShouldSerializeanimationStages() { return animationStages.NotNullOrEmpty(); }
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
animationTimeTicks = 0;
|
||||
|
|
|
@ -6,18 +6,14 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public class Keyframe
|
||||
{
|
||||
public int? atTick;
|
||||
[XmlIgnore] public int? atTick;
|
||||
|
||||
public int tickDuration = 1;
|
||||
public string soundEffect;
|
||||
public List<string> tags = new List<string>();
|
||||
|
||||
public bool ShouldSerializeatTick() { return atTick != null; }
|
||||
public bool ShouldSerializetags() { return tags.NotNullOrEmpty(); }
|
||||
|
||||
public virtual void ValidateData()
|
||||
{
|
||||
|
||||
}
|
||||
public virtual void ValidateData() { }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
[Serializable]
|
||||
public class MultiDirectionalGraphic
|
||||
{
|
||||
public string bodyType = "None";
|
||||
public DirectionalGraphic northGraphic = new DirectionalGraphic();
|
||||
public DirectionalGraphic eastGraphic = new DirectionalGraphic();
|
||||
public DirectionalGraphic southGraphic = new DirectionalGraphic();
|
||||
|
||||
public MultiDirectionalGraphic() { }
|
||||
|
||||
public MultiDirectionalGraphic(string bodyType)
|
||||
{
|
||||
this.bodyType = bodyType;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 86cb79b8d4c053f4a981ed17b86ae9bb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue