- Fixed an issue where changing the order of actors in the animation was not being perpetuated across all animation stages
This commit is contained in:
AbstractConcept 2023-01-11 22:36:57 -06:00
parent b6d3df800d
commit ab53ed284f
46 changed files with 71 additions and 62 deletions

View file

@ -8,7 +8,7 @@ namespace RimWorldAnimationStudio
public static class Constants
{
// Project data
public static string currentVersion = "1.0.2";
public static string currentVersion = "1.0.3";
public static string projectHome = "https://gitgud.io/AbstractConcept/rimworld-animation-studio";
public static string projectWiki = "https://gitgud.io/AbstractConcept/rimworld-animation-studio/-/wikis/home";

View file

@ -99,12 +99,16 @@ namespace RimWorldAnimationStudio
Workspace.animationDef.Actors[startIndex] = Workspace.animationDef.Actors[startIndex + delta];
Workspace.animationDef.Actors[startIndex + delta] = actor;
PawnAnimationClip clip = Workspace.GetPawnAnimationClip(startIndex);
Workspace.GetCurrentAnimationStage().AnimationClips[startIndex] = Workspace.GetCurrentAnimationStage().AnimationClips[startIndex + delta];
Workspace.GetCurrentAnimationStage().AnimationClips[startIndex + delta] = clip;
foreach (AnimationStage stage in Workspace.animationDef.animationStages)
{
int stageID = stage.GetStageID();
PawnAnimationClip clip = Workspace.GetPawnAnimationClip(stageID, startIndex);
Workspace.GetAnimationStage(stageID).AnimationClips[startIndex] = Workspace.GetAnimationStage(stageID).AnimationClips[startIndex + delta];
Workspace.GetAnimationStage(stageID).AnimationClips[startIndex + delta] = clip;
}
Workspace.ActorID = startIndex + delta;
Workspace.RecordEvent("Timeline move");
return true;

View file

@ -139,6 +139,11 @@ namespace RimWorldAnimationStudio
return animationDef?.AnimationStages.ElementAtOrDefault(stageID);
}
public static PawnAnimationClip GetPawnAnimationClip(int stageID, int actorID)
{
return GetAnimationStage(stageID)?.AnimationClips.ElementAtOrDefault(actorID);
}
public static PawnAnimationClip GetPawnAnimationClip(int actorID)
{
return GetCurrentAnimationStage()?.AnimationClips.ElementAtOrDefault(actorID);