Code refactor

This commit is contained in:
AbstractConcept 2022-10-27 00:56:04 -05:00
parent cd4711a8e5
commit 757badf4f6
517 changed files with 2534 additions and 2221 deletions

View file

@ -12,7 +12,7 @@ namespace RimWorldAnimationStudio
{
public override void Initialize(bool addedNewTag = false)
{
IEnumerable<string> allTags = Tags.soundDefs.Concat(CustomTags.soundDefs);
IEnumerable<string> allTags = DefaultTags.soundDefs.Concat(CustomTags.soundDefs);
string placeHolderText = "Enter new sound def...";
if (Workspace.animationDef == null) return;
@ -28,15 +28,15 @@ namespace RimWorldAnimationStudio
_optionToggle.Find("Text").GetComponent<Text>().text = tag;
Toggle toggleComp = _optionToggle.GetComponent<Toggle>();
toggleComp.isOn = Workspace.Instance.GetCurrentOrPreviousKeyframe(Workspace.actorID)?.soundEffect == tag;
toggleComp.isOn = Workspace.GetCurrentOrPreviousKeyframe(Workspace.ActorID)?.SoundEffect == tag;
toggleComp.onValueChanged.AddListener(delegate
{
PawnKeyframe keyframe = Workspace.Instance.GetCurrentOrPreviousKeyframe(Workspace.actorID);
PawnKeyframe keyframe = Workspace.GetCurrentOrPreviousKeyframe(Workspace.ActorID);
if (keyframe != null)
{ keyframe.soundEffect = tag; }
{ keyframe.SoundEffect = tag; }
Workspace.Instance.RecordEvent("Keyframe sound effect");
Workspace.RecordEvent("Keyframe sound effect");
});
if (CustomTags.soundDefs.Contains(tag))
@ -56,7 +56,7 @@ namespace RimWorldAnimationStudio
_optionField.Find("Placeholder").GetComponent<Text>().text = placeHolderText;
InputField fieldComp = _optionField.GetComponent<InputField>();
fieldComp.onEndEdit.AddListener(delegate { AddCustomTag(fieldComp, ref Tags.soundDefs, ref CustomTags.soundDefs); });
fieldComp.onEndEdit.AddListener(delegate { AddCustomTag(fieldComp, ref DefaultTags.soundDefs, ref CustomTags.soundDefs); });
}
public void Reset()