From 44781072ae624eeaac43addca57fa731119d4615 Mon Sep 17 00:00:00 2001
From: SokyranTheDragon <36712560+SokyranTheDragon@users.noreply.github.com>
Date: Sun, 4 Feb 2024 03:45:59 +0100
Subject: [PATCH] Synced archotech teleporter from VFE-Insectoids (#424)
Took a few days longer than I've expected due to some complexity caused by how the mod implemented the accept button, but here it is.
- Synced the archotech teleporter code with use of sessions
- Separated the patch into regions
- Created a `Shared` language file, moved `MpVehiclesSwitchToMap` there and renamed it to `MpCompatSwitchToMap`
- Created a language file for VFE-Insectoids
- Changed `MpVehiclesSwitchToMap` to `MpCompatSwitchToMap` in Vehicle Framework compat
---
Languages/English/Keyed/Shared.xml | 7 +
.../Keyed/VanillaFactionsInsectoid.xml | 6 +
Languages/English/Keyed/VehicleFramework.xml | 3 -
Languages/Polish/Keyed/Shared.xml | 7 +
Languages/Polish/Keyed/VehicleFramework.xml | 4 -
Source/Mods/VanillaFactionsInsectoid.cs | 897 +++++++++++++++++-
Source_Referenced/VehicleFramework.cs | 2 +-
7 files changed, 887 insertions(+), 39 deletions(-)
create mode 100644 Languages/English/Keyed/Shared.xml
create mode 100644 Languages/English/Keyed/VanillaFactionsInsectoid.xml
create mode 100644 Languages/Polish/Keyed/Shared.xml
diff --git a/Languages/English/Keyed/Shared.xml b/Languages/English/Keyed/Shared.xml
new file mode 100644
index 00000000..76482ace
--- /dev/null
+++ b/Languages/English/Keyed/Shared.xml
@@ -0,0 +1,7 @@
+
+
+
+
+ Switch to map
+
+
\ No newline at end of file
diff --git a/Languages/English/Keyed/VanillaFactionsInsectoid.xml b/Languages/English/Keyed/VanillaFactionsInsectoid.xml
new file mode 100644
index 00000000..bd1a8340
--- /dev/null
+++ b/Languages/English/Keyed/VanillaFactionsInsectoid.xml
@@ -0,0 +1,6 @@
+
+
+
+ Teleporter loading session
+
+
\ No newline at end of file
diff --git a/Languages/English/Keyed/VehicleFramework.xml b/Languages/English/Keyed/VehicleFramework.xml
index bcc0a08e..725e99d4 100644
--- a/Languages/English/Keyed/VehicleFramework.xml
+++ b/Languages/English/Keyed/VehicleFramework.xml
@@ -7,8 +7,5 @@
Vehicles waiting to land
-
-
- Switch to map
\ No newline at end of file
diff --git a/Languages/Polish/Keyed/Shared.xml b/Languages/Polish/Keyed/Shared.xml
new file mode 100644
index 00000000..b98cae07
--- /dev/null
+++ b/Languages/Polish/Keyed/Shared.xml
@@ -0,0 +1,7 @@
+
+
+
+
+ Przełącz na mapę
+
+
diff --git a/Languages/Polish/Keyed/VehicleFramework.xml b/Languages/Polish/Keyed/VehicleFramework.xml
index 9f89e1e5..603b4a5c 100644
--- a/Languages/Polish/Keyed/VehicleFramework.xml
+++ b/Languages/Polish/Keyed/VehicleFramework.xml
@@ -7,9 +7,5 @@
Pojazdy oczekujące na lądowanie
-
-
- Przełącz na mapę
-
diff --git a/Source/Mods/VanillaFactionsInsectoid.cs b/Source/Mods/VanillaFactionsInsectoid.cs
index 23d8917e..211814d9 100644
--- a/Source/Mods/VanillaFactionsInsectoid.cs
+++ b/Source/Mods/VanillaFactionsInsectoid.cs
@@ -1,49 +1,884 @@
-using HarmonyLib;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Reflection.Emit;
+using HarmonyLib;
+using JetBrains.Annotations;
+using Multiplayer.API;
+using RimWorld;
+using RimWorld.Planet;
+using UnityEngine;
using Verse;
+using Verse.Sound;
-namespace Multiplayer.Compat
+namespace Multiplayer.Compat;
+
+/// Vanilla Factions Expanded - Insectoids by Oskar Potocki, Sarg Bjornson, Kikohi
+///
+///
+[MpCompatFor("OskarPotocki.VFE.Insectoid")]
+public class VanillaFactionsInsectoid
{
- /// Vanilla Factions Expanded - Insectoids by Oskar Potocki, Sarg Bjornson, Kikohi
- ///
- ///
- [MpCompatFor("OskarPotocki.VFE.Insectoid")]
- class VanillaFactionsInsectoid
+ #region Fields
+
+ // CompTeleporter
+ private static Type teleporterCompType;
+
+ // Command_LoadTeleporter
+ private static Type teleporterCommandType;
+ private static AccessTools.FieldRef commandCompField;
+ private static FastInvokeHandler commandChoseWorldTargetMethod;
+ private static FastInvokeHandler commandTargetingLabelGetterMethod;
+ private static FastInvokeHandler commandActionMakeDropPodInfoMethod;
+
+ // <>c__DisplayClass13_0
+ private static AccessTools.FieldRef