mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
better offset tweaks for position
This commit is contained in:
parent
7f5e2e1a63
commit
1ba5e0e117
6 changed files with 18 additions and 14 deletions
Binary file not shown.
|
@ -13,25 +13,25 @@
|
||||||
<workerClass>Rimworld_Animations.AnimationWorker_KeyframesExtended</workerClass>
|
<workerClass>Rimworld_Animations.AnimationWorker_KeyframesExtended</workerClass>
|
||||||
<keyframes>
|
<keyframes>
|
||||||
<li Class="Rimworld_Animations.ExtendedKeyframe">
|
<li Class="Rimworld_Animations.ExtendedKeyframe">
|
||||||
<offset>(1, -1, 0)</offset>
|
<offset>(1, 0, 0)</offset>
|
||||||
<tick>0</tick>
|
<tick>0</tick>
|
||||||
<angle>0</angle>
|
<angle>0</angle>
|
||||||
<rotation>North</rotation>
|
<rotation>North</rotation>
|
||||||
</li>
|
</li>
|
||||||
<li Class="Rimworld_Animations.ExtendedKeyframe">
|
<li Class="Rimworld_Animations.ExtendedKeyframe">
|
||||||
<offset>(0, -1, 0)</offset>
|
<offset>(0, 0, 0)</offset>
|
||||||
<tick>30</tick>
|
<tick>30</tick>
|
||||||
<angle>15</angle>
|
<angle>15</angle>
|
||||||
<rotation>North</rotation>
|
<rotation>North</rotation>
|
||||||
</li>
|
</li>
|
||||||
<li Class="Rimworld_Animations.ExtendedKeyframe">
|
<li Class="Rimworld_Animations.ExtendedKeyframe">
|
||||||
<offset>(-1, -1, 0)</offset>
|
<offset>(-1, 0, 0)</offset>
|
||||||
<tick>60</tick>
|
<tick>60</tick>
|
||||||
<angle>0</angle>
|
<angle>0</angle>
|
||||||
<rotation>North</rotation>
|
<rotation>North</rotation>
|
||||||
</li>
|
</li>
|
||||||
<li Class="Rimworld_Animations.ExtendedKeyframe">
|
<li Class="Rimworld_Animations.ExtendedKeyframe">
|
||||||
<offset>(0, -1, 0)</offset>
|
<offset>(0, 0, 0)</offset>
|
||||||
<tick>90</tick>
|
<tick>90</tick>
|
||||||
<angle>-15</angle>
|
<angle>-15</angle>
|
||||||
<rotation>North</rotation>
|
<rotation>North</rotation>
|
||||||
|
|
|
@ -22,6 +22,7 @@ namespace Rimworld_Animations
|
||||||
|
|
||||||
public override Vector3 getDrawPos()
|
public override Vector3 getDrawPos()
|
||||||
{
|
{
|
||||||
|
//vector3.up means stand above the thing
|
||||||
return thing.DrawPos;
|
return thing.DrawPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace Rimworld_Animations {
|
||||||
class MainTabWindow_OffsetConfigure : MainTabWindow
|
class MainTabWindow_OffsetConfigure : MainTabWindow
|
||||||
{
|
{
|
||||||
|
|
||||||
public override Vector2 RequestedTabSize => new Vector2(505, 450);
|
public override Vector2 RequestedTabSize => new Vector2(505, 500);
|
||||||
public override void DoWindowContents(Rect inRect) {
|
public override void DoWindowContents(Rect inRect) {
|
||||||
|
|
||||||
Rect position = new Rect(inRect.x, inRect.y, inRect.width, inRect.height);
|
Rect position = new Rect(inRect.x, inRect.y, inRect.width, inRect.height);
|
||||||
|
@ -76,6 +76,8 @@ namespace Rimworld_Animations {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
listingStandard.Label("RimAnims_ShareSettings".Translate());
|
||||||
|
|
||||||
extendedAnimator.Offset = newOffsetVector;
|
extendedAnimator.Offset = newOffsetVector;
|
||||||
extendedAnimator.Rotation = rot;
|
extendedAnimator.Rotation = rot;
|
||||||
|
|
||||||
|
|
|
@ -7,20 +7,20 @@ namespace Rimworld_Animations {
|
||||||
|
|
||||||
[HarmonyPatch(typeof(Pawn_DrawTracker), "DrawPos", MethodType.Getter)]
|
[HarmonyPatch(typeof(Pawn_DrawTracker), "DrawPos", MethodType.Getter)]
|
||||||
public static class HarmonyPatch_Pawn_DrawTracker {
|
public static class HarmonyPatch_Pawn_DrawTracker {
|
||||||
public static bool Prefix(ref Pawn ___pawn, ref Vector3 __result) {
|
|
||||||
|
|
||||||
|
//switch to postfix to get pawn original height first
|
||||||
CompExtendedAnimator animator = ___pawn.TryGetComp<CompExtendedAnimator>();
|
public static void Postfix(ref Pawn ___pawn, ref Vector3 __result) {
|
||||||
|
|
||||||
//align pos on top of partner, position, etc., based on animatoranchor
|
//align pos on top of partner, position, etc., based on animatoranchor
|
||||||
if (animator != null && animator.IsAnchored)
|
if (___pawn.TryGetComp<CompExtendedAnimator>() is CompExtendedAnimator animator
|
||||||
|
&& animator.IsAnchored)
|
||||||
{
|
{
|
||||||
__result = animator.getAnchor();
|
Vector3 anchor = animator.getAnchor();
|
||||||
return false;
|
//ignore y so that pawns don't clip through stuff
|
||||||
|
__result.x = anchor.x;
|
||||||
|
__result.z = anchor.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,9 @@
|
||||||
<RimAnim_DebugMode>Debug Mode</RimAnim_DebugMode>
|
<RimAnim_DebugMode>Debug Mode</RimAnim_DebugMode>
|
||||||
|
|
||||||
<!-- Main Tab Window -->
|
<!-- Main Tab Window -->
|
||||||
|
<RimAnims_AnimManager>Animation Manager</RimAnims_AnimManager>
|
||||||
<RimAnims_Warning>Warning--You generally don't want to change human offsets, only alien offsets or animals</RimAnims_Warning>
|
<RimAnims_Warning>Warning--You generally don't want to change human offsets, only alien offsets or animals</RimAnims_Warning>
|
||||||
<RimAnims_CopyToClipboard>Copy Offset to Clipboard</RimAnims_CopyToClipboard>
|
<RimAnims_CopyToClipboard>Copy Offset to Clipboard</RimAnims_CopyToClipboard>
|
||||||
<RimAnims_AnimManager>Animation Manager</RimAnims_AnimManager>
|
<RimAnims_ShareSettings>Paste offset values in OffsetDef, or share in Discord</RimAnims_ShareSettings>
|
||||||
|
|
||||||
</LanguageData>
|
</LanguageData>
|
Loading…
Reference in a new issue