diff --git a/Assembly.version b/Assembly.version
new file mode 100644
index 0000000..691d1be
--- /dev/null
+++ b/Assembly.version
@@ -0,0 +1,7 @@
+
+
+ 1
+ 2
+ 6
+
+
\ No newline at end of file
diff --git a/Directory.Build.props b/Directory.Build.props
index fe5e246..1d15827 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,5 +1,6 @@
+
net48
latest
diff --git a/Directory.Build.targets b/Directory.Build.targets
index 920a7a7..c6e889f 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -39,7 +39,7 @@
../bin
- $(PublishPath)/$(AssemblyName)_$(AssemblyVersion).zip
+ $(PublishPath)/$(AssemblyName)_$(AssemblyVersion)_Experimental.zip
diff --git a/Paths.user.example b/Paths.user.example
new file mode 100644
index 0000000..f5786ad
--- /dev/null
+++ b/Paths.user.example
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TweaksAndThings.sln b/TweaksAndThings.sln
index da34e15..b4b596c 100644
--- a/TweaksAndThings.sln
+++ b/TweaksAndThings.sln
@@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{452A23A6-81C8-49C6-A7EE-95FD9377F896}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
+ Assembly.version = Assembly.version
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Paths.user = Paths.user
diff --git a/TweaksAndThings/Commands/CrewUpdateCommand.cs b/TweaksAndThings/Commands/CrewUpdateCommand.cs
index d204df2..b24bd0b 100644
--- a/TweaksAndThings/Commands/CrewUpdateCommand.cs
+++ b/TweaksAndThings/Commands/CrewUpdateCommand.cs
@@ -1,6 +1,6 @@
using Game.State;
using Helpers;
-using Model.OpsNew;
+using Model.Ops;
using Network;
using RMROC451.TweaksAndThings.Extensions;
using System.Linq;
diff --git a/TweaksAndThings/Definition.json b/TweaksAndThings/Definition.json
index 5d66ba7..a29b876 100644
--- a/TweaksAndThings/Definition.json
+++ b/TweaksAndThings/Definition.json
@@ -5,10 +5,17 @@
"version": "$(AssemblyVersion)",
"requires": [
{
- "id": "railloader",
- "notBefore": "1.8.1"
+ "id": "railroader",
+ "notBefore": "2024.6"
},
- "Zamu.StrangeCustoms"
+ {
+ "id": "railloader",
+ "notBefore": "1.9.6.14"
+ },
+ {
+ "id": "Zamu.StrangeCustoms",
+ "notBefore": "1.10.25017.313"
+ }
],
"assemblies": [ "RMROC451.TweaksAndThings" ],
"mixintos": {
diff --git a/TweaksAndThings/Extensions/Car_Extensions.cs b/TweaksAndThings/Extensions/Car_Extensions.cs
index 5e70ad7..2fb2a63 100644
--- a/TweaksAndThings/Extensions/Car_Extensions.cs
+++ b/TweaksAndThings/Extensions/Car_Extensions.cs
@@ -3,7 +3,7 @@ using Game.State;
using Helpers;
using Model;
using Model.Definition.Data;
-using Model.OpsNew;
+using Model.Ops;
using Serilog;
using System;
using System.Collections.Generic;
@@ -109,8 +109,7 @@ public static class Car_Extensions
{
Vector3 position = car.GetMotionSnapshot().Position;
Vector3 center = WorldTransformer.WorldToGame(position);
- Rect rect = new Rect(new Vector2(center.x - 30f, center.z - 30f), Vector2.one * 30f * 2f);
- var cars = tc.CarIdsInRect(rect);
+ var cars = tc.CarIdsInRadius(center, 60f);
Log.Information($"{nameof(HuntingForCabeeseNearCar)} => {cars.Count()}");
List<(string carId, float distance)> source =
cars
diff --git a/TweaksAndThings/Patches/CarPickable_HandleShowContextMenu_Patch.cs b/TweaksAndThings/Patches/CarPickable_HandleShowContextMenu_Patch.cs
index 69eee66..5ceff11 100644
--- a/TweaksAndThings/Patches/CarPickable_HandleShowContextMenu_Patch.cs
+++ b/TweaksAndThings/Patches/CarPickable_HandleShowContextMenu_Patch.cs
@@ -22,20 +22,20 @@ internal class CarPickable_HandleShowContextMenu_Patch
bool buttonsHaveCost = tweaksAndThings.EndGearHelpersRequirePayment();
ContextMenu shared = ContextMenu.Shared;
- shared.AddButton(ContextMenuQuadrant.Unused2, $"{(car.EnumerateCoupled().Any(c => c.HandbrakeApplied()) ? "Release " : "Set ")} Consist", SpriteName.Handbrake, delegate
+ shared.AddButton(ContextMenuQuadrant.Unused1, $"{(car.EnumerateCoupled().Any(c => c.HandbrakeApplied()) ? "Release " : "Set ")} Consist", SpriteName.Handbrake, delegate
{
CarInspector_PopulateCarPanel_Patch.MrocConsistHelper(car, MrocHelperType.Handbrake, buttonsHaveCost);
});
if (car.EnumerateCoupled().Any(c => c.EndAirSystemIssue()))
{
- shared.AddButton(ContextMenuQuadrant.Unused2, $"Air Up Consist", SpriteName.Select, delegate
+ shared.AddButton(ContextMenuQuadrant.Unused1, $"Air Up Consist", SpriteName.Select, delegate
{
CarInspector_PopulateCarPanel_Patch.MrocConsistHelper(car, MrocHelperType.GladhandAndAnglecock, buttonsHaveCost);
});
}
- if (car.EnumerateCoupled().Any(c => c.SupportsBleed()))
+ if (!car.EnumerateCoupled().Any(c => !c.SupportsBleed()))
{
shared.AddButton(ContextMenuQuadrant.Unused2, $"Bleed Consist", SpriteName.Bleed, delegate
{
@@ -43,11 +43,10 @@ internal class CarPickable_HandleShowContextMenu_Patch
});
}
- shared.AddButton(ContextMenuQuadrant.Unused2, $"Follow", SpriteName.Inspect, delegate
+ shared.AddButton(ContextMenuQuadrant.General, $"Follow", SpriteName.Inspect, delegate
{
CameraSelector.shared.FollowCar(car);
});
-
shared.BuildItemAngles();
shared.StartCoroutine(shared.AnimateButtonsShown());
}
diff --git a/TweaksAndThings/Patches/ContextMenu_PositionForItem_Patch.cs b/TweaksAndThings/Patches/ContextMenu_PositionForItem_Patch.cs
new file mode 100644
index 0000000..1bef1ed
--- /dev/null
+++ b/TweaksAndThings/Patches/ContextMenu_PositionForItem_Patch.cs
@@ -0,0 +1,25 @@
+using HarmonyLib;
+using Railloader;
+using System;
+using UI.ContextMenu;
+using UnityEngine;
+
+
+namespace RMROC451.TweaksAndThings.Patches;
+
+[HarmonyPatch(typeof(UI.ContextMenu.ContextMenu))]
+//ContextMenuQuadrant quadrant, int index, float normalizedRadius = 1f
+[HarmonyPatch(nameof(UI.ContextMenu.ContextMenu.PositionForItem), typeof(ContextMenuQuadrant), typeof(int), typeof(float))]
+[HarmonyPatchCategory("RMROC451TweaksAndThings")]
+internal class ContextMenu_PositionForItem_Patch
+{
+ static void Postfix(UI.ContextMenu.ContextMenu __instance, ref Vector2 __result, ContextMenuQuadrant quadrant, int index, float normalizedRadius = 1f)
+ {
+ TweaksAndThingsPlugin tweaksAndThings = SingletonPluginBase.Shared;
+ if (!tweaksAndThings.IsEnabled) return;
+
+ float num = __instance._itemAngles[(quadrant, index)] * ((float)Math.PI / 180f);
+ float num2 = __instance.radius * normalizedRadius;
+ __result = new Vector2(1.3f * Mathf.Sin(num) * num2, Mathf.Cos(num) * num2);
+ }
+}
diff --git a/TweaksAndThings/Patches/ContextMenu_Show_Patch.cs b/TweaksAndThings/Patches/ContextMenu_Show_Patch.cs
new file mode 100644
index 0000000..94f4406
--- /dev/null
+++ b/TweaksAndThings/Patches/ContextMenu_Show_Patch.cs
@@ -0,0 +1,128 @@
+using HarmonyLib;
+using Helpers;
+using Railloader;
+using Serilog;
+using System;
+using System.Collections.Generic;
+using UI;
+using UI.ContextMenu;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace RMROC451.TweaksAndThings.Patches;
+
+[HarmonyPatch(typeof(UI.ContextMenu.ContextMenu))]
+[HarmonyPatch(nameof(UI.ContextMenu.ContextMenu.Show), typeof(string))]
+[HarmonyPatchCategory("RMROC451TweaksAndThings")]
+internal class ContextMenu_Show_Patch
+{
+ static bool Prefix(UI.ContextMenu.ContextMenu __instance, string centerText)
+ {
+ TweaksAndThingsPlugin tweaksAndThings = SingletonPluginBase.Shared;
+ if (!tweaksAndThings.IsEnabled) return true;
+
+ if (!__instance.GetRootCanvas(out var rootCanvas))
+ {
+ Log.Warning("Couldn't get root canvas");
+ return true;
+ }
+ __instance.CancelHideCoroutine();
+ if (__instance.contentRectTransform.childCount >= 1) __instance.contentRectTransform.GetChild(0).DestroyAllChildren(); //YOINK DEM CIRCLES!
+ __instance.SetupTemplate(rootCanvas);
+ __instance.centerLabel.text = centerText;
+ Canvas componentInParent = ((Component)__instance.contentRectTransform).GetComponentInParent