Code updates

This commit is contained in:
pan.codes 2025-06-08 21:40:03 +02:00
parent a430310324
commit 393de5e06a
14 changed files with 216 additions and 31 deletions

View file

@ -0,0 +1,7 @@
using HarmonyLib;
using TurnTheGameOn.SimpleTrafficSystem;
namespace SpacemarketSimulator.Patches
{
[HarmonyPatch(typeof(AITrafficLight), "EnableGreenLight")] public static class AITrafficLight_EnableGreenLight_Patch { public static void Postfix(AITrafficLight __instance) => __instance.DisableAllLights(); }
}

View file

@ -0,0 +1,7 @@
using HarmonyLib;
using TurnTheGameOn.SimpleTrafficSystem;
namespace SpacemarketSimulator.Patches
{
[HarmonyPatch(typeof(AITrafficLight), "EnableRedLight")] public static class AITrafficLight_EnableRedLight_Patch { public static void Postfix(AITrafficLight __instance) => __instance.DisableAllLights(); }
}

View file

@ -0,0 +1,7 @@
using HarmonyLib;
using TurnTheGameOn.SimpleTrafficSystem;
namespace SpacemarketSimulator.Patches
{
[HarmonyPatch(typeof(AITrafficLight), "EnableYellowLight")] public static class AITrafficLight_EnableYellowLight_Patch { public static void Postfix(AITrafficLight __instance) => __instance.DisableAllLights(); }
}

View file

@ -0,0 +1,14 @@
using Cinemachine;
using HarmonyLib;
namespace SpacemarketSimulator.Patches
{
[HarmonyPatch(typeof(CinemachineVirtualCamera), "CalculateNewState")]
public static class CinemachineVirtualCamera_CalculateNewState_Patch
{
public static void Postfix(ref CameraState __result)
{
__result.Lens.FarClipPlane = 1500;
}
}
}

View file

@ -0,0 +1,21 @@
using HarmonyLib;
using System;
using UnityEngine;
using UnityEngine.UI;
namespace SpacemarketSimulator.Patches
{
[HarmonyPatch(typeof(MainMenuManager), "Awake")]
public static class MainMenuManager_Awake_Patch
{
public static void Postfix(MainMenuManager __instance)
{
var bg = new Texture2D(1920, 1080);
bg.LoadImage(Properties.Resources.bg);
var image = __instance.gameObject.transform.GetChild(0).gameObject.GetComponent<Image>();
Console.WriteLine(image == null);
image.sprite = Sprite.Create(bg, new Rect(0, 0, bg.width, bg.height), new Vector2(0.5f, 0.5f)); ;
__instance.gameObject.transform.GetChild(1).gameObject.SetActive(false);
}
}
}

View file

@ -0,0 +1,16 @@
using HarmonyLib;
using System.Linq;
namespace SpacemarketSimulator.Patches
{
[HarmonyPatch(typeof(NPCTrafficManager), "SpawnNPC")]
public static class NPCTrafficManager_SpawnNPC_Patch
{
public static void Postfix(NPCTrafficManager __instance)
{
WaypointNavigator npc = __instance.m_ActiveNPCs.Last();
npc.gameObject.SetActive(false);
}
}
}

View file

@ -0,0 +1,13 @@
using HarmonyLib;
namespace SpacemarketSimulator.Patches
{
[HarmonyPatch(typeof(SectionManager), "UpgradeStore")]
public static class SectionManager_UpgradeStore_Patch
{
public static void Postfix()
{
//Plugin.DisableStandardEnvironment();
}
}
}