mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Bug fixes plus better layout
This commit is contained in:
parent
b0a965e0b2
commit
18c0473f39
192 changed files with 4773 additions and 5746 deletions
|
@ -67,7 +67,7 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
Workspace.actorID = actorID;
|
||||
|
||||
foreach (ActorBody actorBody in AnimationController.Instance.GetComponentsInChildren<ActorBody>())
|
||||
foreach (ActorBody actorBody in AnimationController.Instance.actorBodies.GetComponentsInChildren<ActorBody>())
|
||||
{
|
||||
if (actorBody == this)
|
||||
{ continue; }
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
Workspace.actorID = parent.actorID;
|
||||
|
||||
foreach (ActorBody actorBody in AnimationController.Instance.GetComponentsInChildren<ActorBody>())
|
||||
foreach (ActorBody actorBody in AnimationController.Instance.actorBodies.GetComponentsInChildren<ActorBody>())
|
||||
{
|
||||
actorBody.bodyRenderer.color = Constants.ColorWhite;
|
||||
actorBody.headRenderer.color = Constants.ColorWhite;
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace RimWorldAnimationStudio
|
|||
string bodyType = bodyTypeDropdown.options[bodyTypeDropdown.value].text;
|
||||
bodyType = bodyType == null || bodyType == "" ? "Male" : bodyType;
|
||||
|
||||
AnimationController.Instance.GetComponentsInChildren<ActorBody>()[Workspace.actorID].bodyType = bodyType;
|
||||
AnimationController.Instance.actorBodies.GetComponentsInChildren<ActorBody>()[Workspace.actorID].bodyType = bodyType;
|
||||
|
||||
bodyOffsetXField.text = actor.bodyTypeOffset.GetOffset(bodyType).x.ToString();
|
||||
bodyOffsetZField.text = actor.bodyTypeOffset.GetOffset(bodyType).z.ToString();
|
||||
|
@ -57,6 +57,15 @@ namespace RimWorldAnimationStudio
|
|||
actor.bodyTypeOffset.SetOffset(bodyType, new Vector2(x, z));
|
||||
|
||||
actor.initiator = initiatorToggle.isOn;
|
||||
|
||||
switch (genderDropdown.value)
|
||||
{
|
||||
case 0: actor.requiredGender = new List<string>() { "Female" }; break;
|
||||
case 2: actor.requiredGender = new List<string>() { "Male" }; break;
|
||||
default: actor.requiredGender = null; break;
|
||||
}
|
||||
|
||||
Workspace.Instance.MakeDirty();
|
||||
}
|
||||
|
||||
public void OpenSelectBodyPartsDialog()
|
||||
|
@ -100,11 +109,11 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
isDirty = true;
|
||||
|
||||
if (Workspace.actorID >= AnimationController.Instance.GetComponentsInChildren<ActorBody>().Count())
|
||||
if (Workspace.actorID >= AnimationController.Instance.actorBodies.GetComponentsInChildren<ActorBody>().Count())
|
||||
{ Debug.Log("Waiting for actors to initialize..."); return; }
|
||||
|
||||
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
|
||||
ActorBody actorBody = AnimationController.Instance.GetComponentsInChildren<ActorBody>()[Workspace.actorID];
|
||||
ActorBody actorBody = AnimationController.Instance.actorBodies.GetComponentsInChildren<ActorBody>()[Workspace.actorID];
|
||||
|
||||
string bodyType = actorBody.bodyType;
|
||||
bodyType = bodyType == null || bodyType == "" ? "Male" : bodyType;
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace RimWorldAnimationStudio
|
|||
if (Workspace.actorID >= AnimationController.Instance.transform.childCount)
|
||||
{ return; }
|
||||
|
||||
ActorBody actorBody = AnimationController.Instance.transform.GetChild(Workspace.actorID).GetComponent<ActorBody>();
|
||||
ActorBody actorBody = AnimationController.Instance.actorBodies.GetComponentsInChildren<ActorBody>()[Workspace.actorID];
|
||||
string bodyType = actorBody.bodyType;
|
||||
|
||||
PawnAnimationClip clip = Workspace.animationDef.animationStages[Workspace.stageID].animationClips[Workspace.actorID];
|
||||
|
|
|
@ -19,21 +19,18 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public void AddBodyDefType(InputField field)
|
||||
{
|
||||
Debug.Log("Attempting to add new body def type");
|
||||
|
||||
if (field?.text == null || field.text == "")
|
||||
{ Debug.LogWarning("Input field is null"); return; }
|
||||
{ return; }
|
||||
|
||||
if (Workspace.bodyDefTypes.Contains(field.text))
|
||||
{ Debug.LogWarning("Body def type is null"); field.text = ""; return; }
|
||||
{ field.text = ""; return; }
|
||||
|
||||
Debug.Log("Added new body type def: " + field.text);
|
||||
Workspace.bodyDefTypes.Add(field.text);
|
||||
|
||||
Initialize();
|
||||
Initialize(null, true);
|
||||
}
|
||||
|
||||
public void Initialize(Actor actor = null)
|
||||
public void Initialize(Actor actor = null, bool addedNewTag = false)
|
||||
{
|
||||
if (actor != null)
|
||||
{ this.actor = actor; }
|
||||
|
@ -68,7 +65,12 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
else if (toggleComp.isOn == false && actor.bodyDefTypes.Contains(bodyDefType))
|
||||
{ actor.bodyDefTypes.Remove(bodyDefType); }
|
||||
|
||||
Workspace.Instance.MakeDirty();
|
||||
});
|
||||
|
||||
if (addedNewTag && i == Workspace.sexTypes.Count - 1)
|
||||
{ toggleComp.isOn = true; }
|
||||
}
|
||||
|
||||
Transform _optionField = AddCloneObjectToParent(contentWindow, 1).transform;
|
||||
|
|
|
@ -30,10 +30,10 @@ namespace RimWorldAnimationStudio
|
|||
Debug.Log("Add new body part: " + field.text);
|
||||
Workspace.bodyParts.Add(field.text);
|
||||
|
||||
Initialize();
|
||||
Initialize(null, true);
|
||||
}
|
||||
|
||||
public void Initialize(Actor actor = null)
|
||||
public void Initialize(Actor actor = null, bool addedNewTag = false)
|
||||
{
|
||||
if (actor != null)
|
||||
{ this.actor = actor; }
|
||||
|
@ -68,7 +68,12 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
else if (toggleComp.isOn == false && actor.requiredGenitals.Contains(bodyPart))
|
||||
{ actor.requiredGenitals.Remove(bodyPart); }
|
||||
|
||||
Workspace.Instance.MakeDirty();
|
||||
});
|
||||
|
||||
if (addedNewTag && i == Workspace.sexTypes.Count - 1)
|
||||
{ toggleComp.isOn = true; }
|
||||
}
|
||||
|
||||
Transform _optionField = AddCloneObjectToParent(contentWindow, 1).transform;
|
||||
|
|
|
@ -19,21 +19,18 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public void AddDefName(InputField field)
|
||||
{
|
||||
Debug.Log("Attempting to add new def name");
|
||||
|
||||
if (field?.text == null || field.text == "")
|
||||
{ Debug.LogWarning("Input field is null"); return; }
|
||||
{ return; }
|
||||
|
||||
if (Workspace.defNames.Contains(field.text))
|
||||
{ Debug.LogWarning("Def name is null"); field.text = ""; return; }
|
||||
{ field.text = ""; return; }
|
||||
|
||||
Debug.Log("Added new def name: " + field.text);
|
||||
Workspace.defNames.Add(field.text);
|
||||
|
||||
Initialize();
|
||||
Initialize(null, true);
|
||||
}
|
||||
|
||||
public void Initialize(Actor actor = null)
|
||||
public void Initialize(Actor actor = null, bool addedNewTag = false)
|
||||
{
|
||||
if (actor != null)
|
||||
{ this.actor = actor; }
|
||||
|
@ -68,7 +65,12 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
else if (toggleComp.isOn == false && actor.defNames.Contains(defName))
|
||||
{ actor.defNames.Remove(defName); }
|
||||
|
||||
Workspace.Instance.MakeDirty();
|
||||
});
|
||||
|
||||
if (addedNewTag && i == Workspace.sexTypes.Count - 1)
|
||||
{ toggleComp.isOn = true; }
|
||||
}
|
||||
|
||||
Transform _optionField = AddCloneObjectToParent(contentWindow, 1).transform;
|
||||
|
|
|
@ -15,20 +15,20 @@ namespace RimWorldAnimationStudio
|
|||
Initialize();
|
||||
}
|
||||
|
||||
public void AddBodyPart(InputField field)
|
||||
public void AddInteractionDef(InputField field)
|
||||
{
|
||||
if (field?.text == null || field.text == "")
|
||||
{ return; }
|
||||
|
||||
if (Workspace.bodyParts.Contains(field.text))
|
||||
if (Workspace.interactionDefTypes.Contains(field.text))
|
||||
{ field.text = ""; return; }
|
||||
|
||||
Workspace.interactionDefTypes.Add(field.text);
|
||||
|
||||
Initialize();
|
||||
Initialize(true);
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
public void Initialize(bool addedNewTag = false)
|
||||
{
|
||||
if (Workspace.animationDef == null) return;
|
||||
|
||||
|
@ -57,14 +57,19 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
else if (toggleComp.isOn == false && Workspace.animationDef.interactionDefTypes.Contains(interactionDefType))
|
||||
{ Workspace.animationDef.interactionDefTypes.Remove(interactionDefType); }
|
||||
|
||||
Workspace.Instance.MakeDirty();
|
||||
});
|
||||
|
||||
if (addedNewTag && i == Workspace.sexTypes.Count - 1)
|
||||
{ toggleComp.isOn = true; }
|
||||
}
|
||||
|
||||
Transform _optionField = AddCloneObjectToParent(contentWindow, 1).transform;
|
||||
_optionField.Find("Placeholder").GetComponent<Text>().text = "Enter new interaction def type...";
|
||||
|
||||
InputField fieldComp = _optionField.GetComponent<InputField>();
|
||||
fieldComp.onEndEdit.AddListener(delegate { AddBodyPart(fieldComp); });
|
||||
fieldComp.onEndEdit.AddListener(delegate { AddInteractionDef(fieldComp); });
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
|
|
|
@ -20,15 +20,15 @@ namespace RimWorldAnimationStudio
|
|||
if (field?.text == null || field.text == "")
|
||||
{ return; }
|
||||
|
||||
if (Workspace.bodyParts.Contains(field.text))
|
||||
if (Workspace.sexTypes.Contains(field.text))
|
||||
{ field.text = ""; return; }
|
||||
|
||||
Workspace.sexTypes.Add(field.text);
|
||||
|
||||
Initialize();
|
||||
Initialize(true);
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
public void Initialize(bool addedNewTag = false)
|
||||
{
|
||||
if (Workspace.animationDef == null) return;
|
||||
|
||||
|
@ -41,7 +41,7 @@ namespace RimWorldAnimationStudio
|
|||
Transform contentWindow = transform.FindDeepChild("Content");
|
||||
Reset();
|
||||
|
||||
for (int i = 0; i < Workspace.bodyParts.Count; i++)
|
||||
for (int i = 0; i < Workspace.sexTypes.Count; i++)
|
||||
{
|
||||
string sexType = Workspace.sexTypes[i];
|
||||
|
||||
|
@ -57,7 +57,12 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
else if (toggleComp.isOn == false && Workspace.animationDef.sexTypes.Contains(sexType))
|
||||
{ Workspace.animationDef.sexTypes.Remove(sexType); }
|
||||
|
||||
Workspace.Instance.MakeDirty();
|
||||
});
|
||||
|
||||
if (addedNewTag && i == Workspace.sexTypes.Count - 1)
|
||||
{ toggleComp.isOn = true; }
|
||||
}
|
||||
|
||||
Transform _optionField = AddCloneObjectToParent(contentWindow, 1).transform;
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public void OnMoveStage(int delta)
|
||||
{
|
||||
if (AnimationController.Instance.MoveAnimationStage(transform.GetSiblingIndex(), delta))
|
||||
if (StageCardManager.Instance.MoveAnimationStage(transform.GetSiblingIndex(), delta))
|
||||
{
|
||||
int siblingCount = transform.parent.childCount;
|
||||
int index = Mathf.Clamp(transform.GetSiblingIndex() + delta, 0, siblingCount - 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue