-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from Aviuz/1.4.6
version 1.4.6
- Loading branch information
Showing
31 changed files
with
963 additions
and
637 deletions.
There are no files selected for viewing
Binary file not shown.
12 changes: 6 additions & 6 deletions
12
PL_Biotech_PrisonersInteractionMode.xml → ...f/PL_Biotech_PrisonersInteractionMode.xml
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LanguageData> | ||
<PrisonLabor_workAndBloodfeedOption.label>工作與供血</PrisonLabor_workAndBloodfeedOption.label> <PrisonLabor_workAndBloodfeedOption.description>強迫囚犯工作,血原需求者可無視囚犯心情直接對其進食。</PrisonLabor_workAndBloodfeedOption.description> | ||
|
||
<PrisonLabor_workAndHemogenFarmOption.label>工作和血包</PrisonLabor_workAndHemogenFarmOption.label> <PrisonLabor_workAndHemogenFarmOption.description>強迫囚犯工作,以不造成死亡為原則,抽取血液。</PrisonLabor_workAndHemogenFarmOption.description> | ||
|
||
<?xml version="1.0" encoding="utf-8"?> | ||
<LanguageData> | ||
<PrisonLabor_workAndBloodfeedOption.label>工作與供血</PrisonLabor_workAndBloodfeedOption.label> <PrisonLabor_workAndBloodfeedOption.description>強迫囚犯工作,血原需求者可無視囚犯心情直接對其進食。</PrisonLabor_workAndBloodfeedOption.description> | ||
|
||
<PrisonLabor_workAndHemogenFarmOption.label>工作和血包</PrisonLabor_workAndHemogenFarmOption.label> <PrisonLabor_workAndHemogenFarmOption.description>強迫囚犯工作,以不造成死亡為原則,抽取血液。</PrisonLabor_workAndHemogenFarmOption.description> | ||
|
||
</LanguageData> |
Binary file modified
BIN
+0 Bytes
(100%)
1.4/CashRegistry/Assemblies/PrisonLaborCashRegistryCompatibility.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
1.4/CleaningArea/Assemblies/PrisonLaborCleaningAreaCompatibility.dll
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
1.4/Hospitality/Assemblies/PrisonLaborHospitalityCompatibility.dll
Binary file not shown.
Binary file not shown.
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
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
76 changes: 76 additions & 0 deletions
76
Source/CompatibilityProjects/ColonyGroupsCompatibility/ColonyGroupsCompatibility.csproj
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,76 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{A77AE1EB-BA5D-4B3A-9D9B-A9580850FAAD}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>ColonyGroupsCompatibility</RootNamespace> | ||
<AssemblyName>PrisonLaborColonyGroupsCompatibility</AssemblyName> | ||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<Deterministic>true</Deterministic> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>..\..\..\1.4\ColonyGroups\Assemblies\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="0Harmony, Version=2.2.2.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\..\packages\Lib.Harmony.2.2.2\lib\net472\0Harmony.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="Assembly-CSharp"> | ||
<HintPath>..\..\..\..\..\Gry\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="CompatUtils"> | ||
<HintPath>..\..\..\..\..\Gry\Steam\steamapps\workshop\content\294100\2345493945\1.4\Assemblies\CompatUtils.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="TacticalGroups"> | ||
<HintPath>..\..\..\..\..\Gry\Steam\steamapps\workshop\content\294100\2345493945\1.4\Assemblies\TacticalGroups.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="HarmonyInit.cs" /> | ||
<Compile Include="HarmonyPatches\MarkGroupAssigment_Patch.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\PrisonLabor.csproj"> | ||
<Project>{97750974-4cb6-4d31-84a1-a3aa77b1e2ee}</Project> | ||
<Name>PrisonLabor</Name> | ||
<Private>False</Private> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
29 changes: 29 additions & 0 deletions
29
Source/CompatibilityProjects/ColonyGroupsCompatibility/HarmonyInit.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,29 @@ | ||
using HarmonyLib; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Verse; | ||
|
||
namespace ColonyGroupsCompatibility | ||
{ | ||
[StaticConstructorOnStartup] | ||
public class HarmonyInit | ||
{ | ||
static HarmonyInit() | ||
{ | ||
var harmony = new Harmony("Harmony_PrisonLabor_ColonyGroups"); | ||
try | ||
{ | ||
harmony.PatchAll(Assembly.GetExecutingAssembly()); | ||
Log.Message("[PL] ColonyGroups patched"); | ||
} | ||
catch (Exception e) | ||
{ | ||
Log.Error($"[PL] Patches for ColonyGroups failed: {e}"); | ||
} | ||
} | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
...ompatibilityProjects/ColonyGroupsCompatibility/HarmonyPatches/MarkGroupAssigment_Patch.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,89 @@ | ||
using HarmonyLib; | ||
using RimWorld; | ||
using PrisonLabor.Core.BillAssignation; | ||
using PrisonLabor.HarmonyPatches.Patches_GUI.GUI_Bill; | ||
using TacticalGroups; | ||
using System.Collections.Generic; | ||
using Verse; | ||
using PrisonLabor.Core.Other; | ||
using System.Reflection; | ||
using System.Reflection.Emit; | ||
using System.Linq; | ||
using static Verse.Widgets; | ||
using System; | ||
|
||
namespace ColonyGroupsCompatibility.HarmonyPatches | ||
{ | ||
[HarmonyPatch(typeof(Patch_RestrictBillToPrisoner))] | ||
public class ReturnLabel_Patch | ||
{ | ||
[HarmonyPostfix] | ||
[HarmonyPatch("GetDropLabel")] | ||
public static string PostfixGetDropLabel(string __result, Dialog_BillConfig dialog) | ||
{ | ||
Bill_Production bill = Traverse.Create(dialog).Field("bill").GetValue<Bill_Production>(); | ||
if (BillAssignationUtility.IsFor(bill) == GroupMode.ColonyGroups) | ||
{ | ||
if (HarmonyPatches_GroupBills.BillsSelectedGroup.TryGetValue(bill, out PawnGroup group)) | ||
{ | ||
string label = "TG.AnyPawnOfGroup".Translate(group.curGroupName); | ||
return label; | ||
} | ||
} | ||
return __result; | ||
} | ||
|
||
} | ||
[HarmonyPatch] | ||
public class MarkGroupAssigment_Patch | ||
{ | ||
static MethodBase TargetMethod() | ||
{ | ||
return AccessTools.Method("TacticalGroups.HarmonyPatches_GroupBills:GeneratePawnRestrictionOptions"); | ||
} | ||
public static IEnumerable<CodeInstruction> Transpiler(ILGenerator gen, MethodBase mBase, IEnumerable<CodeInstruction> inst) | ||
{ | ||
int bill = -1; | ||
var codes = new List<CodeInstruction>(inst); | ||
for (int i = 0; i < codes.Count(); i++) | ||
{ | ||
yield return codes[i]; | ||
if (ShouldCopy(codes[i])) | ||
{ | ||
bill = i; | ||
} | ||
if (ShouldPatch(codes[i]) && bill > -1) | ||
{ | ||
DebugLogger.debug($"Changing delegate: {mBase.ReflectedType.Assembly.GetName().Name}.{mBase.ReflectedType.Name}.{mBase.Name}"); | ||
yield return new CodeInstruction(OpCodes.Ldloc_3, null); | ||
//ldfld | TacticalGroups.HarmonyPatches_GroupBills+<>c__DisplayClass6_0 CS$<>8__locals1 | no labels | ||
yield return codes[bill - 1]; | ||
//ldfld | RimWorld.Bill_Production ___bill | no labels | ||
yield return codes[bill]; | ||
//ldloc.s | Verse.Widgets+DropdownMenuElement`1[Verse.Pawn] (8) | no labels | ||
yield return codes[i - 1]; | ||
yield return new CodeInstruction(OpCodes.Call, typeof(MarkGroupAssigment_Patch).GetMethod(nameof(MarkGroupAssigment_Patch.UpdateAction))); | ||
} | ||
} | ||
} | ||
|
||
private static bool ShouldPatch(CodeInstruction actual) | ||
{ | ||
return actual.opcode == OpCodes.Callvirt && actual.operand != null && actual.operand.ToString().Contains("Void Insert(Int32, DropdownMenuElement`1)"); | ||
} | ||
|
||
private static bool ShouldCopy(CodeInstruction actual) | ||
{ | ||
return actual.opcode == OpCodes.Ldfld && actual.operand != null && actual.operand.ToString().Contains("RimWorld.Bill_Production ___bill"); | ||
} | ||
public static void UpdateAction(Bill_Production bill, DropdownMenuElement<Pawn> element) | ||
{ | ||
Action notify = delegate | ||
{ | ||
BillAssignationUtility.SetFor(bill, GroupMode.ColonyGroups); | ||
DebugLogger.debug($"For {bill.Label} set {GroupMode.ColonyGroups}"); | ||
}; | ||
element.option.action += notify; | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
Source/CompatibilityProjects/ColonyGroupsCompatibility/Properties/AssemblyInfo.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,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("ColonyGroupsCompatibility")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("ColonyGroupsCompatibility")] | ||
[assembly: AssemblyCopyright("Copyright © 2023")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("a77ae1eb-ba5d-4b3a-9d9b-a9580850faad")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
4 changes: 4 additions & 0 deletions
4
Source/CompatibilityProjects/ColonyGroupsCompatibility/packages.config
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Lib.Harmony" version="2.2.2" targetFramework="net472" requireReinstallation="true" /> | ||
</packages> |
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
Oops, something went wrong.