Bug fixes

- Fixed bug where graphic paths would be repeated in the race settings menu
- The body type dropdown and offset fields will deactivate and no longer apply when an actor's race is changed to a non-humanoid
This commit is contained in:
AbstractConcept 2022-09-27 19:07:18 -05:00
parent 61c6c949d3
commit 6b44db7400
61 changed files with 89 additions and 68 deletions

View file

@ -89,7 +89,7 @@ namespace RimWorldAnimationStudio
public Vector3 GetFinalTransformOffset()
{
Vector3 offset = bodyTypeOffset.GetOffset(bodyType) + GetAlienRaceOffset();
Vector3 offset = GetAlienRaceOffset() + (GetAlienRaceDef().isHumanoid ? bodyTypeOffset.GetOffset(bodyType) : new Vector3());
return new Vector3(offset.x, offset.z, offset.y);
}

View file

@ -104,6 +104,10 @@ namespace RimWorldAnimationStudio
if (bodyOffsetZField.isFocused == false)
{ bodyOffsetZField.text = actor.bodyTypeOffset.GetOffset(bodyType).z.ToString(); }
bodyTypeDropdown.interactable = actor.GetAlienRaceDef().isHumanoid;
bodyOffsetXField.interactable = actor.GetAlienRaceDef().isHumanoid;
bodyOffsetZField.interactable = actor.GetAlienRaceDef().isHumanoid;
if (raceOffsetXField.isFocused == false)
{ raceOffsetXField.text = actor.GetAlienRaceOffset().x.ToString(); }

View file

@ -19,19 +19,23 @@ namespace RimWorldAnimationStudio
public override void Initialize(bool addedNewTag = false)
{
Debug.Log("Init");
Reset();
AlienRaceDef alienRaceDef = GetCurrentRaceDef();
if (alienRaceDef == null) return;
isHumanoidToggle.isOn = alienRaceDef.isHumanoid;
isHumanoidToggle.SetIsOnWithoutNotify(alienRaceDef.isHumanoid);
Text bodyGraphicsTitle = AddCloneObjectToParent(raceSettingsWindow, 2).GetComponent<Text>();
bodyGraphicsTitle.text = "Body graphic filepaths";
foreach (string bodyType in Tags.bodyTypes)
List<string> allTags = alienRaceDef.isHumanoid ? Tags.bodyTypes : new List<string>() { "None" };
foreach (string bodyType in allTags)
{
string _bodyType = alienRaceDef.isHumanoid ? bodyType : "None";
string _bodyType = bodyType;
if (alienRaceDef.isHumanoid)
{
@ -53,9 +57,6 @@ namespace RimWorldAnimationStudio
}
AddCloneObjectToParent(raceSettingsWindow, 3);
if (alienRaceDef.isHumanoid == false)
{ break; }
}
if (alienRaceDef.isHumanoid)