Bug fixes and build files

This commit is contained in:
AbstractConcept 2022-09-27 00:56:35 -05:00
parent 73f7e32e0c
commit 0e653f863a
252 changed files with 25598 additions and 90 deletions

View file

@ -9,7 +9,6 @@ namespace RimWorldAnimationStudio
public class ActorBody : MonoBehaviour, IPointerClickHandler, IDragHandler, IEndDragHandler
{
public int actorID;
public string bodyType = "Male";
public bool isSelected = false;
public SpriteRenderer bodyRenderer;

View file

@ -79,7 +79,7 @@ namespace RimWorldAnimationStudio
{
if (Workspace.actorManipulationMode == ActorManipulationMode.Rotate)
{
float angle = Vector2.SignedAngle(Vector2.up, (Vector2)mousePosition - (Vector2)transform.position);
float angle = -Vector2.SignedAngle(Vector2.up, (Vector2)mousePosition - (Vector2)transform.position);
keyframe.genitalAngle = angle;
Workspace.animationDef.actors[Workspace.actorID].controlGenitalAngle = Workspace.animationDef.animationStages.Any(x => x.animationClips[Workspace.actorID].keyframes.Any(y => y.genitalAngle != 0));

View file

@ -37,7 +37,7 @@ namespace RimWorldAnimationStudio
string bodyType = bodyTypeDropdown.options[bodyTypeDropdown.value].text;
bodyType = bodyType == null || bodyType == "" ? "Male" : bodyType;
AnimationController.Instance.actorBodies.GetComponentsInChildren<ActorBody>()[Workspace.actorID].bodyType = bodyType;
Workspace.animationDef.actors[Workspace.actorID].bodyType = bodyType;
bodyOffsetXField.text = actor.bodyTypeOffset.GetOffset(bodyType).x.ToString();
bodyOffsetZField.text = actor.bodyTypeOffset.GetOffset(bodyType).z.ToString();
@ -93,7 +93,7 @@ namespace RimWorldAnimationStudio
ActorBody actorBody = AnimationController.Instance.actorBodies.GetComponentsInChildren<ActorBody>()[Workspace.actorID];
PawnAnimationClip clip = Workspace.Instance.GetCurrentPawnAnimationClip();
string bodyType = actorBody.bodyType;
string bodyType = actor.bodyType;
bodyType = bodyType == null || bodyType == "" ? "Male" : bodyType;
bodyTypeDropdown.value = bodyTypeDropdown.options.IndexOf(bodyTypeDropdown.options.First(x => x.text == bodyType));
@ -112,10 +112,10 @@ namespace RimWorldAnimationStudio
initiatorToggle.isOn = actor.initiator;
if (actor.requiredGender.Contains("Female"))
if (actor.requiredGender.NotNullOrEmpty() && actor.requiredGender.Contains("Female"))
{ genderDropdown.SetValueWithoutNotify(0); }
else if (actor.requiredGender.Contains("Male"))
else if (actor.requiredGender.NotNullOrEmpty() && actor.requiredGender.Contains("Male"))
{ genderDropdown.SetValueWithoutNotify(2); }
else

View file

@ -14,10 +14,16 @@ namespace RimWorldAnimationStudio
public InputField labelField;
public Toggle playSoundsToggle;
public void Initialize()
public void Update()
{
defNameField.text = Workspace.animationDef.defName;
labelField.text = Workspace.animationDef.label;
if (Workspace.animationDef == null) return;
if (defNameField.isFocused == false)
{ defNameField.text = Workspace.animationDef.defName; }
if (labelField.isFocused == false)
{ labelField.text = Workspace.animationDef.label; }
playSoundsToggle.isOn = Workspace.animationDef.sounds;
}
@ -26,22 +32,8 @@ namespace RimWorldAnimationStudio
Workspace.animationDef.defName = defNameField.text;
Workspace.animationDef.label = labelField.text;
Workspace.animationDef.sounds = playSoundsToggle.isOn;
}
public void OpenSelectSexTypesDialog()
{
var dialog = Resources.FindObjectsOfTypeAll(typeof(SelectSexTypesDialog)) as SelectSexTypesDialog[];
if (dialog != null)
{ dialog[0].Initialize(); dialog[0].Pop(); }
}
public void OpenSelectInteractionDefsDialog()
{
var dialog = Resources.FindObjectsOfTypeAll(typeof(SelectInteractionDefsDialog)) as SelectInteractionDefsDialog[];
if (dialog != null)
{ dialog[0].Initialize(); dialog[0].Pop(); }
Workspace.Instance.MakeHistoricRecord("AnimationDef update");
}
}
}

View file

@ -30,6 +30,9 @@ namespace RimWorldAnimationStudio
public void UpdateDropdown()
{
if (dropdown == null)
{ OnEnable(); }
string alienRaceDefName = Workspace.animationDef.actors[Workspace.actorID].GetAlienRaceDef().defName;
dropdown.ClearOptions();