This commit is contained in:
AbstractConcept 2022-10-12 00:22:29 -05:00
parent c3c0a05ac0
commit 3d859555ad
324 changed files with 13886 additions and 7446 deletions

View file

@ -12,7 +12,7 @@ namespace RimWorldAnimationStudio
{
public override void Initialize(bool addedNewTag = false)
{
IEnumerable<string> allTags = AlienRaceDefs.allDefs.Select(x => x.defName);
IEnumerable<string> allTags = Tags.defNames.Concat(CustomTags.defNames);
string placeHolderText = "Enter new def name...";
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
@ -39,6 +39,13 @@ namespace RimWorldAnimationStudio
Workspace.Instance.RecordEvent("Actor def name");
});
if (CustomTags.defNames.Contains(tag))
{
Button deleteButton = _optionToggle.Find("DeleteButton").GetComponent<Button>();
deleteButton.gameObject.SetActive(true);
deleteButton.onClick.AddListener(delegate { RemoveCustomTag(ref CustomTags.defNames, tag); });
}
if (addedNewTag && i == allTags.Count() - 1)
{ toggleComp.isOn = true; }
}
@ -47,7 +54,11 @@ namespace RimWorldAnimationStudio
_optionField.Find("Placeholder").GetComponent<Text>().text = placeHolderText;
InputField fieldComp = _optionField.GetComponent<InputField>();
fieldComp.onEndEdit.AddListener(delegate { AddCustomRace(fieldComp); });
fieldComp.onEndEdit.AddListener(delegate
{
AddCustomTag(fieldComp, ref Tags.defNames, ref CustomTags.defNames);
AddCustomRace(fieldComp);
});
}
public void Reset()