mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
UI 2.0
This commit is contained in:
parent
c3c0a05ac0
commit
3d859555ad
324 changed files with 13886 additions and 7446 deletions
|
@ -45,8 +45,8 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
if (type == LogType.Warning)
|
||||
{
|
||||
currentMessage.color = Constants.ColorOrange;
|
||||
logMessage.color = Constants.ColorOrange;
|
||||
currentMessage.color = Constants.ColorRichOrange;
|
||||
logMessage.color = Constants.ColorRichOrange;
|
||||
}
|
||||
|
||||
else if (type == LogType.Exception || type == LogType.Error)
|
||||
|
|
|
@ -50,10 +50,17 @@ namespace RimWorldAnimationStudio
|
|||
customTags.Add(field.text);
|
||||
|
||||
ApplicationManager.Instance.SaveCustomArrays();
|
||||
|
||||
Initialize(true);
|
||||
}
|
||||
|
||||
public void RemoveCustomTag(ref List<string> customTags, string tag)
|
||||
{
|
||||
customTags.Remove(tag);
|
||||
|
||||
ApplicationManager.Instance.SaveCustomArrays();
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public void AddCustomRace(InputField field)
|
||||
{
|
||||
if (field?.text == null || field.text == "")
|
||||
|
@ -62,7 +69,6 @@ namespace RimWorldAnimationStudio
|
|||
AlienRaceDefs.AddDef(new AlienRaceDef(field.text));
|
||||
|
||||
ApplicationManager.Instance.SaveAlienRaceDefs();
|
||||
|
||||
Initialize(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public override void Initialize(bool addedNewTag = false)
|
||||
{
|
||||
Debug.Log("Init");
|
||||
|
||||
Reset();
|
||||
|
||||
AlienRaceDef alienRaceDef = GetCurrentRaceDef();
|
||||
|
|
|
@ -39,6 +39,13 @@ namespace RimWorldAnimationStudio
|
|||
Workspace.Instance.RecordEvent("Actor bodyDef type");
|
||||
});
|
||||
|
||||
if (CustomTags.bodyDefTypes.Contains(tag))
|
||||
{
|
||||
Button deleteButton = _optionToggle.Find("DeleteButton").GetComponent<Button>();
|
||||
deleteButton.gameObject.SetActive(true);
|
||||
deleteButton.onClick.AddListener(delegate { RemoveCustomTag(ref CustomTags.bodyDefTypes, tag); });
|
||||
}
|
||||
|
||||
if (addedNewTag && i == allTags.Count() - 1)
|
||||
{ toggleComp.isOn = true; }
|
||||
}
|
||||
|
|
|
@ -53,6 +53,13 @@ namespace RimWorldAnimationStudio
|
|||
Workspace.Instance.RecordEvent("Actor required body part");
|
||||
});
|
||||
|
||||
if (CustomTags.bodyParts.Contains(tag))
|
||||
{
|
||||
Button deleteButton = _optionToggle.Find("DeleteButton").GetComponent<Button>();
|
||||
deleteButton.gameObject.SetActive(true);
|
||||
deleteButton.onClick.AddListener(delegate { RemoveCustomTag(ref CustomTags.bodyParts, tag); });
|
||||
}
|
||||
|
||||
if (addedNewTag && i == allTags.Count() - 1)
|
||||
{ toggleComp.isOn = true; }
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -40,16 +40,11 @@ namespace RimWorldAnimationStudio
|
|||
Workspace.Instance.RecordEvent("Animation InteractionDef");
|
||||
});
|
||||
|
||||
Button deleteButton = _optionToggle.Find("DeleteButton").GetComponent<Button>();
|
||||
if (deleteButton != null && CustomTags.interactionDefTypes.Contains(tag))
|
||||
if (CustomTags.interactionDefTypes.Contains(tag))
|
||||
{
|
||||
Button deleteButton = _optionToggle.Find("DeleteButton").GetComponent<Button>();
|
||||
deleteButton.gameObject.SetActive(true);
|
||||
deleteButton.onClick.AddListener(delegate
|
||||
{
|
||||
CustomTags.interactionDefTypes.Remove(tag);
|
||||
ApplicationManager.Instance.SaveCustomArrays();
|
||||
Initialize();
|
||||
});
|
||||
deleteButton.onClick.AddListener(delegate { RemoveCustomTag(ref CustomTags.interactionDefTypes, tag); });
|
||||
}
|
||||
|
||||
if (addedNewTag && i == allTags.Count() - 1)
|
||||
|
|
|
@ -40,6 +40,13 @@ namespace RimWorldAnimationStudio
|
|||
Workspace.Instance.RecordEvent("Animation sex type");
|
||||
});
|
||||
|
||||
if (CustomTags.sexTypes.Contains(tag))
|
||||
{
|
||||
Button deleteButton = _optionToggle.Find("DeleteButton").GetComponent<Button>();
|
||||
deleteButton.gameObject.SetActive(true);
|
||||
deleteButton.onClick.AddListener(delegate { RemoveCustomTag(ref CustomTags.sexTypes, tag); });
|
||||
}
|
||||
|
||||
if (addedNewTag && i == allTags.Count() - 1)
|
||||
{ toggleComp.isOn = true; }
|
||||
}
|
||||
|
|
|
@ -39,10 +39,17 @@ namespace RimWorldAnimationStudio
|
|||
Workspace.Instance.RecordEvent("Keyframe sound effect");
|
||||
});
|
||||
|
||||
toggleComp.group = contentWindow.GetComponent<ToggleGroup>();
|
||||
if (CustomTags.soundDefs.Contains(tag))
|
||||
{
|
||||
Button deleteButton = _optionToggle.Find("DeleteButton").GetComponent<Button>();
|
||||
deleteButton.gameObject.SetActive(true);
|
||||
deleteButton.onClick.AddListener(delegate { RemoveCustomTag(ref CustomTags.soundDefs, tag); });
|
||||
}
|
||||
|
||||
if (addedNewTag && i == allTags.Count() - 1)
|
||||
{ toggleComp.isOn = true; }
|
||||
|
||||
toggleComp.group = contentWindow.GetComponent<ToggleGroup>();
|
||||
}
|
||||
|
||||
Transform _optionField = AddCloneObjectToParent(contentWindow, 1).transform;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue