Skip to content

Commit

Permalink
Fixed compatiblity with CEs aiming animation
Browse files Browse the repository at this point in the history
  • Loading branch information
emipa606 committed Sep 30, 2024
1 parent daec15b commit 869f0e2
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 38 deletions.
Binary file modified 1.5/Assemblies/ShowMeYourHands.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ Since modding is just a hobby for me I expect no donations to keep modding. If y
[/list]

[url=https://steamcommunity.com/sharedfiles/filedetails/changelog/2475965842][img]https://img.shields.io/github/v/release/emipa606/ShowMeYourHands?label=latest%20version&amp;style=plastic&amp;labelColor=0070cd&amp;color=white[/img][/url]</description>
<modVersion IgnoreIfNoMatchingField="True">1.5.11</modVersion>
<modVersion IgnoreIfNoMatchingField="True">1.5.12</modVersion>
</ModMetaData>
3 changes: 3 additions & 0 deletions About/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog for ShowMeYourHands

1.5.12 - Fixed compatiblity with CEs aiming animation


1.5.11 - Added separate setting to show hands when crawling. Hand positions when crawling are now more fitting and have a crawling motion.
Used DeepL to update translations for ChineseSimplified, French, German, Russian

Expand Down
2 changes: 1 addition & 1 deletion About/Manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>ShowMeYourHands</identifier>
<version>1.5.11</version>
<version>1.5.12</version>
<dependencies />
<incompatibleWith />
<loadBefore />
Expand Down
2 changes: 1 addition & 1 deletion About/ModSync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ModSyncNinjaData>
<ID>a5b440f3-8aa2-46ee-8a29-29561bb7087a</ID>
<ModName>Show Me Your Hands</ModName>
<Version>1.5.11</Version>
<Version>1.5.12</Version>
<SaveBreaking>False</SaveBreaking>
<Host name="Github">
<Owner>emipa606</Owner>
Expand Down
4 changes: 2 additions & 2 deletions Languages/French/Keyed/Mod_Settings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>
<!--The following translations were generated by https://www.deepl.com/-->
<SMYH.settings>Paramètres</SMYH.settings>
Expand Down Expand Up @@ -66,4 +66,4 @@
<SMYH.rotate>Utilisez la molette de défilement pour faire tourner les aiguilles, maintenez la touche SHIFT enfoncée pour une rotation plus rapide.</SMYH.rotate>
<SMYH.showcrawling.label>Montrer ses mains quand on rampe</SMYH.showcrawling.label>
<SMYH.showcrawling.tooltip>Montre les mains lorsque le pion est renversé et qu'il rampe.</SMYH.showcrawling.tooltip>
</LanguageData>
</LanguageData>
4 changes: 2 additions & 2 deletions Languages/German/Keyed/Mod_Settings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>
<!--The following translations were generated by https://www.deepl.com/-->
<SMYH.settings>Einstellungen</SMYH.settings>
Expand Down Expand Up @@ -66,4 +66,4 @@
<SMYH.rotate>Verwenden Sie das Scrollrad, um die Zeiger zu drehen, halten Sie SHIFT für eine schnellere Drehung</SMYH.rotate>
<SMYH.showcrawling.label>Hände zeigen beim Krabbeln</SMYH.showcrawling.label>
<SMYH.showcrawling.tooltip>Zeigt die Hände, wenn der Bauer niedergeschlagen ist und krabbelt</SMYH.showcrawling.tooltip>
</LanguageData>
</LanguageData>
4 changes: 2 additions & 2 deletions Languages/Russian/Keyed/Mod_Settings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>
<!--The following translations were generated by https://www.deepl.com/-->
<SMYH.settings>Настройки</SMYH.settings>
Expand Down Expand Up @@ -66,4 +66,4 @@
<SMYH.rotate>Используйте колесо прокрутки для поворота стрелок, удерживайте SHIFT для ускорения вращения.</SMYH.rotate>
<SMYH.showcrawling.label>Показывайте руки, когда ползаете</SMYH.showcrawling.label>
<SMYH.showcrawling.tooltip>Показывает руки, когда пешка сбита с ног и ползет.</SMYH.showcrawling.tooltip>
</LanguageData>
</LanguageData>
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,9 @@ namespace ShowMeYourHands;
[HarmonyPatch]
public static class CombatExtended_PawnRenderer_DrawEquipmentAiming
{
private static FieldInfo recoilOffsetField;
private static FieldInfo muzzleJumpField;

public static bool Prepare()
{
if (ModLister.GetActiveModWithIdentifier("CETeam.CombatExtended") == null)
{
return false;
}

recoilOffsetField = AccessTools.Field(
AccessTools.TypeByName("CombatExtended.HarmonyCE.Harmony_PawnRenderer_DrawEquipmentAiming"),
"recoilOffset");
muzzleJumpField = AccessTools.Field(
AccessTools.TypeByName("CombatExtended.HarmonyCE.Harmony_PawnRenderer_DrawEquipmentAiming"),
"muzzleJump");
return true;
return ModLister.GetActiveModWithIdentifier("CETeam.CombatExtended") != null;
}

public static MethodBase TargetMethod()
Expand All @@ -34,19 +20,8 @@ public static MethodBase TargetMethod()
AccessTools.TypeByName("CombatExtended.HarmonyCE.Harmony_PawnRenderer_DrawEquipmentAiming"), "DrawMesh");
}

public static void Postfix(Thing eq, Vector3 position, float aimAngle)
public static void Postfix(Thing eq, float aimAngle, Matrix4x4 matrix)
{
var recoilOffset = (Vector3)recoilOffsetField.GetValue(null);
var muzzleJump = (float)muzzleJumpField.GetValue(null);

if (aimAngle is > 200f and < 340f)
{
muzzleJump = -muzzleJump;
}

position += recoilOffset;
aimAngle += muzzleJump;

ShowMeYourHandsMain.weaponLocations[eq] = new Tuple<Vector3, float>(position, aimAngle);
ShowMeYourHandsMain.weaponLocations[eq] = new Tuple<Vector3, float>(matrix.Position(), aimAngle);
}
}
2 changes: 1 addition & 1 deletion Source/ShowMeYourHands/ShowMeYourHands.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<DebugType>None</DebugType>
<LangVersion>latest</LangVersion>
<FileVersion>1.5.11</FileVersion>
<FileVersion>1.5.12</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Krafs.Rimworld.Ref">
Expand Down

0 comments on commit 869f0e2

Please sign in to comment.