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
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue