-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Interop with Dynamic Trade Interface
- Loading branch information
Showing
15 changed files
with
153 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ For reference: | |
|
||
- 1541408076: We Had a Trader? | ||
- 2695164414: Tweaks Galore | ||
- 3020706506: Dynamic Trade Interface |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Library</OutputType> | ||
<TargetFramework>net48</TargetFramework> | ||
<PlatformTarget>x64</PlatformTarget> | ||
<LangVersion>10.0</LangVersion> | ||
<Nullable>enable</Nullable> | ||
|
||
<RootNamespace>RealisticOrbitalTrade.DynamicTradeInterface</RootNamespace> | ||
<AssemblyName>RealisticOrbitalTrade.DynamicTradeInterface</AssemblyName> | ||
<VersionPrefix>0.4.0</VersionPrefix> | ||
|
||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
|
||
<!-- Intellisense doesn't work without specifying these explicitly --> | ||
<!-- !! Don't check in with these uncommented !! --> | ||
<!-- <RimWorldSteamWorkshopFolderPath>C:\Program Files (x86)\Steam\steamapps\workshop\content\294100</RimWorldSteamWorkshopFolderPath> | ||
<RimWorldVersion>1.5</RimWorldVersion> --> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)' == 'Release'"> | ||
<DebugType>none</DebugType> | ||
<DebugSymbols>false</DebugSymbols> | ||
<Optimize>true</Optimize> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'"> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<DebugSymbols>true</DebugSymbols> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<!-- Mod --> | ||
<Compile Include="../Source/RealisticOrbitalTrade.DynamicTradeInterface/**" /> | ||
</ItemGroup> | ||
|
||
<Choose> | ||
<When Condition="'$(RimWorldVersion)' == '1.5'"> | ||
<PropertyGroup> | ||
<DefineConstants>$(DefineConstants);v1_5</DefineConstants> | ||
<OutputPath>../1.5_DynamicTradeInterface/Assemblies</OutputPath> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Krafs.Rimworld.Ref" Version="1.5.*-*"> | ||
<ExcludeAssets>runtime</ExcludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
</When> | ||
<When Condition="'$(RimWorldVersion)' == '1.4'"> | ||
<PropertyGroup> | ||
<DefineConstants>$(DefineConstants);v1_4</DefineConstants> | ||
<OutputPath>../1.4_DynamicTradeInterface/Assemblies</OutputPath> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Krafs.Rimworld.Ref" Version="1.4.*-*"> | ||
<ExcludeAssets>runtime</ExcludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
</When> | ||
</Choose> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Lib.Harmony" Version="2.2.2"> | ||
<ExcludeAssets>runtime</ExcludeAssets> | ||
</PackageReference> | ||
<ProjectReference Include=".\mod.csproj"> | ||
<CopyLocal>False</CopyLocal> | ||
<Private>false</Private> | ||
</ProjectReference> | ||
<Reference Include="DynamicTradeInterface"> | ||
<HintPath>$(RimWorldSteamWorkshopFolderPath)\3020706506\$(RimWorldVersion)\Assemblies\DynamicTradeInterface.dll</HintPath> | ||
<CopyLocal>False</CopyLocal> | ||
<Private>false</Private> | ||
</Reference> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
Source/RealisticOrbitalTrade.DynamicTradeInterface/Core/DynamicTradeInterfaceMod.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using HarmonyLib; | ||
using Verse; | ||
using System.Reflection; | ||
|
||
namespace RealisticOrbitalTrade.DynamicTradeInterface; | ||
|
||
public class DynamicTradeInterfaceMod : Mod | ||
{ | ||
public DynamicTradeInterfaceMod(ModContentPack content) | ||
: base(content) | ||
{ | ||
new Harmony(Constants.Id).PatchAll(Assembly.GetExecutingAssembly()); | ||
|
||
RealisticOrbitalTradeMod.Message("\"Dynamic Trade Interface\" interop loaded successfully!"); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...TradeInterface/Patch/DynamicTradeInterface_UserInterface_Window_DynamicTrade_PostClose.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using HarmonyLib; | ||
using System.Reflection; | ||
|
||
namespace RealisticOrbitalTrade.DynamicTradeInterface.Patch; | ||
|
||
[HarmonyPatch] | ||
internal static class DynamicTradeInterface_UserInterface_Window_DynamicTrade_PostClose | ||
{ | ||
private static MethodInfo TargetMethod() | ||
{ | ||
return AccessTools.Method("DynamicTradeInterface.UserInterface.Window_DynamicTrade:PostClose"); | ||
} | ||
|
||
private static void Postfix() | ||
{ | ||
TradeShipData.EndTradeAgreementIfExists(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters