mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Extra keybinds
This commit is contained in:
parent
e210923733
commit
c3c0a05ac0
139 changed files with 586 additions and 233 deletions
|
@ -32,7 +32,8 @@ namespace RimWorldAnimationStudio
|
|||
else
|
||||
{ bodyRenderer.color = Constants.ColorWhite; }
|
||||
|
||||
appendageRenderer.gameObject.SetActive(Workspace.animationDef.actors[actorID].requiredGenitals.Any(x => x == "Penis") || Workspace.animationDef.actors[actorID].isFucking);
|
||||
//headRenderer.gameObject.SetActive(Workspace.animationDef.actors[actorID].GetAlienRaceDef().isHumanoid);
|
||||
//appendageRenderer.gameObject.SetActive(Workspace.animationDef.actors[actorID].requiredGenitals.Any(x => x == "Penis") || Workspace.animationDef.actors[actorID].isFucking);
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
|
|
|
@ -43,5 +43,66 @@ namespace RimWorldAnimationStudio
|
|||
Workspace.Instance.GetPawnAnimationClip(Workspace.actorID).BuildSimpleCurves();
|
||||
Workspace.Instance.RecordEvent("Actor position / orientation");
|
||||
}
|
||||
|
||||
public void AdjustActor(Vector2 deltaOffset)
|
||||
{
|
||||
float deltaAngle = -deltaOffset.x * 33.3333f + deltaOffset.y * 33.3333f;
|
||||
int facing = deltaOffset.x < 0 ? 3 : deltaOffset.y < 0 ? 2 : deltaOffset.x > 0 ? 1 : 0;
|
||||
|
||||
switch (Workspace.actorManipulationMode)
|
||||
{
|
||||
case ActorManipulationMode.Pan: MoveActor(deltaOffset); break;
|
||||
case ActorManipulationMode.Rotate: RotateActor(deltaAngle); break;
|
||||
case ActorManipulationMode.Face: FaceActor(facing); break;
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveActor(Vector2 deltaOffset)
|
||||
{
|
||||
PawnKeyframe keyframe = Workspace.Instance.GetCurrentPawnKeyframe(true);
|
||||
|
||||
if (Workspace.selectedBodyPart == null)
|
||||
{
|
||||
keyframe.bodyOffsetX += deltaOffset.x;
|
||||
keyframe.bodyOffsetZ += deltaOffset.y;
|
||||
}
|
||||
|
||||
else if (Workspace.selectedBodyPart.isHead)
|
||||
{ keyframe.headBob += deltaOffset.y; }
|
||||
|
||||
Workspace.Instance.GetCurrentPawnAnimationClip().BuildSimpleCurves();
|
||||
Workspace.Instance.RecordEvent("Actor position / orientation");
|
||||
}
|
||||
|
||||
public void RotateActor(float deltaAngle)
|
||||
{
|
||||
PawnKeyframe keyframe = Workspace.Instance.GetCurrentPawnKeyframe(true);
|
||||
|
||||
if (Workspace.selectedBodyPart == null)
|
||||
{ keyframe.bodyAngle += deltaAngle; }
|
||||
|
||||
else if (Workspace.selectedBodyPart.isHead)
|
||||
{ keyframe.headAngle += deltaAngle; }
|
||||
|
||||
else
|
||||
{ keyframe.genitalAngle -= deltaAngle; }
|
||||
|
||||
Workspace.Instance.GetCurrentPawnAnimationClip().BuildSimpleCurves();
|
||||
Workspace.Instance.RecordEvent("Actor position / orientation");
|
||||
}
|
||||
|
||||
public void FaceActor(int facing)
|
||||
{
|
||||
PawnKeyframe keyframe = Workspace.Instance.GetCurrentPawnKeyframe(true);
|
||||
|
||||
if (Workspace.selectedBodyPart == null)
|
||||
{ keyframe.bodyFacing = facing; }
|
||||
|
||||
else if (Workspace.selectedBodyPart.isHead)
|
||||
{ keyframe.headFacing = facing; }
|
||||
|
||||
Workspace.Instance.GetCurrentPawnAnimationClip().BuildSimpleCurves();
|
||||
Workspace.Instance.RecordEvent("Actor position / orientation");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -56,6 +56,7 @@ namespace RimWorldAnimationStudio
|
|||
if (Workspace.animationDef == null) return;
|
||||
|
||||
Workspace.animationDef.actors[Workspace.actorID].SetAlienRaceDef(label.text);
|
||||
Workspace.selectedBodyPart = null;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue