Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.5 compatability #13

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
is_global = true
build_property.RootNamespace = DualWield
build_property.ProjectDir = C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\DualWield\1.3\Source\DualWield\
Binary file modified 1.3/Source/DualWield/obj/Debug/DualWield.assets.cache
Binary file not shown.
Binary file not shown.
8 changes: 5 additions & 3 deletions 1.3/Source/DualWield/obj/DualWield.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"projectUniqueName": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\RimWorld\\Mods\\DualWield\\1.3\\Source\\DualWield\\DualWield.csproj",
"projectName": "DualWield",
"projectPath": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\RimWorld\\Mods\\DualWield\\1.3\\Source\\DualWield\\DualWield.csproj",
"packagesPath": "C:\\Users\\roolo\\.nuget\\packages\\",
"packagesPath": "C:\\Users\\User\\.nuget\\packages\\",
"outputPath": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\RimWorld\\Mods\\DualWield\\1.3\\Source\\DualWield\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\roolo\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Users\\User\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
Expand All @@ -26,6 +26,7 @@
},
"frameworks": {
"net472": {
"targetAlias": "net472",
"projectReferences": {}
}
},
Expand All @@ -37,6 +38,7 @@
},
"frameworks": {
"net472": {
"targetAlias": "net472",
"dependencies": {
"Krafs.Rimworld.Ref": {
"target": "Package",
Expand All @@ -59,7 +61,7 @@
"version": "[9.0.0, )"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.202\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.401\\RuntimeIdentifierGraph.json"
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions 1.3/Source/DualWield/obj/DualWield.csproj.nuget.g.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\roolo\.nuget\packages\</NuGetPackageFolders>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\User\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.5.0</NuGetToolVersion>
</PropertyGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.3.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\User\.nuget\packages\" />
</ItemGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)taskpubliciser\1.0.3\build\TaskPubliciser.props" Condition="Exists('$(NuGetPackageRoot)taskpubliciser\1.0.3\build\TaskPubliciser.props')" />
</ImportGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgKrafs_Rimworld_Ref Condition=" '$(PkgKrafs_Rimworld_Ref)' == '' ">C:\Users\roolo\.nuget\packages\krafs.rimworld.ref\1.3.3076</PkgKrafs_Rimworld_Ref>
<PkgKrafs_Rimworld_Ref Condition=" '$(PkgKrafs_Rimworld_Ref)' == '' ">C:\Users\User\.nuget\packages\krafs.rimworld.ref\1.3.3076</PkgKrafs_Rimworld_Ref>
</PropertyGroup>
</Project>
6 changes: 1 addition & 5 deletions 1.3/Source/DualWield/obj/DualWield.csproj.nuget.g.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
</Project>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
42 changes: 30 additions & 12 deletions 1.3/Source/DualWield/obj/project.assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,14 @@
"Lib.Harmony/2.1.1": {
"type": "package",
"compile": {
"lib/net472/0Harmony.dll": {}
"lib/net472/0Harmony.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net472/0Harmony.dll": {}
"lib/net472/0Harmony.dll": {
"related": ".xml"
}
}
},
"Microsoft.Build.Framework/15.1.548": {
Expand All @@ -107,10 +111,14 @@
"System.Threading.Thread": "4.0.0"
},
"compile": {
"lib/net46/_._": {}
"lib/net46/_._": {
"related": ".xml"
}
},
"runtime": {
"lib/net46/_._": {}
"lib/net46/_._": {
"related": ".xml"
}
}
},
"Microsoft.Build.Utilities.Core/15.1.548": {
Expand All @@ -119,10 +127,14 @@
"Microsoft.Build.Framework": "[15.1.548]"
},
"compile": {
"lib/net46/_._": {}
"lib/net46/_._": {
"related": ".xml"
}
},
"runtime": {
"lib/net46/_._": {}
"lib/net46/_._": {
"related": ".xml"
}
}
},
"System.Collections/4.0.11": {
Expand Down Expand Up @@ -211,10 +223,14 @@
"Lib.Harmony": "2.1.0"
},
"compile": {
"lib/net472/HugsLib.dll": {}
"lib/net472/HugsLib.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net472/_._": {}
"lib/net472/_._": {
"related": ".xml"
}
}
}
}
Expand Down Expand Up @@ -901,19 +917,19 @@
]
},
"packageFolders": {
"C:\\Users\\roolo\\.nuget\\packages\\": {}
"C:\\Users\\User\\.nuget\\packages\\": {}
},
"project": {
"version": "1.3.0",
"restore": {
"projectUniqueName": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\RimWorld\\Mods\\DualWield\\1.3\\Source\\DualWield\\DualWield.csproj",
"projectName": "DualWield",
"projectPath": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\RimWorld\\Mods\\DualWield\\1.3\\Source\\DualWield\\DualWield.csproj",
"packagesPath": "C:\\Users\\roolo\\.nuget\\packages\\",
"packagesPath": "C:\\Users\\User\\.nuget\\packages\\",
"outputPath": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\RimWorld\\Mods\\DualWield\\1.3\\Source\\DualWield\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\roolo\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Users\\User\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
Expand All @@ -925,6 +941,7 @@
},
"frameworks": {
"net472": {
"targetAlias": "net472",
"projectReferences": {}
}
},
Expand All @@ -936,6 +953,7 @@
},
"frameworks": {
"net472": {
"targetAlias": "net472",
"dependencies": {
"Krafs.Rimworld.Ref": {
"target": "Package",
Expand All @@ -958,7 +976,7 @@
"version": "[9.0.0, )"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.202\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.401\\RuntimeIdentifierGraph.json"
}
}
}
Expand Down
28 changes: 14 additions & 14 deletions 1.3/Source/DualWield/obj/project.nuget.cache
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"version": 2,
"dgSpecHash": "LzDMb/4TI5Xad08PT8yJpubqLT/jFv6Q5YHlWWzHHiHV/r0aCKWDjupeK2qWvXUBEkOOzc/eiTfZAJ7MQtoaLg==",
"dgSpecHash": "hM4X05axbkHxrAH/pIXNC7LOaEhD1qty7KH2lD8bUgy9YJusyMt5woSqOm1SEkXZ7iIcfC0VwwHc3e5eOIGhsg==",
"success": true,
"projectFilePath": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\RimWorld\\Mods\\DualWield\\1.3\\Source\\DualWield\\DualWield.csproj",
"expectedPackageFiles": [
"C:\\Users\\roolo\\.nuget\\packages\\krafs.rimworld.ref\\1.3.3076\\krafs.rimworld.ref.1.3.3076.nupkg.sha512",
"C:\\Users\\roolo\\.nuget\\packages\\lib.harmony\\2.1.1\\lib.harmony.2.1.1.nupkg.sha512",
"C:\\Users\\roolo\\.nuget\\packages\\microsoft.build.framework\\15.1.548\\microsoft.build.framework.15.1.548.nupkg.sha512",
"C:\\Users\\roolo\\.nuget\\packages\\microsoft.build.utilities.core\\15.1.548\\microsoft.build.utilities.core.15.1.548.nupkg.sha512",
"C:\\Users\\roolo\\.nuget\\packages\\system.collections\\4.0.11\\system.collections.4.0.11.nupkg.sha512",
"C:\\Users\\roolo\\.nuget\\packages\\system.diagnostics.debug\\4.0.11\\system.diagnostics.debug.4.0.11.nupkg.sha512",
"C:\\Users\\roolo\\.nuget\\packages\\system.globalization\\4.0.11\\system.globalization.4.0.11.nupkg.sha512",
"C:\\Users\\roolo\\.nuget\\packages\\system.runtime\\4.1.0\\system.runtime.4.1.0.nupkg.sha512",
"C:\\Users\\roolo\\.nuget\\packages\\system.runtime.interopservices\\4.1.0\\system.runtime.interopservices.4.1.0.nupkg.sha512",
"C:\\Users\\roolo\\.nuget\\packages\\system.threading\\4.0.11\\system.threading.4.0.11.nupkg.sha512",
"C:\\Users\\roolo\\.nuget\\packages\\system.threading.thread\\4.0.0\\system.threading.thread.4.0.0.nupkg.sha512",
"C:\\Users\\roolo\\.nuget\\packages\\taskpubliciser\\1.0.3\\taskpubliciser.1.0.3.nupkg.sha512",
"C:\\Users\\roolo\\.nuget\\packages\\unlimitedhugs.rimworld.hugslib\\9.0.0\\unlimitedhugs.rimworld.hugslib.9.0.0.nupkg.sha512"
"C:\\Users\\User\\.nuget\\packages\\krafs.rimworld.ref\\1.3.3076\\krafs.rimworld.ref.1.3.3076.nupkg.sha512",
"C:\\Users\\User\\.nuget\\packages\\lib.harmony\\2.1.1\\lib.harmony.2.1.1.nupkg.sha512",
"C:\\Users\\User\\.nuget\\packages\\microsoft.build.framework\\15.1.548\\microsoft.build.framework.15.1.548.nupkg.sha512",
"C:\\Users\\User\\.nuget\\packages\\microsoft.build.utilities.core\\15.1.548\\microsoft.build.utilities.core.15.1.548.nupkg.sha512",
"C:\\Users\\User\\.nuget\\packages\\system.collections\\4.0.11\\system.collections.4.0.11.nupkg.sha512",
"C:\\Users\\User\\.nuget\\packages\\system.diagnostics.debug\\4.0.11\\system.diagnostics.debug.4.0.11.nupkg.sha512",
"C:\\Users\\User\\.nuget\\packages\\system.globalization\\4.0.11\\system.globalization.4.0.11.nupkg.sha512",
"C:\\Users\\User\\.nuget\\packages\\system.runtime\\4.1.0\\system.runtime.4.1.0.nupkg.sha512",
"C:\\Users\\User\\.nuget\\packages\\system.runtime.interopservices\\4.1.0\\system.runtime.interopservices.4.1.0.nupkg.sha512",
"C:\\Users\\User\\.nuget\\packages\\system.threading\\4.0.11\\system.threading.4.0.11.nupkg.sha512",
"C:\\Users\\User\\.nuget\\packages\\system.threading.thread\\4.0.0\\system.threading.thread.4.0.0.nupkg.sha512",
"C:\\Users\\User\\.nuget\\packages\\taskpubliciser\\1.0.3\\taskpubliciser.1.0.3.nupkg.sha512",
"C:\\Users\\User\\.nuget\\packages\\unlimitedhugs.rimworld.hugslib\\9.0.0\\unlimitedhugs.rimworld.hugslib.9.0.0.nupkg.sha512"
],
"logs": []
}
Binary file modified 1.4/Assemblies/DualWield.dll
Binary file not shown.
Binary file added 1.4/Assemblies/DualWield.pdb
Binary file not shown.
4 changes: 3 additions & 1 deletion 1.4/Source/DualWield/Base.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using DualWield.Settings;
using DualWield.Storage;
using HarmonyLib;
using HugsLib;
using HugsLib.Settings;
using HugsLib.Utils;
Expand Down Expand Up @@ -54,6 +55,7 @@ public class Base : ModBase
public Base()
{
Instance = this;

}
public override void DefsLoaded()
{
Expand Down Expand Up @@ -171,7 +173,7 @@ public override void DefsLoaded()
}
if(dualWieldSelection.Value == null)
{
dualWieldSelection.Value = new DictRecordHandler();
dualWieldSelection.Value = new DictRecordHandler();
dualWieldSelection.Value.inner = GetDualWieldDefaults(allWeapons);
}
}
Expand Down
9 changes: 6 additions & 3 deletions 1.4/Source/DualWield/DualWield.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\DualWield\1.4\Assemblies\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -36,12 +36,15 @@
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<Version>1.3.0</Version>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Compile Include="Alerts\Altert_SkillLow.cs" />
<Compile Include="Base.cs" />
<Compile Include="Command_DualWield.cs" />
<Compile Include="Harmony\Jobdriver_Wait.cs" />
<Compile Include="Harmony\PawnRenderer_DrawEquipment.cs" />
<Compile Include="Harmony\PawnRenderer_DrawEquipmentAiming.cs" />
<Compile Include="Harmony\Pawn_StanceTracker.cs" />
<Compile Include="Harmony\VerbTracker.cs" />
<Compile Include="ModExtension\DefModextension_CustomRotation.cs" />
Expand All @@ -60,7 +63,7 @@
<Compile Include="Harmony\Pawn_PathFollower.cs" />
<Compile Include="Harmony\Pawn.cs" />
<Compile Include="Harmony\PawnComponentsUtility.cs" />
<Compile Include="Harmony\PawnRenderer.cs" />
<Compile Include="Harmony\PawnRenderer_RenderPawnAt.cs" />
<Compile Include="Harmony\FloatMenuMakerMap.cs" />
<Compile Include="Harmony\PawnWeaponGenerator.cs" />
<Compile Include="Harmony\Pawn_EquipmentTracker.cs" />
Expand All @@ -79,7 +82,7 @@
<Compile Include="Storage\ExtendedThingWithCompsData.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Krafs.Rimworld.Ref" Version="1.4.3530" GeneratePathProperty="true" />
<PackageReference Include="Krafs.Rimworld.Ref" Version="1.4.3901" GeneratePathProperty="true" />
<PackageReference Include="Lib.Harmony">
<Version>2.2.2</Version>
</PackageReference>
Expand Down
26 changes: 13 additions & 13 deletions 1.4/Source/DualWield/Extensions/Ext_Pawn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,32 @@ public static void SetStancesOffHand(this Pawn instance, Pawn_StanceTracker stan
store.GetExtendedDataFor(instance).stancesOffhand = stancesOffHand;
}
}

