mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Code refactor
This commit is contained in:
parent
cd4711a8e5
commit
757badf4f6
517 changed files with 2534 additions and 2221 deletions
|
@ -67,9 +67,9 @@ namespace RimWorldAnimationStudio
|
|||
if (field?.text == null || field.text == "")
|
||||
{ return; }
|
||||
|
||||
AlienRaceDefs.AddDef(new AlienRaceDef(field.text));
|
||||
PawnRaceDefs.AddDef(new PawnRaceDef(field.text));
|
||||
|
||||
ApplicationManager.Instance.SaveAlienRaceDefs();
|
||||
ApplicationManager.Instance.SavePawnRaceDefs();
|
||||
Initialize(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,21 +21,21 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
Reset();
|
||||
|
||||
AlienRaceDef alienRaceDef = GetCurrentRaceDef();
|
||||
if (alienRaceDef == null) return;
|
||||
PawnRaceDef pawnRaceDef = GetCurrentRaceDef();
|
||||
if (pawnRaceDef == null) return;
|
||||
|
||||
isHumanoidToggle.SetIsOnWithoutNotify(alienRaceDef.isHumanoid);
|
||||
isHumanoidToggle.SetIsOnWithoutNotify(pawnRaceDef.isHumanoid);
|
||||
|
||||
Text bodyGraphicsTitle = AddCloneObjectToParent(raceSettingsWindow, 2).GetComponent<Text>();
|
||||
bodyGraphicsTitle.text = "Body graphic filepaths";
|
||||
|
||||
List<string> allTags = alienRaceDef.isHumanoid ? Tags.bodyTypes : new List<string>() { "None" };
|
||||
List<string> allTags = pawnRaceDef.isHumanoid ? DefaultTags.bodyTypes : new List<string>() { "None" };
|
||||
|
||||
foreach (string bodyType in allTags)
|
||||
{
|
||||
string _bodyType = bodyType;
|
||||
|
||||
if (alienRaceDef.isHumanoid)
|
||||
if (pawnRaceDef.isHumanoid)
|
||||
{
|
||||
Text bodyTypeTitle = AddCloneObjectToParent(raceSettingsWindow, 2).GetComponent<Text>();
|
||||
bodyTypeTitle.text = bodyType;
|
||||
|
@ -49,15 +49,15 @@ namespace RimWorldAnimationStudio
|
|||
filepath.GetComponent<Text>().text = facing.ToString();
|
||||
filepath.transform.Find("FilepathButton").GetComponent<Button>().onClick.AddListener(delegate
|
||||
{
|
||||
SetBodyTypeGraphicPath(alienRaceDef, facing, _bodyType);
|
||||
SetBodyTypeGraphicPath(pawnRaceDef, facing, _bodyType);
|
||||
});
|
||||
filepath.transform.FindDeepChild("FilepathLabel").GetComponent<Text>().text = alienRaceDef.GetBodyTypeGraphicPath(facing, _bodyType);
|
||||
filepath.transform.FindDeepChild("FilepathLabel").GetComponent<Text>().text = pawnRaceDef.GetBodyTypeGraphicPath(facing, _bodyType);
|
||||
}
|
||||
|
||||
AddCloneObjectToParent(raceSettingsWindow, 3);
|
||||
}
|
||||
|
||||
if (alienRaceDef.isHumanoid)
|
||||
if (pawnRaceDef.isHumanoid)
|
||||
{
|
||||
Text headGraphics = AddCloneObjectToParent(raceSettingsWindow, 2).GetComponent<Text>();
|
||||
headGraphics.text = "Head graphic filepaths";
|
||||
|
@ -70,15 +70,15 @@ namespace RimWorldAnimationStudio
|
|||
filepath.GetComponent<Text>().text = facing.ToString();
|
||||
filepath.transform.Find("FilepathButton").GetComponent<Button>().onClick.AddListener(delegate
|
||||
{
|
||||
SetHeadGraphicPath(alienRaceDef, facing);
|
||||
SetHeadGraphicPath(pawnRaceDef, facing);
|
||||
});
|
||||
filepath.transform.FindDeepChild("FilepathLabel").GetComponent<Text>().text = alienRaceDef.GetHeadGraphicPath(facing);
|
||||
filepath.transform.FindDeepChild("FilepathLabel").GetComponent<Text>().text = pawnRaceDef.GetHeadGraphicPath(facing);
|
||||
}
|
||||
|
||||
AddCloneObjectToParent(raceSettingsWindow, 3);
|
||||
}
|
||||
|
||||
scaleField.text = string.Format("{0:0.000}", alienRaceDef.scale.ToString());
|
||||
scaleField.text = string.Format("{0:0.000}", pawnRaceDef.scale.ToString());
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
|
@ -88,53 +88,53 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public void SetIsHumanoid()
|
||||
{
|
||||
AlienRaceDef alienRaceDef = GetCurrentRaceDef();
|
||||
if (alienRaceDef == null) return;
|
||||
PawnRaceDef pawnRaceDef = GetCurrentRaceDef();
|
||||
if (pawnRaceDef == null) return;
|
||||
|
||||
alienRaceDef.isHumanoid = isHumanoidToggle.isOn;
|
||||
pawnRaceDef.isHumanoid = isHumanoidToggle.isOn;
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public void SetHeadGraphicPath(AlienRaceDef alienRaceDef, CardinalDirection direction)
|
||||
public void SetHeadGraphicPath(PawnRaceDef pawnRaceDef, CardinalDirection direction)
|
||||
{
|
||||
var paths = StandaloneFileBrowser.OpenFilePanel("Select texture File", "", "png", false);
|
||||
|
||||
if (paths == null || paths.Any() == false || File.Exists(paths[0]) == false)
|
||||
{ Debug.LogWarning("Selected file was null or invalid"); return; }
|
||||
|
||||
alienRaceDef.SetHeadGraphicPath(paths[0], direction);
|
||||
pawnRaceDef.SetHeadGraphicPath(paths[0], direction);
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public void SetBodyTypeGraphicPath(AlienRaceDef alienRaceDef, CardinalDirection direction, string bodyType)
|
||||
public void SetBodyTypeGraphicPath(PawnRaceDef pawnRaceDef, CardinalDirection direction, string bodyType)
|
||||
{
|
||||
var paths = StandaloneFileBrowser.OpenFilePanel("Select texture File", "", "png", false);
|
||||
|
||||
if (paths == null || paths.Any() == false || File.Exists(paths[0]) == false)
|
||||
{ Debug.LogWarning("Selected file was null or invalid"); return; }
|
||||
|
||||
alienRaceDef.SetBodyTypeGraphicPath(paths[0], direction, bodyType);
|
||||
pawnRaceDef.SetBodyTypeGraphicPath(paths[0], direction, bodyType);
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public AlienRaceDef GetCurrentRaceDef()
|
||||
public PawnRaceDef GetCurrentRaceDef()
|
||||
{
|
||||
string alienRaceDefName = raceSelectDropdown.value < raceSelectDropdown.options.Count ? raceSelectDropdown.options[raceSelectDropdown.value].text : "Human";
|
||||
if (alienRaceDefName == null || alienRaceDefName == "") alienRaceDefName = "Human";
|
||||
string pawnRaceDefName = raceSelectDropdown.value < raceSelectDropdown.options.Count ? raceSelectDropdown.options[raceSelectDropdown.value].text : "Human";
|
||||
if (pawnRaceDefName == null || pawnRaceDefName == "") pawnRaceDefName = "Human";
|
||||
|
||||
return AlienRaceDefs.GetNamed(alienRaceDefName);
|
||||
return PawnRaceDefs.GetNamed(pawnRaceDefName);
|
||||
}
|
||||
|
||||
public void SetRaceScale()
|
||||
{
|
||||
AlienRaceDef alienRaceDef = GetCurrentRaceDef();
|
||||
if (alienRaceDef == null) return;
|
||||
PawnRaceDef pawnRaceDef = GetCurrentRaceDef();
|
||||
if (pawnRaceDef == null) return;
|
||||
|
||||
float scale = float.Parse(scaleField.text);
|
||||
alienRaceDef.scale = Mathf.Clamp(scale, 0.05f, 100f);
|
||||
pawnRaceDef.scale = Mathf.Clamp(scale, 0.05f, 100f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,11 +33,11 @@ namespace RimWorldAnimationStudio
|
|||
public override void Initialize(bool addedNewTag = false)
|
||||
{
|
||||
if (Workspace.animationDef == null) return;
|
||||
PawnAnimationClip clip = Workspace.animationDef.animationStages[Workspace.stageID].animationClips[Workspace.actorID];
|
||||
PawnAnimationClip clip = Workspace.GetCurrentPawnAnimationClip();
|
||||
|
||||
if (clip?.GetActorAddon("left hand") != null)
|
||||
{
|
||||
switch (clip.GetActorAddon("left hand").anchorName)
|
||||
switch (clip.GetActorAddon("left hand").AnchorName)
|
||||
{
|
||||
case "torso": handLeftAnchor.value = 1; break;
|
||||
case "head": handLeftAnchor.value = 2; break;
|
||||
|
@ -50,7 +50,7 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
if (clip?.GetActorAddon("right hand") != null)
|
||||
{
|
||||
switch (clip.GetActorAddon("right hand").anchorName)
|
||||
switch (clip.GetActorAddon("right hand").AnchorName)
|
||||
{
|
||||
case "torso": handRightAnchor.value = 1; break;
|
||||
case "head": handRightAnchor.value = 2; break;
|
||||
|
@ -63,7 +63,7 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
if (clip?.GetActorAddon("dildo") != null)
|
||||
{
|
||||
switch (clip.GetActorAddon("dildo").anchorName)
|
||||
switch (clip.GetActorAddon("dildo").AnchorName)
|
||||
{
|
||||
case "torso": sexToyAnchor.value = 1; break;
|
||||
case "head": sexToyAnchor.value = 2; break;
|
||||
|
@ -76,20 +76,20 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
if (clip?.GetActorAddon("left hand") != null)
|
||||
{
|
||||
handLeftLayer.value = handLeftLayer.options.IndexOf(handLeftLayer.options.First(x => x.text == clip.GetActorAddon("left hand").layer));
|
||||
handLeftAnchoringPawn.text = clip.GetActorAddon("left hand").anchoringActor.ToString();
|
||||
handLeftLayer.value = handLeftLayer.options.IndexOf(handLeftLayer.options.First(x => x.text == clip.GetActorAddon("left hand").Layer));
|
||||
handLeftAnchoringPawn.text = clip.GetActorAddon("left hand").AnchoringActor.ToString();
|
||||
}
|
||||
|
||||
if (clip?.GetActorAddon("right hand") != null)
|
||||
{
|
||||
handRightLayer.value = handRightLayer.options.IndexOf(handRightLayer.options.First(x => x.text == clip.GetActorAddon("right hand").layer));
|
||||
handRightAnchoringPawn.text = clip.GetActorAddon("right hand").anchoringActor.ToString();
|
||||
handRightLayer.value = handRightLayer.options.IndexOf(handRightLayer.options.First(x => x.text == clip.GetActorAddon("right hand").Layer));
|
||||
handRightAnchoringPawn.text = clip.GetActorAddon("right hand").AnchoringActor.ToString();
|
||||
}
|
||||
|
||||
if (clip?.GetActorAddon("dildo") != null)
|
||||
{
|
||||
sexToyLayer.value = sexToyLayer.options.IndexOf(sexToyLayer.options.First(x => x.text == clip.GetActorAddon("dildo").layer));
|
||||
sexToyAnchoringPawn.text = clip.GetActorAddon("dildo").anchoringActor.ToString();
|
||||
sexToyLayer.value = sexToyLayer.options.IndexOf(sexToyLayer.options.First(x => x.text == clip.GetActorAddon("dildo").Layer));
|
||||
sexToyAnchoringPawn.text = clip.GetActorAddon("dildo").AnchoringActor.ToString();
|
||||
}
|
||||
|
||||
handLeftToggle.isOn = clip.IsActorAddonVisible("left hand");
|
||||
|
@ -103,7 +103,7 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public void OnToggleChanged()
|
||||
{
|
||||
PawnAnimationClip clip = Workspace.animationDef.animationStages[Workspace.stageID].animationClips[Workspace.actorID];
|
||||
PawnAnimationClip clip = Workspace.GetCurrentPawnAnimationClip();
|
||||
|
||||
clip.ShowOrHideActorAddon("left hand", handLeftToggle.isOn);
|
||||
clip.ShowOrHideActorAddon("right hand", handRightToggle.isOn);
|
||||
|
@ -114,18 +114,18 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public void OnValueChanged()
|
||||
{
|
||||
PawnAnimationClip clip = Workspace.animationDef.animationStages[Workspace.stageID].animationClips[Workspace.actorID];
|
||||
PawnAnimationClip clip = Workspace.GetCurrentPawnAnimationClip();
|
||||
|
||||
if (clip?.GetActorAddon("left hand") != null)
|
||||
{
|
||||
switch (handLeftAnchor.value)
|
||||
{
|
||||
case 1: clip.GetActorAddon("left hand").anchorName = "torso"; break;
|
||||
case 2: clip.GetActorAddon("left hand").anchorName = "head"; break;
|
||||
case 3: clip.GetActorAddon("left hand").anchorName = "groin"; break;
|
||||
case 4: clip.GetActorAddon("left hand").anchorName = "left breast"; break;
|
||||
case 5: clip.GetActorAddon("left hand").anchorName = "right breast"; break;
|
||||
default: clip.GetActorAddon("left hand").anchorName = null; break;
|
||||
case 1: clip.GetActorAddon("left hand").AnchorName = "torso"; break;
|
||||
case 2: clip.GetActorAddon("left hand").AnchorName = "head"; break;
|
||||
case 3: clip.GetActorAddon("left hand").AnchorName = "groin"; break;
|
||||
case 4: clip.GetActorAddon("left hand").AnchorName = "left breast"; break;
|
||||
case 5: clip.GetActorAddon("left hand").AnchorName = "right breast"; break;
|
||||
default: clip.GetActorAddon("left hand").AnchorName = null; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -133,12 +133,12 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
switch (handRightAnchor.value)
|
||||
{
|
||||
case 1: clip.GetActorAddon("right hand").anchorName = "torso"; break;
|
||||
case 2: clip.GetActorAddon("right hand").anchorName = "head"; break;
|
||||
case 3: clip.GetActorAddon("right hand").anchorName = "groin"; break;
|
||||
case 4: clip.GetActorAddon("right hand").anchorName = "left breast"; break;
|
||||
case 5: clip.GetActorAddon("right hand").anchorName = "right breast"; break;
|
||||
default: clip.GetActorAddon("right hand").anchorName = null; break;
|
||||
case 1: clip.GetActorAddon("right hand").AnchorName = "torso"; break;
|
||||
case 2: clip.GetActorAddon("right hand").AnchorName = "head"; break;
|
||||
case 3: clip.GetActorAddon("right hand").AnchorName = "groin"; break;
|
||||
case 4: clip.GetActorAddon("right hand").AnchorName = "left breast"; break;
|
||||
case 5: clip.GetActorAddon("right hand").AnchorName = "right breast"; break;
|
||||
default: clip.GetActorAddon("right hand").AnchorName = null; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,12 +146,12 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
switch (sexToyAnchor.value)
|
||||
{
|
||||
case 1: clip.GetActorAddon("dildo").anchorName = "torso"; break;
|
||||
case 2: clip.GetActorAddon("dildo").anchorName = "head"; break;
|
||||
case 3: clip.GetActorAddon("dildo").anchorName = "groin"; break;
|
||||
case 4: clip.GetActorAddon("dildo").anchorName = "left breast"; break;
|
||||
case 5: clip.GetActorAddon("dildo").anchorName = "right breast"; break;
|
||||
default: clip.GetActorAddon("dildo").anchorName = null; break;
|
||||
case 1: clip.GetActorAddon("dildo").AnchorName = "torso"; break;
|
||||
case 2: clip.GetActorAddon("dildo").AnchorName = "head"; break;
|
||||
case 3: clip.GetActorAddon("dildo").AnchorName = "groin"; break;
|
||||
case 4: clip.GetActorAddon("dildo").AnchorName = "left breast"; break;
|
||||
case 5: clip.GetActorAddon("dildo").AnchorName = "right breast"; break;
|
||||
default: clip.GetActorAddon("dildo").AnchorName = null; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,32 +160,32 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public void OnLayerChanged()
|
||||
{
|
||||
PawnAnimationClip clip = Workspace.animationDef.animationStages[Workspace.stageID].animationClips[Workspace.actorID];
|
||||
PawnAnimationClip clip = Workspace.GetCurrentPawnAnimationClip();
|
||||
|
||||
if (clip?.GetActorAddon("left hand") != null)
|
||||
{ clip.GetActorAddon("left hand").layer = handLeftLayer.options[handLeftLayer.value].text; }
|
||||
{ clip.GetActorAddon("left hand").Layer = handLeftLayer.options[handLeftLayer.value].text; }
|
||||
|
||||
if (clip?.GetActorAddon("right hand") != null)
|
||||
{ clip.GetActorAddon("right hand").layer = handRightLayer.options[handRightLayer.value].text; }
|
||||
{ clip.GetActorAddon("right hand").Layer = handRightLayer.options[handRightLayer.value].text; }
|
||||
|
||||
if (clip?.GetActorAddon("dildo") != null)
|
||||
{ clip.GetActorAddon("dildo").layer = sexToyLayer.options[sexToyLayer.value].text; }
|
||||
{ clip.GetActorAddon("dildo").Layer = sexToyLayer.options[sexToyLayer.value].text; }
|
||||
|
||||
//Initialize();
|
||||
}
|
||||
|
||||
public void OnAnchoringPawnChanged()
|
||||
{
|
||||
PawnAnimationClip clip = Workspace.animationDef.animationStages[Workspace.stageID].animationClips[Workspace.actorID];
|
||||
PawnAnimationClip clip = Workspace.GetCurrentPawnAnimationClip();
|
||||
|
||||
if (clip?.GetActorAddon("left hand") != null)
|
||||
{
|
||||
int i = int.Parse(handLeftAnchoringPawn.text);
|
||||
|
||||
if (i < 0) { i = clip.GetOwningActorID(); }
|
||||
i = Mathf.Clamp(i, 0, Workspace.animationDef.actors.Count - 1);
|
||||
i = Mathf.Clamp(i, 0, Workspace.animationDef.Actors.Count - 1);
|
||||
|
||||
clip.GetActorAddon("left hand").anchoringActor = i;
|
||||
clip.GetActorAddon("left hand").AnchoringActor = i;
|
||||
handLeftAnchoringPawn.SetTextWithoutNotify(i.ToString());
|
||||
}
|
||||
|
||||
|
@ -194,9 +194,9 @@ namespace RimWorldAnimationStudio
|
|||
int i = int.Parse(handRightAnchoringPawn.text);
|
||||
|
||||
if (i < 0) { i = clip.GetOwningActorID(); }
|
||||
i = Mathf.Clamp(i, 0, Workspace.animationDef.actors.Count - 1);
|
||||
i = Mathf.Clamp(i, 0, Workspace.animationDef.Actors.Count - 1);
|
||||
|
||||
clip.GetActorAddon("right hand").anchoringActor = i;
|
||||
clip.GetActorAddon("right hand").AnchoringActor = i;
|
||||
handRightAnchoringPawn.SetTextWithoutNotify(i.ToString());
|
||||
}
|
||||
|
||||
|
@ -205,9 +205,9 @@ namespace RimWorldAnimationStudio
|
|||
int i = int.Parse(sexToyAnchoringPawn.text);
|
||||
|
||||
if (i < 0) { i = clip.GetOwningActorID(); }
|
||||
i = Mathf.Clamp(i, 0, Workspace.animationDef.actors.Count - 1);
|
||||
i = Mathf.Clamp(i, 0, Workspace.animationDef.Actors.Count - 1);
|
||||
|
||||
clip.GetActorAddon("dildo").anchoringActor = i;
|
||||
clip.GetActorAddon("dildo").AnchoringActor = i;
|
||||
sexToyAnchoringPawn.SetTextWithoutNotify(i.ToString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,23 +17,23 @@ namespace RimWorldAnimationStudio
|
|||
Transform contentWindow = transform.FindDeepChild("Content");
|
||||
Reset();
|
||||
|
||||
for (int i = 0; i < Tags.actorLayers.Count; i++)
|
||||
for (int i = 0; i < DefaultTags.actorLayers.Count; i++)
|
||||
{
|
||||
string actorLayer = Tags.actorLayers[i];
|
||||
string actorLayer = DefaultTags.actorLayers[i];
|
||||
|
||||
Transform _optionToggle = AddCloneObjectToParent(contentWindow).transform;
|
||||
_optionToggle.Find("Text").GetComponent<Text>().text = actorLayer;
|
||||
|
||||
Toggle toggleComp = _optionToggle.GetComponent<Toggle>();
|
||||
toggleComp.isOn = Workspace.Instance.GetCurrentPawnAnimationClip().layer == actorLayer;
|
||||
toggleComp.isOn = Workspace.GetCurrentPawnAnimationClip().Layer == actorLayer;
|
||||
toggleComp.onValueChanged.AddListener(delegate {
|
||||
|
||||
PawnAnimationClip clip = Workspace.Instance.GetCurrentPawnAnimationClip();
|
||||
PawnAnimationClip clip = Workspace.GetCurrentPawnAnimationClip();
|
||||
|
||||
if (clip != null)
|
||||
{ clip.layer = actorLayer; }
|
||||
{ clip.Layer = actorLayer; }
|
||||
|
||||
Workspace.Instance.RecordEvent("Actor layer set");
|
||||
Workspace.RecordEvent("Actor layer set");
|
||||
});
|
||||
|
||||
toggleComp.group = contentWindow.GetComponent<ToggleGroup>();
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public class SelectAnimationDialog : DialogBox
|
||||
{
|
||||
public void Initialize(Defs defs)
|
||||
public void Initialize(AnimationDefs defs)
|
||||
{
|
||||
Transform contentWindow = transform.FindDeepChild("Content");
|
||||
Reset();
|
||||
|
@ -20,7 +20,7 @@ namespace RimWorldAnimationStudio
|
|||
AnimationDef animationDef = defs.animationDefs[i];
|
||||
|
||||
Transform _optionButton = AddCloneObjectToParent(contentWindow).transform;
|
||||
_optionButton.Find("Text").GetComponent<Text>().text = animationDef.defName;
|
||||
_optionButton.Find("Text").GetComponent<Text>().text = animationDef.DefName;
|
||||
|
||||
Button buttonComp = _optionButton.GetComponent<Button>();
|
||||
buttonComp.onClick.AddListener(delegate { Pop(); ApplicationManager.Instance.LoadAnimation(animationDef); });
|
||||
|
|
|
@ -12,10 +12,10 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public override void Initialize(bool addedNewTag = false)
|
||||
{
|
||||
IEnumerable<string> allTags = Tags.bodyDefTypes.Concat(CustomTags.bodyDefTypes);
|
||||
IEnumerable<string> allTags = DefaultTags.bodyDefTypes.Concat(CustomTags.bodyDefTypes);
|
||||
string placeHolderText = "Enter new body def type...";
|
||||
|
||||
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
|
||||
Actor actor = Workspace.animationDef.Actors[Workspace.ActorID];
|
||||
Transform contentWindow = transform.FindDeepChild("Content");
|
||||
Reset();
|
||||
|
||||
|
@ -27,16 +27,16 @@ namespace RimWorldAnimationStudio
|
|||
_optionToggle.Find("Text").GetComponent<Text>().text = tag;
|
||||
|
||||
Toggle toggleComp = _optionToggle.GetComponent<Toggle>();
|
||||
toggleComp.isOn = actor.bodyDefTypes.Contains(tag);
|
||||
toggleComp.isOn = actor.BodyDefTypes.Contains(tag);
|
||||
toggleComp.onValueChanged.AddListener(delegate
|
||||
{
|
||||
if (toggleComp.isOn && actor.bodyDefTypes.Contains(tag) == false)
|
||||
{ actor.bodyDefTypes.Add(tag); }
|
||||
if (toggleComp.isOn && actor.BodyDefTypes.Contains(tag) == false)
|
||||
{ actor.BodyDefTypes.Add(tag); }
|
||||
|
||||
else if (toggleComp.isOn == false && actor.bodyDefTypes.Contains(tag))
|
||||
{ actor.bodyDefTypes.Remove(tag); }
|
||||
else if (toggleComp.isOn == false && actor.BodyDefTypes.Contains(tag))
|
||||
{ actor.BodyDefTypes.Remove(tag); }
|
||||
|
||||
Workspace.Instance.RecordEvent("Actor bodyDef type");
|
||||
Workspace.RecordEvent("Actor bodyDef type");
|
||||
});
|
||||
|
||||
if (CustomTags.bodyDefTypes.Contains(tag))
|
||||
|
@ -54,7 +54,7 @@ namespace RimWorldAnimationStudio
|
|||
_optionField.Find("Placeholder").GetComponent<Text>().text = placeHolderText;
|
||||
|
||||
InputField fieldComp = _optionField.GetComponent<InputField>();
|
||||
fieldComp.onEndEdit.AddListener(delegate { AddCustomTag(fieldComp, ref Tags.bodyDefTypes, ref CustomTags.bodyDefTypes); });
|
||||
fieldComp.onEndEdit.AddListener(delegate { AddCustomTag(fieldComp, ref DefaultTags.bodyDefTypes, ref CustomTags.bodyDefTypes); });
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
|
|
|
@ -12,10 +12,10 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public override void Initialize(bool addedNewTag = false)
|
||||
{
|
||||
IEnumerable<string> allTags = Tags.bodyParts.Concat(CustomTags.bodyParts);
|
||||
IEnumerable<string> allTags = DefaultTags.bodyParts.Concat(CustomTags.bodyParts);
|
||||
string placeHolderText = "Enter new body part name...";
|
||||
|
||||
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
|
||||
Actor actor = Workspace.animationDef.Actors[Workspace.ActorID];
|
||||
Transform contentWindow = transform.FindDeepChild("Content");
|
||||
Reset();
|
||||
|
||||
|
@ -23,15 +23,15 @@ namespace RimWorldAnimationStudio
|
|||
_appendageToggle.Find("Text").GetComponent<Text>().text = "Any appendage";
|
||||
|
||||
Toggle appendageToggleComp = _appendageToggle.GetComponent<Toggle>();
|
||||
appendageToggleComp.isOn = actor.isFucking;
|
||||
appendageToggleComp.onValueChanged.AddListener(delegate { actor.isFucking = appendageToggleComp.isOn; Workspace.Instance.RecordEvent("Actor required body part");});
|
||||
appendageToggleComp.isOn = actor.IsFucking;
|
||||
appendageToggleComp.onValueChanged.AddListener(delegate { actor.IsFucking = appendageToggleComp.isOn; Workspace.RecordEvent("Actor required body part");});
|
||||
|
||||
Transform _orificeToggle = AddCloneObjectToParent(contentWindow).transform;
|
||||
_orificeToggle.Find("Text").GetComponent<Text>().text = "Any orifice";
|
||||
|
||||
Toggle orificeToggleComp = _orificeToggle.GetComponent<Toggle>();
|
||||
orificeToggleComp.isOn = actor.isFucked;
|
||||
orificeToggleComp.onValueChanged.AddListener(delegate { actor.isFucked = orificeToggleComp.isOn; Workspace.Instance.RecordEvent("Actor required body part"); });
|
||||
orificeToggleComp.isOn = actor.IsFucked;
|
||||
orificeToggleComp.onValueChanged.AddListener(delegate { actor.IsFucked = orificeToggleComp.isOn; Workspace.RecordEvent("Actor required body part"); });
|
||||
|
||||
for (int i = 0; i < allTags.Count(); i++)
|
||||
{
|
||||
|
@ -41,16 +41,16 @@ namespace RimWorldAnimationStudio
|
|||
_optionToggle.Find("Text").GetComponent<Text>().text = tag;
|
||||
|
||||
Toggle toggleComp = _optionToggle.GetComponent<Toggle>();
|
||||
toggleComp.isOn = actor.requiredGenitals.Contains(tag);
|
||||
toggleComp.isOn = actor.RequiredGenitals.Contains(tag);
|
||||
toggleComp.onValueChanged.AddListener(delegate
|
||||
{
|
||||
if (toggleComp.isOn && actor.requiredGenitals.Contains(tag) == false)
|
||||
{ actor.requiredGenitals.Add(tag); }
|
||||
if (toggleComp.isOn && actor.RequiredGenitals.Contains(tag) == false)
|
||||
{ actor.RequiredGenitals.Add(tag); }
|
||||
|
||||
else if (toggleComp.isOn == false && actor.requiredGenitals.Contains(tag))
|
||||
{ actor.requiredGenitals.Remove(tag); }
|
||||
else if (toggleComp.isOn == false && actor.RequiredGenitals.Contains(tag))
|
||||
{ actor.RequiredGenitals.Remove(tag); }
|
||||
|
||||
Workspace.Instance.RecordEvent("Actor required body part");
|
||||
Workspace.RecordEvent("Actor required body part");
|
||||
});
|
||||
|
||||
if (CustomTags.bodyParts.Contains(tag))
|
||||
|
@ -68,7 +68,7 @@ namespace RimWorldAnimationStudio
|
|||
_optionField.Find("Placeholder").GetComponent<Text>().text = placeHolderText;
|
||||
|
||||
InputField fieldComp = _optionField.GetComponent<InputField>();
|
||||
fieldComp.onEndEdit.AddListener(delegate { AddCustomTag(fieldComp, ref Tags.bodyParts, ref CustomTags.bodyParts); });
|
||||
fieldComp.onEndEdit.AddListener(delegate { AddCustomTag(fieldComp, ref DefaultTags.bodyParts, ref CustomTags.bodyParts); });
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
|
|
|
@ -12,10 +12,10 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public override void Initialize(bool addedNewTag = false)
|
||||
{
|
||||
IEnumerable<string> allTags = Tags.defNames.Concat(CustomTags.defNames);
|
||||
IEnumerable<string> allTags = DefaultTags.defNames.Concat(CustomTags.defNames);
|
||||
string placeHolderText = "Enter new def name...";
|
||||
|
||||
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
|
||||
Actor actor = Workspace.animationDef.Actors[Workspace.ActorID];
|
||||
Transform contentWindow = transform.FindDeepChild("Content");
|
||||
Reset();
|
||||
|
||||
|
@ -27,16 +27,16 @@ namespace RimWorldAnimationStudio
|
|||
_optionToggle.Find("Text").GetComponent<Text>().text = tag;
|
||||
|
||||
Toggle toggleComp = _optionToggle.GetComponent<Toggle>();
|
||||
toggleComp.isOn = actor.defNames.Contains(tag);
|
||||
toggleComp.isOn = actor.DefNames.Contains(tag);
|
||||
toggleComp.onValueChanged.AddListener(delegate
|
||||
{
|
||||
if (toggleComp.isOn && actor.defNames.Contains(tag) == false)
|
||||
{ actor.defNames.Add(tag); }
|
||||
if (toggleComp.isOn && actor.DefNames.Contains(tag) == false)
|
||||
{ actor.DefNames.Add(tag); }
|
||||
|
||||
else if (toggleComp.isOn == false && actor.defNames.Contains(tag))
|
||||
{ actor.defNames.Remove(tag); }
|
||||
else if (toggleComp.isOn == false && actor.DefNames.Contains(tag))
|
||||
{ actor.DefNames.Remove(tag); }
|
||||
|
||||
Workspace.Instance.RecordEvent("Actor def name");
|
||||
Workspace.RecordEvent("Actor def name");
|
||||
});
|
||||
|
||||
if (CustomTags.defNames.Contains(tag))
|
||||
|
@ -56,7 +56,7 @@ namespace RimWorldAnimationStudio
|
|||
InputField fieldComp = _optionField.GetComponent<InputField>();
|
||||
fieldComp.onEndEdit.AddListener(delegate
|
||||
{
|
||||
AddCustomTag(fieldComp, ref Tags.defNames, ref CustomTags.defNames);
|
||||
AddCustomTag(fieldComp, ref DefaultTags.defNames, ref CustomTags.defNames);
|
||||
AddCustomRace(fieldComp);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public override void Initialize(bool addedNewTag = false)
|
||||
{
|
||||
IEnumerable<string> allTags = Tags.interactionDefTypes.Concat(CustomTags.interactionDefTypes);
|
||||
IEnumerable<string> allTags = DefaultTags.interactionDefTypes.Concat(CustomTags.interactionDefTypes);
|
||||
string placeHolderText = "Enter new interaction def type...";
|
||||
|
||||
if (Workspace.animationDef == null) return;
|
||||
|
@ -28,16 +28,16 @@ namespace RimWorldAnimationStudio
|
|||
_optionToggle.Find("Text").GetComponent<Text>().text = tag;
|
||||
|
||||
Toggle toggleComp = _optionToggle.GetComponent<Toggle>();
|
||||
toggleComp.isOn = Workspace.animationDef.interactionDefTypes.Contains(tag);
|
||||
toggleComp.isOn = Workspace.animationDef.InteractionDefTypes.Contains(tag);
|
||||
toggleComp.onValueChanged.AddListener(delegate
|
||||
{
|
||||
if (toggleComp.isOn && Workspace.animationDef.interactionDefTypes.Contains(tag) == false)
|
||||
{ Workspace.animationDef.interactionDefTypes.Add(tag); }
|
||||
if (toggleComp.isOn && Workspace.animationDef.InteractionDefTypes.Contains(tag) == false)
|
||||
{ Workspace.animationDef.InteractionDefTypes.Add(tag); }
|
||||
|
||||
else if (toggleComp.isOn == false && Workspace.animationDef.interactionDefTypes.Contains(tag))
|
||||
{ Workspace.animationDef.interactionDefTypes.Remove(tag); }
|
||||
else if (toggleComp.isOn == false && Workspace.animationDef.InteractionDefTypes.Contains(tag))
|
||||
{ Workspace.animationDef.InteractionDefTypes.Remove(tag); }
|
||||
|
||||
Workspace.Instance.RecordEvent("Animation InteractionDef");
|
||||
Workspace.RecordEvent("Animation InteractionDef");
|
||||
});
|
||||
|
||||
if (CustomTags.interactionDefTypes.Contains(tag))
|
||||
|
@ -55,7 +55,7 @@ namespace RimWorldAnimationStudio
|
|||
_optionField.Find("Placeholder").GetComponent<Text>().text = placeHolderText;
|
||||
|
||||
InputField fieldComp = _optionField.GetComponent<InputField>();
|
||||
fieldComp.onEndEdit.AddListener(delegate { AddCustomTag(fieldComp, ref Tags.interactionDefTypes, ref CustomTags.interactionDefTypes); });
|
||||
fieldComp.onEndEdit.AddListener(delegate { AddCustomTag(fieldComp, ref DefaultTags.interactionDefTypes, ref CustomTags.interactionDefTypes); });
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public override void Initialize(bool addedNewTag = false)
|
||||
{
|
||||
IEnumerable<string> allTags = Tags.sexTypes.Concat(CustomTags.sexTypes);
|
||||
IEnumerable<string> allTags = DefaultTags.sexTypes.Concat(CustomTags.sexTypes);
|
||||
string placeHolderText = "Enter new sex type...";
|
||||
|
||||
if (Workspace.animationDef == null) return;
|
||||
|
@ -28,16 +28,16 @@ namespace RimWorldAnimationStudio
|
|||
_optionToggle.Find("Text").GetComponent<Text>().text = tag;
|
||||
|
||||
Toggle toggleComp = _optionToggle.GetComponent<Toggle>();
|
||||
toggleComp.isOn = Workspace.animationDef.sexTypes.Contains(tag);
|
||||
toggleComp.isOn = Workspace.animationDef.SexTypes.Contains(tag);
|
||||
toggleComp.onValueChanged.AddListener(delegate
|
||||
{
|
||||
if (toggleComp.isOn && Workspace.animationDef.sexTypes.Contains(tag) == false)
|
||||
{ Workspace.animationDef.sexTypes.Add(tag); }
|
||||
if (toggleComp.isOn && Workspace.animationDef.SexTypes.Contains(tag) == false)
|
||||
{ Workspace.animationDef.SexTypes.Add(tag); }
|
||||
|
||||
else if (toggleComp.isOn == false && Workspace.animationDef.sexTypes.Contains(tag))
|
||||
{ Workspace.animationDef.sexTypes.Remove(tag); }
|
||||
else if (toggleComp.isOn == false && Workspace.animationDef.SexTypes.Contains(tag))
|
||||
{ Workspace.animationDef.SexTypes.Remove(tag); }
|
||||
|
||||
Workspace.Instance.RecordEvent("Animation sex type");
|
||||
Workspace.RecordEvent("Animation sex type");
|
||||
});
|
||||
|
||||
if (CustomTags.sexTypes.Contains(tag))
|
||||
|
@ -55,7 +55,7 @@ namespace RimWorldAnimationStudio
|
|||
_optionField.Find("Placeholder").GetComponent<Text>().text = placeHolderText;
|
||||
|
||||
InputField fieldComp = _optionField.GetComponent<InputField>();
|
||||
fieldComp.onEndEdit.AddListener(delegate { AddCustomTag(fieldComp, ref Tags.sexTypes, ref CustomTags.sexTypes); });
|
||||
fieldComp.onEndEdit.AddListener(delegate { AddCustomTag(fieldComp, ref DefaultTags.sexTypes, ref CustomTags.sexTypes); });
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue