mirror of
https://github.com/rmroc451/TweaksAndThings.git
synced 2025-12-16 09:19:37 -06:00
Merge pull request #40 from rmroc451/experimental-2024-6
Experimental 2024.6 to main
This commit is contained in:
7
Assembly.version
Normal file
7
Assembly.version
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<MajorVersion>1</MajorVersion>
|
||||||
|
<MinorVersion>2</MinorVersion>
|
||||||
|
<PatchVersion>6</PatchVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<Import Project="Paths.user" Condition="Exists('Paths.user')" />
|
<Import Project="Paths.user" Condition="Exists('Paths.user')" />
|
||||||
|
<Import Project="Assembly.version" Condition="Exists('Assembly.version')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net48</TargetFramework>
|
<TargetFramework>net48</TargetFramework>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
<!-- Folder we'll put the published zips into -->
|
<!-- Folder we'll put the published zips into -->
|
||||||
<PublishPath>../bin</PublishPath>
|
<PublishPath>../bin</PublishPath>
|
||||||
<ZipName>$(PublishPath)/$(AssemblyName)_$(AssemblyVersion).zip</ZipName>
|
<ZipName>$(PublishPath)/$(AssemblyName)_$(AssemblyVersion)_Experimental.zip</ZipName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Assure the output path exists -->
|
<!-- Assure the output path exists -->
|
||||||
|
|||||||
6
Paths.user.example
Normal file
6
Paths.user.example
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<!-- Directory that the game (Railroader.exe) is in -->
|
||||||
|
<GameDir></GameDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
|
|||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{452A23A6-81C8-49C6-A7EE-95FD9377F896}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{452A23A6-81C8-49C6-A7EE-95FD9377F896}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
.gitignore = .gitignore
|
.gitignore = .gitignore
|
||||||
|
Assembly.version = Assembly.version
|
||||||
Directory.Build.props = Directory.Build.props
|
Directory.Build.props = Directory.Build.props
|
||||||
Directory.Build.targets = Directory.Build.targets
|
Directory.Build.targets = Directory.Build.targets
|
||||||
Paths.user = Paths.user
|
Paths.user = Paths.user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Game.State;
|
using Game.State;
|
||||||
using Helpers;
|
using Helpers;
|
||||||
using Model.OpsNew;
|
using Model.Ops;
|
||||||
using Network;
|
using Network;
|
||||||
using RMROC451.TweaksAndThings.Extensions;
|
using RMROC451.TweaksAndThings.Extensions;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@@ -5,10 +5,17 @@
|
|||||||
"version": "$(AssemblyVersion)",
|
"version": "$(AssemblyVersion)",
|
||||||
"requires": [
|
"requires": [
|
||||||
{
|
{
|
||||||
"id": "railloader",
|
"id": "railroader",
|
||||||
"notBefore": "1.8.1"
|
"notBefore": "2024.6"
|
||||||
},
|
},
|
||||||
"Zamu.StrangeCustoms"
|
{
|
||||||
|
"id": "railloader",
|
||||||
|
"notBefore": "1.9.6.14"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Zamu.StrangeCustoms",
|
||||||
|
"notBefore": "1.10.25017.313"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"assemblies": [ "RMROC451.TweaksAndThings" ],
|
"assemblies": [ "RMROC451.TweaksAndThings" ],
|
||||||
"mixintos": {
|
"mixintos": {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using Game.State;
|
|||||||
using Helpers;
|
using Helpers;
|
||||||
using Model;
|
using Model;
|
||||||
using Model.Definition.Data;
|
using Model.Definition.Data;
|
||||||
using Model.OpsNew;
|
using Model.Ops;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -109,8 +109,7 @@ public static class Car_Extensions
|
|||||||
{
|
{
|
||||||
Vector3 position = car.GetMotionSnapshot().Position;
|
Vector3 position = car.GetMotionSnapshot().Position;
|
||||||
Vector3 center = WorldTransformer.WorldToGame(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.CarIdsInRadius(center, 60f);
|
||||||
var cars = tc.CarIdsInRect(rect);
|
|
||||||
Log.Information($"{nameof(HuntingForCabeeseNearCar)} => {cars.Count()}");
|
Log.Information($"{nameof(HuntingForCabeeseNearCar)} => {cars.Count()}");
|
||||||
List<(string carId, float distance)> source =
|
List<(string carId, float distance)> source =
|
||||||
cars
|
cars
|
||||||
|
|||||||
@@ -22,20 +22,20 @@ internal class CarPickable_HandleShowContextMenu_Patch
|
|||||||
|
|
||||||
bool buttonsHaveCost = tweaksAndThings.EndGearHelpersRequirePayment();
|
bool buttonsHaveCost = tweaksAndThings.EndGearHelpersRequirePayment();
|
||||||
ContextMenu shared = ContextMenu.Shared;
|
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);
|
CarInspector_PopulateCarPanel_Patch.MrocConsistHelper(car, MrocHelperType.Handbrake, buttonsHaveCost);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (car.EnumerateCoupled().Any(c => c.EndAirSystemIssue()))
|
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);
|
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
|
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);
|
CameraSelector.shared.FollowCar(car);
|
||||||
});
|
});
|
||||||
|
|
||||||
shared.BuildItemAngles();
|
shared.BuildItemAngles();
|
||||||
shared.StartCoroutine(shared.AnimateButtonsShown());
|
shared.StartCoroutine(shared.AnimateButtonsShown());
|
||||||
}
|
}
|
||||||
|
|||||||
25
TweaksAndThings/Patches/ContextMenu_PositionForItem_Patch.cs
Normal file
25
TweaksAndThings/Patches/ContextMenu_PositionForItem_Patch.cs
Normal file
@@ -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<TweaksAndThingsPlugin>.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
128
TweaksAndThings/Patches/ContextMenu_Show_Patch.cs
Normal file
128
TweaksAndThings/Patches/ContextMenu_Show_Patch.cs
Normal file
@@ -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<TweaksAndThingsPlugin>.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<Canvas>();
|
||||||
|
Vector3 mousePosition = Input.mousePosition;
|
||||||
|
Vector2 val = componentInParent.ScreenToCanvasPosition(mousePosition).XY();
|
||||||
|
Vector2 renderingDisplaySize = rootCanvas.renderingDisplaySize;
|
||||||
|
float num = __instance.radius + 50f;
|
||||||
|
if (val.x < num)
|
||||||
|
{
|
||||||
|
val.x = num;
|
||||||
|
}
|
||||||
|
if (val.x > renderingDisplaySize.x - num)
|
||||||
|
{
|
||||||
|
val.x = renderingDisplaySize.x - num;
|
||||||
|
}
|
||||||
|
if (val.y < num)
|
||||||
|
{
|
||||||
|
val.y = num;
|
||||||
|
}
|
||||||
|
if (val.y > renderingDisplaySize.y - num)
|
||||||
|
{
|
||||||
|
val.y = renderingDisplaySize.y - num;
|
||||||
|
}
|
||||||
|
__instance.contentRectTransform.anchoredPosition = val;
|
||||||
|
__instance.BuildItemAngles();
|
||||||
|
|
||||||
|
((MonoBehaviour)__instance).StartCoroutine(__instance.AnimateButtonsShown());
|
||||||
|
((Component)__instance.contentRectTransform).gameObject.SetActive(true);
|
||||||
|
UI.ContextMenu.ContextMenu.IsShown = true;
|
||||||
|
__instance._blocker = __instance.CreateBlocker(rootCanvas);
|
||||||
|
GameInput.RegisterEscapeHandler(GameInput.EscapeHandler.Transient, delegate
|
||||||
|
{
|
||||||
|
__instance.Hide();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HarmonyPatch(typeof(UI.ContextMenu.ContextMenu))]
|
||||||
|
[HarmonyPatch(nameof(UI.ContextMenu.ContextMenu.DefaultAngleForItem), typeof(ContextMenuQuadrant), typeof(int), typeof(int))]
|
||||||
|
[HarmonyPatchCategory("RMROC451TweaksAndThings")]
|
||||||
|
internal class ContextMenu_DefaultAngleForItem_Patch
|
||||||
|
{
|
||||||
|
static bool Prefix(UI.ContextMenu.ContextMenu __instance, ref float __result, ContextMenuQuadrant quadrant, int index, int quadrantItemCount)
|
||||||
|
{
|
||||||
|
TweaksAndThingsPlugin tweaksAndThings = SingletonPluginBase<TweaksAndThingsPlugin>.Shared;
|
||||||
|
if (!tweaksAndThings.IsEnabled) return true;
|
||||||
|
|
||||||
|
|
||||||
|
int num = quadrant switch
|
||||||
|
{
|
||||||
|
ContextMenuQuadrant.General => 0,
|
||||||
|
ContextMenuQuadrant.Unused1 => 90,
|
||||||
|
ContextMenuQuadrant.Brakes => 180,
|
||||||
|
ContextMenuQuadrant.Unused2 => -90,
|
||||||
|
_ => throw new ArgumentOutOfRangeException("quadrant", quadrant, null),
|
||||||
|
};
|
||||||
|
if (quadrantItemCount <= 1)
|
||||||
|
{
|
||||||
|
__result = num;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
int num2 = ((quadrantItemCount <= 3) ? 30 : (90 / (quadrantItemCount - 1)));
|
||||||
|
__result = (float)num + -0.5f * (float)((quadrantItemCount - 1) * num2) + (float)(num2 * index);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HarmonyPatch(typeof(UI.ContextMenu.ContextMenu))]
|
||||||
|
[HarmonyPatch(nameof(UI.ContextMenu.ContextMenu.AddButton), typeof(ContextMenuQuadrant), typeof(string), typeof(Sprite), typeof(Action))]
|
||||||
|
[HarmonyPatchCategory("RMROC451TweaksAndThings")]
|
||||||
|
internal class ContextMenu_AddButton_Patch
|
||||||
|
{
|
||||||
|
static bool Prefix(UI.ContextMenu.ContextMenu __instance, ContextMenuQuadrant quadrant, string title, Sprite sprite, Action action)
|
||||||
|
{
|
||||||
|
TweaksAndThingsPlugin tweaksAndThings = SingletonPluginBase<TweaksAndThingsPlugin>.Shared;
|
||||||
|
if (!tweaksAndThings.IsEnabled) return true;
|
||||||
|
|
||||||
|
|
||||||
|
List<ContextMenuItem> list = __instance._quadrants[(int)quadrant];
|
||||||
|
int index = list.Count;
|
||||||
|
ContextMenuItem contextMenuItem = UnityEngine.Object.Instantiate<ContextMenuItem>(__instance.itemPrefab, (Transform)(object)__instance.contentRectTransform);
|
||||||
|
contextMenuItem.image.sprite = sprite;
|
||||||
|
contextMenuItem.label.text = title;
|
||||||
|
contextMenuItem.OnClick = delegate
|
||||||
|
{
|
||||||
|
action();
|
||||||
|
__instance.Hide((quadrant, index));
|
||||||
|
};
|
||||||
|
((Component)contextMenuItem).gameObject.AddComponent<LayoutElement>().preferredHeight = 30f;
|
||||||
|
list.Add(contextMenuItem);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using Model;
|
using Model;
|
||||||
using Model.Definition.Data;
|
using Model.Definition.Data;
|
||||||
using Model.OpsNew;
|
using Model.Ops;
|
||||||
using Railloader;
|
using Railloader;
|
||||||
using RMROC451.TweaksAndThings.Extensions;
|
using RMROC451.TweaksAndThings.Extensions;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using HarmonyLib;
|
|||||||
using Model;
|
using Model;
|
||||||
using Model.Definition.Data;
|
using Model.Definition.Data;
|
||||||
using Model.Ops.Definition;
|
using Model.Ops.Definition;
|
||||||
using Model.OpsNew;
|
using Model.Ops;
|
||||||
using Network;
|
using Network;
|
||||||
using Railloader;
|
using Railloader;
|
||||||
using RMROC451.TweaksAndThings.Extensions;
|
using RMROC451.TweaksAndThings.Extensions;
|
||||||
@@ -50,7 +50,8 @@ internal class CarPrototypeLibrary_LoadForId_Patch
|
|||||||
[HarmonyPatchCategory("RMROC451TweaksAndThings")]
|
[HarmonyPatchCategory("RMROC451TweaksAndThings")]
|
||||||
internal class OpsController_AnnounceCoalescedPayments_Patch
|
internal class OpsController_AnnounceCoalescedPayments_Patch
|
||||||
{
|
{
|
||||||
static Dictionary<string, (bool spotted, bool filling)> CrewCarDict = [];
|
static Dictionary<string, (bool spotted, bool filling)> CrewCarDict = new();
|
||||||
|
|
||||||
public static (bool spotted, bool filling) CrewCarStatus(Car car)
|
public static (bool spotted, bool filling) CrewCarStatus(Car car)
|
||||||
{
|
{
|
||||||
bool found = CrewCarDict.TryGetValue(car.id, out (bool spotted, bool filling) val);
|
bool found = CrewCarDict.TryGetValue(car.id, out (bool spotted, bool filling) val);
|
||||||
@@ -61,12 +62,13 @@ internal class OpsController_AnnounceCoalescedPayments_Patch
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GameDateTime dateTime = TimeWeather.Now;
|
static GameDateTime dateTime = TimeWeather.Now;
|
||||||
static readonly IEnumerable<Type> refillLocations = [
|
static readonly IEnumerable<Type> refillLocations =
|
||||||
|
new List<Type>() {
|
||||||
typeof(PassengerStop),
|
typeof(PassengerStop),
|
||||||
typeof(SimplePassengerStop),
|
typeof(SimplePassengerStop),
|
||||||
typeof(TeamTrack),
|
typeof(TeamTrack),
|
||||||
typeof(RepairTrack)
|
typeof(RepairTrack)
|
||||||
];
|
};
|
||||||
|
|
||||||
public static Load CrewHoursLoad()
|
public static Load CrewHoursLoad()
|
||||||
{
|
{
|
||||||
@@ -116,7 +118,7 @@ internal class OpsController_AnnounceCoalescedPayments_Patch
|
|||||||
//Log.Information($"{nameof(OpsController_AnnounceCoalescedPayments_Patch)} => Caboose Helper => PassengerStops => {string.Join(",", passengerStops)}");
|
//Log.Information($"{nameof(OpsController_AnnounceCoalescedPayments_Patch)} => Caboose Helper => PassengerStops => {string.Join(",", passengerStops)}");
|
||||||
|
|
||||||
var cabeese = passengerStops
|
var cabeese = passengerStops
|
||||||
.SelectMany(t => t.TrackSpans?.Select(s => (tc.CarsOnSpan(s) ?? []).Where(c => c.IsCaboose()))?.SelectMany(c => c?.Select(c2 => (t, c2))));
|
.SelectMany(t => t.TrackSpans?.Select(s => (tc.CarsOnSpan(s) ?? Enumerable.Empty<Car>()).Where(c => c.IsCaboose()))?.SelectMany(c => c?.Select(c2 => (t, c2))));
|
||||||
//Log.Information($"{nameof(OpsController_AnnounceCoalescedPayments_Patch)} => Caboose Helper => PassengerStops Cabeese => {string.Join(",", cabeese?.Select(c => $"{c.t} : {c.c2}") ?? [])}");
|
//Log.Information($"{nameof(OpsController_AnnounceCoalescedPayments_Patch)} => Caboose Helper => PassengerStops Cabeese => {string.Join(",", cabeese?.Select(c => $"{c.t} : {c.c2}") ?? [])}");
|
||||||
|
|
||||||
CrewCarDict = CrewCarDict.Where(kvp => cabeese.Select(c => c.c2.id).Contains(kvp.Key)).ToDictionary(k => k.Key, v => v.Value);
|
CrewCarDict = CrewCarDict.Where(kvp => cabeese.Select(c => c.c2.id).Contains(kvp.Key)).ToDictionary(k => k.Key, v => v.Value);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using Model;
|
using Model;
|
||||||
using Model.OpsNew;
|
using Model.Ops;
|
||||||
using Railloader;
|
using Railloader;
|
||||||
using RMROC451.TweaksAndThings.Extensions;
|
using RMROC451.TweaksAndThings.Extensions;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -34,7 +34,7 @@ internal class TagController_UpdateTag_Patch
|
|||||||
private static void ProceedWithPostFix(Car car, TagCallout tagCallout)
|
private static void ProceedWithPostFix(Car car, TagCallout tagCallout)
|
||||||
{
|
{
|
||||||
tagCallout.callout.Title = string.Format(tagTitleFormat, "{0}", car.DisplayName);
|
tagCallout.callout.Title = string.Format(tagTitleFormat, "{0}", car.DisplayName);
|
||||||
List<string> tags = [];
|
List<string> tags = new();
|
||||||
|
|
||||||
if (OpsController_AnnounceCoalescedPayments_Patch.CrewCarStatus(car).spotted) tags.Add("+");
|
if (OpsController_AnnounceCoalescedPayments_Patch.CrewCarStatus(car).spotted) tags.Add("+");
|
||||||
if (car.HasHotbox) tags.Add(TextSprites.Hotbox);
|
if (car.HasHotbox) tags.Add(TextSprites.Hotbox);
|
||||||
|
|||||||
20
TweaksAndThings/Patches/WedgeImage_OnPopulateMesh.cs
Normal file
20
TweaksAndThings/Patches/WedgeImage_OnPopulateMesh.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
using Railloader;
|
||||||
|
using UI.ContextMenu;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace RMROC451.TweaksAndThings.Patches;
|
||||||
|
|
||||||
|
[HarmonyPatch(typeof(WedgeImage))]
|
||||||
|
[HarmonyPatch(nameof(WedgeImage.OnPopulateMesh), typeof(VertexHelper))]
|
||||||
|
[HarmonyPatchCategory("RMROC451TweaksAndThings")]
|
||||||
|
internal class WedgeImage_OnPopulateMesh_Patch
|
||||||
|
{
|
||||||
|
private static void Postfix(VertexHelper vh)
|
||||||
|
{
|
||||||
|
TweaksAndThingsPlugin tweaksAndThings = SingletonPluginBase<TweaksAndThingsPlugin>.Shared;
|
||||||
|
if (!tweaksAndThings.IsEnabled) return;
|
||||||
|
|
||||||
|
vh.Clear(); //clear the image backgrounds for now.
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user