public static void TryStartOffHandAttack(this Pawn __instance, LocalTargetInfo targ, ref bool __result)
{
Log.Message("try start offhand attack");
// Log.Message("try start offhand attack");
if(__instance.equipment == null || !__instance.equipment.TryGetOffHandEquipment(out ThingWithComps offHandEquip))
{
Log.Message("no offhand equp");
// Log.Message("no offhand equp");
return;
}
var offhandStance = __instance.GetStancesOffHand();
if (offhandStance.curStance is Stance_Warmup_DW || offhandStance.curStance is Stance_Cooldown)
{
Log.Message($"On cooldown or mobile {offhandStance.curStance}");
// Log.Message($"On cooldown or mobile {offhandStance.curStance}");
return;
}
if (__instance.story != null && __instance.story.DisabledWorkTagsBackstoryAndTraits.HasFlag(WorkTags.Violent))
{
Log.Message("not violent");
// Log.Message("not violent");
return;
}
if (__instance.jobs.curDriver.GetType().Name.Contains("Ability"))//Compatbility for Jecstools' abilities.
{
Log.Message("driver contains ability");
// Log.Message("driver contains ability");
return;
}
Log.Message("Cur offhand stance: " + __instance.GetStancesOffHand().curStance.GetType().Name);
// Log.Message("Cur offhand stance: " + __instance.GetStancesOffHand().curStance.GetType().Name);
bool allowManualCastWeapons = !__instance.IsColonist;
Verb verb = __instance.TryGetOffhandAttackVerb(targ.Thing, true);

Expand All @@ -65,20 +66,20 @@ public static Verb TryGetOffhandAttackVerb(this Pawn instance, Thing target, boo
Pawn_EquipmentTracker equipment = instance.equipment;
ThingWithComps offHandEquip = null;
CompEquippable compEquippable = null;
if (equipment != null && equipment.TryGetOffHandEquipment(out ThingWithComps result) && result != equipment.Primary)
if (equipment != null && equipment.TryGetOffHandEquipment(out offHandEquip) && offHandEquip != equipment.Primary)
{
Log.Message("returning offhand attack verb");
offHandEquip = result;//TODO: replace this temp code.
Log.Message($"Found offhand Equipment {offHandEquip.LabelCap}");
compEquippable = offHandEquip.TryGetComp<CompEquippable>();
}
if (compEquippable != null && compEquippable.PrimaryVerb.Available() && (!compEquippable.PrimaryVerb.verbProps.onlyManualCast || (instance.CurJob != null && instance.CurJob.def != JobDefOf.Wait_Combat) || allowManualCastWeapons))
{
Log.Message("returning primary verb");
// Log.Message("returning offhand attack primary verb");
return compEquippable.PrimaryVerb;
}
else
{
return instance.TryGetMeleeVerbOffHand(target);
// Log.Message("returning offhand attack melee verb");
return instance.TryGetMeleeVerbOffHand(target, compEquippable);
}
}
public static bool HasMissingArmOrHand(this Pawn instance)
Expand All @@ -93,13 +94,12 @@ public static bool HasMissingArmOrHand(this Pawn instance)
}
return hasMissingHand;
}
public static Verb TryGetMeleeVerbOffHand(this Pawn instance, Thing target)
public static Verb TryGetMeleeVerbOffHand(this Pawn instance, Thing target, CompEquippable comp = null)
{

List<VerbEntry> usableVerbs = new List<VerbEntry>();
if (instance.equipment != null && instance.equipment.TryGetOffHandEquipment(out ThingWithComps offHandEquip))
{
CompEquippable comp = offHandEquip.GetComp<CompEquippable>();
//if(comp.AllVerbs.First((Verb verb) => verb.bu
if (comp != null)
{
Expand Down
2 changes: 1 addition & 1 deletion 1.4/Source/DualWield/Extensions/Ext_Verb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static bool OffhandTryStartCastOn(this Verb instance, LocalTargetInfo cas
{
return false;
}
Traverse.Create(instance).Field("currentTarget").SetValue(castTarg);
instance.currentTarget = castTarg;
if (instance.CasterIsPawn && instance.verbProps.warmupTime > 0f)
{
ShootLine newShootLine;
Expand Down
2 changes: 1 addition & 1 deletion 1.4/Source/DualWield/Harmony/FloatMenuMakerMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Verse;
using Verse.AI;

namespace DualWield.Harmony
namespace DualWield.HarmonyInstance
{
[HarmonyPatch(typeof(FloatMenuMakerMap), "AddHumanlikeOrders")]
class FloatMenuMakerMap_AddHumanlikeOrders
Expand Down
Loading