mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
Update for HAR
This commit is contained in:
parent
9059f3e0e7
commit
8bc5884d39
3 changed files with 6 additions and 7 deletions
Binary file not shown.
|
@ -36,7 +36,7 @@
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="AlienRace">
|
<Reference Include="AlienRace">
|
||||||
<HintPath>..\..\..\..\workshop\content\294100\839005762\1.1\Assemblies\AlienRace.dll</HintPath>
|
<HintPath>..\..\..\..\workshop\content\294100\839005762\1.2\Assemblies\AlienRace.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Assembly-CSharp, Version=1.1.7397.36407, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Assembly-CSharp, Version=1.1.7397.36407, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="RJW">
|
<Reference Include="RJW">
|
||||||
<HintPath>..\RJW\1.2\Assemblies\RJW.dll</HintPath>
|
<HintPath>..\rjw-master\1.2\Assemblies\RJW.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
|
|
@ -53,8 +53,7 @@ namespace Rimworld_Animations {
|
||||||
if (!ba.CanDrawAddon(pawn: pawn)) continue;
|
if (!ba.CanDrawAddon(pawn: pawn)) continue;
|
||||||
|
|
||||||
AlienPartGenerator.RotationOffset offset;
|
AlienPartGenerator.RotationOffset offset;
|
||||||
if (ba.drawnInBed) {
|
if (ba.drawnInBed || ba.alignWithHead) {
|
||||||
|
|
||||||
offset = pawnAnimator.headFacing == Rot4.South ?
|
offset = pawnAnimator.headFacing == Rot4.South ?
|
||||||
ba.offsets.south :
|
ba.offsets.south :
|
||||||
pawnAnimator.headFacing == Rot4.North ?
|
pawnAnimator.headFacing == Rot4.North ?
|
||||||
|
@ -92,7 +91,7 @@ namespace Rimworld_Animations {
|
||||||
float moffsetY = ba.inFrontOfBody ? 0.3f + ba.layerOffset : -0.3f - ba.layerOffset;
|
float moffsetY = ba.inFrontOfBody ? 0.3f + ba.layerOffset : -0.3f - ba.layerOffset;
|
||||||
float num = ba.angle;
|
float num = ba.angle;
|
||||||
|
|
||||||
if ((ba.drawnInBed ? pawnAnimator.headFacing : rotation) == Rot4.North) {
|
if ((ba.drawnInBed || ba.alignWithHead ? pawnAnimator.headFacing : rotation) == Rot4.North) {
|
||||||
moffsetX = 0f;
|
moffsetX = 0f;
|
||||||
if (ba.layerInvert)
|
if (ba.layerInvert)
|
||||||
moffsetY = -moffsetY;
|
moffsetY = -moffsetY;
|
||||||
|
@ -104,7 +103,7 @@ namespace Rimworld_Animations {
|
||||||
moffsetX += bodyOffset.x + crownOffset.x;
|
moffsetX += bodyOffset.x + crownOffset.x;
|
||||||
moffsetZ += bodyOffset.y + crownOffset.y;
|
moffsetZ += bodyOffset.y + crownOffset.y;
|
||||||
|
|
||||||
if ((ba.drawnInBed ? pawnAnimator.headFacing : rotation) == Rot4.East) {
|
if ((ba.drawnInBed || ba.alignWithHead ? pawnAnimator.headFacing : rotation) == Rot4.East) {
|
||||||
moffsetX = -moffsetX;
|
moffsetX = -moffsetX;
|
||||||
num = -num; //Angle
|
num = -num; //Angle
|
||||||
}
|
}
|
||||||
|
@ -114,7 +113,7 @@ namespace Rimworld_Animations {
|
||||||
//Angle calculation to not pick the shortest, taken from Quaternion.Angle and modified
|
//Angle calculation to not pick the shortest, taken from Quaternion.Angle and modified
|
||||||
|
|
||||||
//assume drawnInBed means headAddon
|
//assume drawnInBed means headAddon
|
||||||
if (ba.drawnInBed && pawn.TryGetComp<CompBodyAnimator>() != null && pawn.TryGetComp<CompBodyAnimator>().isAnimating) {
|
if (ba.drawnInBed || ba.alignWithHead && pawn.TryGetComp<CompBodyAnimator>() != null && pawn.TryGetComp<CompBodyAnimator>().isAnimating) {
|
||||||
|
|
||||||
Quaternion headQuatInAnimation = Quaternion.AngleAxis(pawnAnimator.headAngle, Vector3.up);
|
Quaternion headQuatInAnimation = Quaternion.AngleAxis(pawnAnimator.headAngle, Vector3.up);
|
||||||
Rot4 headRotInAnimation = pawnAnimator.headFacing;
|
Rot4 headRotInAnimation = pawnAnimator.headFacing;
|
||||||
|
|
Loading…
Reference in a new issue