Compare commits
3 Commits
9f8164ba59
...
8634792e2b
| Author | SHA1 | Date | |
|---|---|---|---|
| 8634792e2b | |||
| 84fb3ad4fd | |||
| 8ef5bfbe21 |
@@ -1,3 +0,0 @@
|
||||
[submodule "plugins/DataCenter-RustBridge"]
|
||||
path = plugins/DataCenter-RustBridge
|
||||
url = https://github.com/mleem97/DataCenter-RustBridge.git
|
||||
@@ -15,6 +15,7 @@
|
||||
- **Harmony Patches** - MainMenu, MODS Button injection
|
||||
- **IL2CPP Compatibility** - InputSystem, Coroutines, Il2CppTMPro
|
||||
- **MoonSharp Lua** - Embedded scripting engine
|
||||
- **Integrated DataCenter Compatibility Layer** - RustBridge/LangCompat runtime is embedded in-core under `src/Compatibility/DataCenterModLoader`
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -24,7 +25,14 @@
|
||||
|
||||
## Dependencies
|
||||
|
||||
- None (this IS the core)
|
||||
- Built-in only (this IS the core)
|
||||
- Legacy `RustBridge` and `LangCompatBridge` are integrated into `gregCore` and are no longer shipped as standalone external plugin/mod dependencies
|
||||
|
||||
## Architecture Update
|
||||
|
||||
- Legacy external trees `plugins/DataCenter-RustBridge` and `mods/greg.Plugin.LangCompatBridge` were retired from `gregCore`
|
||||
- Runtime compatibility lifecycle is now wired directly from `GregCoreMod` to `DataCenterModLoader.Core`
|
||||
- Compatibility sources are maintained in-core at `src/Compatibility/DataCenterModLoader`
|
||||
|
||||
## Building from Source
|
||||
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,379 @@
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
using greg.Core;
|
||||
using greg.Sdk;
|
||||
using Il2Cpp;
|
||||
using Il2CppSystem.Collections.Generic;
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace gregFramework.Hooks;
|
||||
|
||||
/// <summary>
|
||||
/// Harmony hooks for domain Customer (generated from Il2Cpp unpack).
|
||||
/// </summary>
|
||||
[HarmonyPatch]
|
||||
internal static class GregCustomerHooks
|
||||
{
|
||||
// CustomerBase.Awake
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.Awake))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseAwake(CustomerBase __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseAwake failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.Start
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.Start))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseStart(CustomerBase __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseStart failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.GetEffectiveMoneySpeed
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.GetEffectiveMoneySpeed))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseGetEffectiveMoneySpeed(CustomerBase __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "GetEffectiveMoneySpeed"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseGetEffectiveMoneySpeed failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.AreAllAppRequirementsMet
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.AreAllAppRequirementsMet))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseAreAllAppRequirementsMet(CustomerBase __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "AreAllAppRequirementsMet"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseAreAllAppRequirementsMet failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.UpdateCustomerServerCountAndSpeed
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.UpdateCustomerServerCountAndSpeed))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseUpdateCustomerServerCountAndSpeed(CustomerBase __instance, int count, float speed)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "CustomerServerCountAndSpeedChanged"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseUpdateCustomerServerCountAndSpeed failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.AddAppPerformance
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.AddAppPerformance))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseAddAppPerformance(CustomerBase __instance, int appID, float speed)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "AppPerformanceAdded"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseAddAppPerformance failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.ResetAllAppSpeeds
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.ResetAllAppSpeeds))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseResetAllAppSpeeds(CustomerBase __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "ResetAllAppSpeeds"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseResetAllAppSpeeds failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.IsIPPresent
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.IsIPPresent))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseIsIPPresent(CustomerBase __instance, string ip)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "IsIPPresent"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseIsIPPresent failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.GetAppIDForIP
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.GetAppIDForIP))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseGetAppIDForIP(CustomerBase __instance, string ip)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "GetAppIDForIP"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseGetAppIDForIP failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.SetUpBase
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.SetUpBase))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseSetUpBase(CustomerBase __instance, CustomerItem customerItem, CustomerBaseSaveData saveData)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "UpBaseSet"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseSetUpBase failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.SetUpApp
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.SetUpApp))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseSetUpApp(CustomerBase __instance, int appID, int difficulty, CustomerBaseSaveData saveData)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "UpAppSet"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseSetUpApp failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.AppText
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.AppText))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseAppText(CustomerBase __instance, int lastUsedApp)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "AppText"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseAppText failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.UpdateSpeedOnCustomerBaseApp
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.UpdateSpeedOnCustomerBaseApp))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseUpdateSpeedOnCustomerBaseApp(CustomerBase __instance, int appID, float speed)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "SpeedOnCustomerBaseAppChanged"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseUpdateSpeedOnCustomerBaseApp failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.GetSubnetsPerApp
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.GetSubnetsPerApp))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseGetSubnetsPerApp(CustomerBase __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "GetSubnetsPerApp"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseGetSubnetsPerApp failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.GetVlanIdsPerApp
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.GetVlanIdsPerApp))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseGetVlanIdsPerApp(CustomerBase __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "GetVlanIdsPerApp"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseGetVlanIdsPerApp failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.GetServerTypeForIP
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.GetServerTypeForIP))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseGetServerTypeForIP(CustomerBase __instance, string ip)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "GetServerTypeForIP"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseGetServerTypeForIP failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.GetTotalAppSpeed
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.GetTotalAppSpeed))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseGetTotalAppSpeed(CustomerBase __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "GetTotalAppSpeed"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseGetTotalAppSpeed failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// CustomerBase.LoadData
|
||||
[HarmonyPatch(typeof(CustomerBase), nameof(CustomerBase.LoadData))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnCustomerBaseLoadData(CustomerBase __instance, CustomerBaseSaveData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Customer, "DataLoaded"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnCustomerBaseLoadData failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,579 @@
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
using greg.Core;
|
||||
using greg.Sdk;
|
||||
using Il2Cpp;
|
||||
using Il2CppSystem.Collections.Generic;
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace gregFramework.Hooks;
|
||||
|
||||
/// <summary>
|
||||
/// Harmony hooks for domain Employee (generated from Il2Cpp unpack).
|
||||
/// </summary>
|
||||
[HarmonyPatch]
|
||||
internal static class GregEmployeeHooks
|
||||
{
|
||||
// HRSystem.OnEnable
|
||||
[HarmonyPatch(typeof(HRSystem), nameof(HRSystem.OnEnable))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnHRSystemOnEnable(HRSystem __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnHRSystemOnEnable failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// HRSystem.ButtonHireEmployee
|
||||
[HarmonyPatch(typeof(HRSystem), nameof(HRSystem.ButtonHireEmployee))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnHRSystemButtonHireEmployee(HRSystem __instance, int i)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "ButtonHireEmployee"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnHRSystemButtonHireEmployee failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// HRSystem.ButtonCancelBuying
|
||||
[HarmonyPatch(typeof(HRSystem), nameof(HRSystem.ButtonCancelBuying))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnHRSystemButtonCancelBuying(HRSystem __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "ButtonCancelBuying"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnHRSystemButtonCancelBuying failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// HRSystem.ButtonConfirmHire
|
||||
[HarmonyPatch(typeof(HRSystem), nameof(HRSystem.ButtonConfirmHire))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnHRSystemButtonConfirmHire(HRSystem __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "ButtonConfirmHire"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnHRSystemButtonConfirmHire failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// HRSystem.ButtonFireEmployee
|
||||
[HarmonyPatch(typeof(HRSystem), nameof(HRSystem.ButtonFireEmployee))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnHRSystemButtonFireEmployee(HRSystem __instance, int i)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "ButtonFireEmployee"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnHRSystemButtonFireEmployee failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// HRSystem.ButtonConfirmFireEmployee
|
||||
[HarmonyPatch(typeof(HRSystem), nameof(HRSystem.ButtonConfirmFireEmployee))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnHRSystemButtonConfirmFireEmployee(HRSystem __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "ButtonConfirmFireEmployee"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnHRSystemButtonConfirmFireEmployee failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Technician.Awake
|
||||
[HarmonyPatch(typeof(Technician), nameof(Technician.Awake))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianAwake(Technician __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianAwake failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Technician.Start
|
||||
[HarmonyPatch(typeof(Technician), nameof(Technician.Start))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianStart(Technician __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianStart failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Technician.AssignJob
|
||||
[HarmonyPatch(typeof(Technician), nameof(Technician.AssignJob))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianAssignJob(Technician __instance, TechnicianManager.RepairJob job)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "AssignJob"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianAssignJob failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Technician.GetCurrentDevicePrefabID
|
||||
[HarmonyPatch(typeof(Technician), nameof(Technician.GetCurrentDevicePrefabID))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianGetCurrentDevicePrefabID(Technician __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "GetCurrentDevicePrefabID"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianGetCurrentDevicePrefabID failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Technician.RepairDevice
|
||||
[HarmonyPatch(typeof(Technician), nameof(Technician.RepairDevice))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianRepairDevice(Technician __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "DeviceRepaired"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianRepairDevice failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Technician.GetCorrectDevicePrefab
|
||||
[HarmonyPatch(typeof(Technician), nameof(Technician.GetCorrectDevicePrefab))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianGetCorrectDevicePrefab(Technician __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "GetCorrectDevicePrefab"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianGetCorrectDevicePrefab failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Technician.RotateTowardsGoal
|
||||
[HarmonyPatch(typeof(Technician), nameof(Technician.RotateTowardsGoal))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianRotateTowardsGoal(Technician __instance, Vector3 goal)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "RotateTowardsGoal"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianRotateTowardsGoal failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Technician.PositionHandTargetsOnDevice
|
||||
[HarmonyPatch(typeof(Technician), nameof(Technician.PositionHandTargetsOnDevice))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianPositionHandTargetsOnDevice(Technician __instance, GameObject device)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "PositionHandTargetsOnDevice"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianPositionHandTargetsOnDevice failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Technician.OnLoadingStarted
|
||||
[HarmonyPatch(typeof(Technician), nameof(Technician.OnLoadingStarted))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianOnLoadingStarted(Technician __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "OnLoadingStarted"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianOnLoadingStarted failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Technician.OnDestroy
|
||||
[HarmonyPatch(typeof(Technician), nameof(Technician.OnDestroy))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianOnDestroy(Technician __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "OnDestroy"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianOnDestroy failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// TechnicianManager.Awake
|
||||
[HarmonyPatch(typeof(TechnicianManager), nameof(TechnicianManager.Awake))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianManagerAwake(TechnicianManager __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianManagerAwake failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// TechnicianManager.AddTechnician
|
||||
[HarmonyPatch(typeof(TechnicianManager), nameof(TechnicianManager.AddTechnician))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianManagerAddTechnician(TechnicianManager __instance, Technician technician)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "Hired"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianManagerAddTechnician failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// TechnicianManager.SendTechnician
|
||||
[HarmonyPatch(typeof(TechnicianManager), nameof(TechnicianManager.SendTechnician))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianManagerSendTechnician(TechnicianManager __instance, NetworkSwitch networkSwitch, Server server)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "Dispatched"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianManagerSendTechnician failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// TechnicianManager.RequestNextJob
|
||||
[HarmonyPatch(typeof(TechnicianManager), nameof(TechnicianManager.RequestNextJob))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianManagerRequestNextJob(TechnicianManager __instance, Technician technician)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "NextJobRequested"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianManagerRequestNextJob failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// TechnicianManager.EnqueueDispatch
|
||||
[HarmonyPatch(typeof(TechnicianManager), nameof(TechnicianManager.EnqueueDispatch))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianManagerEnqueueDispatch(TechnicianManager __instance, TechnicianManager.RepairJob job)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "JobQueued"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianManagerEnqueueDispatch failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// TechnicianManager.IsDeviceAlreadyAssigned
|
||||
[HarmonyPatch(typeof(TechnicianManager), nameof(TechnicianManager.IsDeviceAlreadyAssigned))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianManagerIsDeviceAlreadyAssigned(TechnicianManager __instance, NetworkSwitch networkSwitch, Server server)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "IsDeviceAlreadyAssigned"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianManagerIsDeviceAlreadyAssigned failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// TechnicianManager.RestoreJobQueue
|
||||
[HarmonyPatch(typeof(TechnicianManager), nameof(TechnicianManager.RestoreJobQueue))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianManagerRestoreJobQueue(TechnicianManager __instance, Il2CppSystem.Collections.Generic.List<RepairJobSaveData> savedJobs)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "JobQueueLoaded"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianManagerRestoreJobQueue failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// TechnicianManager.FireTechnician
|
||||
[HarmonyPatch(typeof(TechnicianManager), nameof(TechnicianManager.FireTechnician))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianManagerFireTechnician(TechnicianManager __instance, int technicianID)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "Fired"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianManagerFireTechnician failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// TechnicianManager.OpenDumpsterArea
|
||||
[HarmonyPatch(typeof(TechnicianManager), nameof(TechnicianManager.OpenDumpsterArea))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianManagerOpenDumpsterArea(TechnicianManager __instance, int areaID)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "OpenDumpsterArea"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianManagerOpenDumpsterArea failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// TechnicianManager.GetClosestOpenedDumpsterIndex
|
||||
[HarmonyPatch(typeof(TechnicianManager), nameof(TechnicianManager.GetClosestOpenedDumpsterIndex))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianManagerGetClosestOpenedDumpsterIndex(TechnicianManager __instance, Vector3 position)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "GetClosestOpenedDumpsterIndex"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianManagerGetClosestOpenedDumpsterIndex failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// TechnicianManager.OnDestroy
|
||||
[HarmonyPatch(typeof(TechnicianManager), nameof(TechnicianManager.OnDestroy))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianManagerOnDestroy(TechnicianManager __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "OnDestroy"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianManagerOnDestroy failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// TechnicianManager.OnLoadingStarted
|
||||
[HarmonyPatch(typeof(TechnicianManager), nameof(TechnicianManager.OnLoadingStarted))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnTechnicianManagerOnLoadingStarted(TechnicianManager __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Employee, "OnLoadingStarted"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnTechnicianManagerOnLoadingStarted failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
using greg.Core;
|
||||
using greg.Sdk;
|
||||
using Il2Cpp;
|
||||
using Il2CppSystem.Collections.Generic;
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace gregFramework.Hooks;
|
||||
|
||||
/// <summary>
|
||||
/// Harmony hooks for domain Gameplay (generated from Il2Cpp unpack).
|
||||
/// </summary>
|
||||
[HarmonyPatch]
|
||||
internal static class GregGameplayHooks
|
||||
{
|
||||
// Objectives.Awake
|
||||
[HarmonyPatch(typeof(Objectives), nameof(Objectives.Awake))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnObjectivesAwake(Objectives __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Gameplay, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnObjectivesAwake failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Objectives.Start
|
||||
[HarmonyPatch(typeof(Objectives), nameof(Objectives.Start))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnObjectivesStart(Objectives __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Gameplay, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnObjectivesStart failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Objectives.GetTimedObjective
|
||||
[HarmonyPatch(typeof(Objectives), nameof(Objectives.GetTimedObjective))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnObjectivesGetTimedObjective(Objectives __instance, int objectiveUID)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Gameplay, "GetTimedObjective"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnObjectivesGetTimedObjective failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Objectives.IsTutorialInProgress
|
||||
[HarmonyPatch(typeof(Objectives), nameof(Objectives.IsTutorialInProgress))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnObjectivesIsTutorialInProgress(Objectives __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Gameplay, "IsTutorialInProgress"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnObjectivesIsTutorialInProgress failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Objectives.CreateAppObjective
|
||||
[HarmonyPatch(typeof(Objectives), nameof(Objectives.CreateAppObjective))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnObjectivesCreateAppObjective(Objectives __instance, int customerID, int appID, int time, int requiredIOPS)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Gameplay, "CreateAppObjective"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnObjectivesCreateAppObjective failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Objectives.ObjectiveTimedText
|
||||
[HarmonyPatch(typeof(Objectives), nameof(Objectives.ObjectiveTimedText))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnObjectivesObjectiveTimedText(Objectives __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Gameplay, "ObjectiveTimedText"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnObjectivesObjectiveTimedText failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Objectives.DestroyObjective
|
||||
[HarmonyPatch(typeof(Objectives), nameof(Objectives.DestroyObjective))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnObjectivesDestroyObjective(Objectives __instance, int _objectiveUID)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Gameplay, "DestroyObjective"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnObjectivesDestroyObjective failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Objectives.ClearObjectives
|
||||
[HarmonyPatch(typeof(Objectives), nameof(Objectives.ClearObjectives))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnObjectivesClearObjectives(Objectives __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Gameplay, "ClearObjectives"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnObjectivesClearObjectives failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Objectives.StartObjective
|
||||
[HarmonyPatch(typeof(Objectives), nameof(Objectives.StartObjective))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnObjectivesStartObjective(Objectives __instance, int _objectiveUID, Vector3 objectivePosition, bool _loadSave)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Gameplay, "StartObjective"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnObjectivesStartObjective failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Objectives.InstantiateObjectiveSign
|
||||
[HarmonyPatch(typeof(Objectives), nameof(Objectives.InstantiateObjectiveSign))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnObjectivesInstantiateObjectiveSign(Objectives __instance, int objectiveUID, Vector3 objectPos)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Gameplay, "InstantiateObjectiveSign"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnObjectivesInstantiateObjectiveSign failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Objectives.RemoveObjectiveSign
|
||||
[HarmonyPatch(typeof(Objectives), nameof(Objectives.RemoveObjectiveSign))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnObjectivesRemoveObjectiveSign(Objectives __instance, int objectiveUID)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Gameplay, "ObjectiveSignRemoved"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnObjectivesRemoveObjectiveSign failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Objectives.OnDestroy
|
||||
[HarmonyPatch(typeof(Objectives), nameof(Objectives.OnDestroy))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnObjectivesOnDestroy(Objectives __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Gameplay, "OnDestroy"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnObjectivesOnDestroy failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Objectives.OnLoad
|
||||
[HarmonyPatch(typeof(Objectives), nameof(Objectives.OnLoad))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnObjectivesOnLoad(Objectives __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Gameplay, "OnLoad"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnObjectivesOnLoad failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,355 @@
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
using greg.Core;
|
||||
using greg.Sdk;
|
||||
using Il2Cpp;
|
||||
using Il2CppSystem.Collections.Generic;
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace gregFramework.Hooks;
|
||||
|
||||
/// <summary>
|
||||
/// Harmony hooks for domain Player (generated from Il2Cpp unpack).
|
||||
/// </summary>
|
||||
[HarmonyPatch]
|
||||
internal static class GregPlayerHooks
|
||||
{
|
||||
// Player.Start
|
||||
[HarmonyPatch(typeof(Player), nameof(Player.Start))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerStart(Player __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
money = __instance.money,
|
||||
reputation = __instance.reputation,
|
||||
xp = __instance.xp,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerStart failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Player.CheckFallsThroughMap
|
||||
[HarmonyPatch(typeof(Player), nameof(Player.CheckFallsThroughMap))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerCheckFallsThroughMap(Player __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "CheckFallsThroughMap"),
|
||||
new
|
||||
{
|
||||
money = __instance.money,
|
||||
reputation = __instance.reputation,
|
||||
xp = __instance.xp,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerCheckFallsThroughMap failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Player.LoadPlayer
|
||||
[HarmonyPatch(typeof(Player), nameof(Player.LoadPlayer))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerLoadPlayer(Player __instance, PlayerData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "Loaded"),
|
||||
new
|
||||
{
|
||||
money = __instance.money,
|
||||
reputation = __instance.reputation,
|
||||
xp = __instance.xp,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerLoadPlayer failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Player.UpdateCoin
|
||||
[HarmonyPatch(typeof(Player), nameof(Player.UpdateCoin))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerUpdateCoin(Player __instance, float _coinChhangeAmount, bool withoutSound)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "MoneyChanged"),
|
||||
new
|
||||
{
|
||||
money = __instance.money,
|
||||
reputation = __instance.reputation,
|
||||
xp = __instance.xp,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerUpdateCoin failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Player.DropAllItems
|
||||
[HarmonyPatch(typeof(Player), nameof(Player.DropAllItems))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerDropAllItems(Player __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "DroppedAllItems"),
|
||||
new
|
||||
{
|
||||
money = __instance.money,
|
||||
reputation = __instance.reputation,
|
||||
xp = __instance.xp,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerDropAllItems failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Player.WarpPlayer
|
||||
[HarmonyPatch(typeof(Player), nameof(Player.WarpPlayer))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerWarpPlayer(Player __instance, Vector3 _position, Quaternion _rotation)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "Warped"),
|
||||
new
|
||||
{
|
||||
money = __instance.money,
|
||||
reputation = __instance.reputation,
|
||||
xp = __instance.xp,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerWarpPlayer failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Player.UpdateReputation
|
||||
[HarmonyPatch(typeof(Player), nameof(Player.UpdateReputation))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerUpdateReputation(Player __instance, float amount)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "ReputationChanged"),
|
||||
new
|
||||
{
|
||||
money = __instance.money,
|
||||
reputation = __instance.reputation,
|
||||
xp = __instance.xp,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerUpdateReputation failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Player.UpdateXP
|
||||
[HarmonyPatch(typeof(Player), nameof(Player.UpdateXP))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerUpdateXP(Player __instance, float amount)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "XpChanged"),
|
||||
new
|
||||
{
|
||||
money = __instance.money,
|
||||
reputation = __instance.reputation,
|
||||
xp = __instance.xp,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerUpdateXP failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// PlayerHit.OnEnable
|
||||
[HarmonyPatch(typeof(PlayerHit), nameof(PlayerHit.OnEnable))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerHitOnEnable(PlayerHit __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerHitOnEnable failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// PlayerManager.Awake
|
||||
[HarmonyPatch(typeof(PlayerManager), nameof(PlayerManager.Awake))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerManagerAwake(PlayerManager __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerManagerAwake failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// PlayerManager.Start
|
||||
[HarmonyPatch(typeof(PlayerManager), nameof(PlayerManager.Start))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerManagerStart(PlayerManager __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerManagerStart failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// PlayerManager.ConfinedCursorforUI
|
||||
[HarmonyPatch(typeof(PlayerManager), nameof(PlayerManager.ConfinedCursorforUI))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerManagerConfinedCursorforUI(PlayerManager __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "ConfinedCursorforUI"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerManagerConfinedCursorforUI failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// PlayerManager.PlayerStopMovement
|
||||
[HarmonyPatch(typeof(PlayerManager), nameof(PlayerManager.PlayerStopMovement))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerManagerPlayerStopMovement(PlayerManager __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "PlayerStopMovement"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerManagerPlayerStopMovement failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// PlayerManager.LockedCursorForPlayerMovement
|
||||
[HarmonyPatch(typeof(PlayerManager), nameof(PlayerManager.LockedCursorForPlayerMovement))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerManagerLockedCursorForPlayerMovement(PlayerManager __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "LockedCursorForPlayerMovement"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerManagerLockedCursorForPlayerMovement failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// PlayerManager.DefaultActionEffect
|
||||
[HarmonyPatch(typeof(PlayerManager), nameof(PlayerManager.DefaultActionEffect))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerManagerDefaultActionEffect(PlayerManager __instance, Vector3 _position, float _time)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "DefaultActionEffect"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerManagerDefaultActionEffect failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// PlayerManager.GainIOPSEffect
|
||||
[HarmonyPatch(typeof(PlayerManager), nameof(PlayerManager.GainIOPSEffect))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnPlayerManagerGainIOPSEffect(PlayerManager __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Player, "GainIOPSEffect"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnPlayerManagerGainIOPSEffect failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace gregFramework.Hooks;
|
||||
|
||||
/// <summary>
|
||||
/// Reserved for Power / UPS / PDU hooks once matching Il2Cpp surface is classified.
|
||||
/// </summary>
|
||||
[HarmonyPatch]
|
||||
internal static class GregPowerHooks
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,339 @@
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
using greg.Core;
|
||||
using greg.Sdk;
|
||||
using Il2Cpp;
|
||||
using Il2CppSystem.Collections.Generic;
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace gregFramework.Hooks;
|
||||
|
||||
/// <summary>
|
||||
/// Harmony hooks for domain Rack (generated from Il2Cpp unpack).
|
||||
/// </summary>
|
||||
[HarmonyPatch]
|
||||
internal static class GregRackHooks
|
||||
{
|
||||
// Rack.Awake
|
||||
[HarmonyPatch(typeof(Rack), nameof(Rack.Awake))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackAwake(Rack __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackAwake failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Rack.Start
|
||||
[HarmonyPatch(typeof(Rack), nameof(Rack.Start))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackStart(Rack __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackStart failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Rack.IsPositionAvailable
|
||||
[HarmonyPatch(typeof(Rack), nameof(Rack.IsPositionAvailable))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackIsPositionAvailable(Rack __instance, int index, int sizeInU)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "IsPositionAvailable"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackIsPositionAvailable failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Rack.MarkPositionAsUsed
|
||||
[HarmonyPatch(typeof(Rack), nameof(Rack.MarkPositionAsUsed))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackMarkPositionAsUsed(Rack __instance, int index, int sizeInU)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "MarkPositionAsUsed"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackMarkPositionAsUsed failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Rack.MarkPositionAsUnused
|
||||
[HarmonyPatch(typeof(Rack), nameof(Rack.MarkPositionAsUnused))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackMarkPositionAsUnused(Rack __instance, int index, int sizeInU)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "MarkPositionAsUnused"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackMarkPositionAsUnused failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Rack.UpdateAudioVolume
|
||||
[HarmonyPatch(typeof(Rack), nameof(Rack.UpdateAudioVolume))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackUpdateAudioVolume(Rack __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "AudioVolumeChanged"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackUpdateAudioVolume failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Rack.ButtonDisablePositionsInRack
|
||||
[HarmonyPatch(typeof(Rack), nameof(Rack.ButtonDisablePositionsInRack))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackButtonDisablePositionsInRack(Rack __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "ButtonDisablePositionsInRack"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackButtonDisablePositionsInRack failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Rack.SetDisablePositionsButtonMaterial
|
||||
[HarmonyPatch(typeof(Rack), nameof(Rack.SetDisablePositionsButtonMaterial))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackSetDisablePositionsButtonMaterial(Rack __instance, Material material)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "DisablePositionsButtonMaterialSet"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackSetDisablePositionsButtonMaterial failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Rack.ButtonUnmountRack
|
||||
[HarmonyPatch(typeof(Rack), nameof(Rack.ButtonUnmountRack))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackButtonUnmountRack(Rack __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "ButtonUnmountRack"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackButtonUnmountRack failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Rack.OnLoad
|
||||
[HarmonyPatch(typeof(Rack), nameof(Rack.OnLoad))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackOnLoad(Rack __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "OnLoad"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackOnLoad failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Rack.OnDestroy
|
||||
[HarmonyPatch(typeof(Rack), nameof(Rack.OnDestroy))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackOnDestroy(Rack __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "OnDestroy"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackOnDestroy failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// RackMount.InstantiateRack
|
||||
[HarmonyPatch(typeof(RackMount), nameof(RackMount.InstantiateRack))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackMountInstantiateRack(RackMount __instance, InteractObjectData saveData)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "InstantiateRack"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackMountInstantiateRack failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// RackMount.ApplyMaterialToLODs
|
||||
[HarmonyPatch(typeof(RackMount), nameof(RackMount.ApplyMaterialToLODs))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackMountApplyMaterialToLODs(RackMount __instance, GameObject rackGO, Material mat)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "ApplyMaterialToLODs"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackMountApplyMaterialToLODs failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// RackMount.OnLoad
|
||||
[HarmonyPatch(typeof(RackMount), nameof(RackMount.OnLoad))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackMountOnLoad(RackMount __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "OnLoad"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackMountOnLoad failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// RackMount.OnDestroy
|
||||
[HarmonyPatch(typeof(RackMount), nameof(RackMount.OnDestroy))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackMountOnDestroy(RackMount __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "OnDestroy"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackMountOnDestroy failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// RackMount.CheatInsertRack
|
||||
[HarmonyPatch(typeof(RackMount), nameof(RackMount.CheatInsertRack))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnRackMountCheatInsertRack(RackMount __instance, GameObject go, int type)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Rack, "CheatInsertRack"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnRackMountCheatInsertRack failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,519 @@
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
using greg.Core;
|
||||
using greg.Sdk;
|
||||
using Il2Cpp;
|
||||
using Il2CppSystem.Collections.Generic;
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace gregFramework.Hooks;
|
||||
|
||||
/// <summary>
|
||||
/// Harmony hooks for domain Server (generated from Il2Cpp unpack).
|
||||
/// </summary>
|
||||
[HarmonyPatch]
|
||||
internal static class GregServerHooks
|
||||
{
|
||||
// Server.Start
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.Start))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerStart(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "ComponentInitialized"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerStart failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.OnLoadingStarted
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.OnLoadingStarted))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerOnLoadingStarted(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "OnLoadingStarted"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerOnLoadingStarted failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.OnLoadingComplete
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.OnLoadingComplete))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerOnLoadingComplete(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "OnLoadingComplete"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerOnLoadingComplete failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.PowerButton
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.PowerButton))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerPowerButton(Server __instance, bool forceState)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "PowerButton"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerPowerButton failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.TurnOffCommonFunctions
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.TurnOffCommonFunctions))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerTurnOffCommonFunctions(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "TurnOffCommonFunctions"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerTurnOffCommonFunctions failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.TurnOnCommonFunction
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.TurnOnCommonFunction))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerTurnOnCommonFunction(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "TurnOnCommonFunction"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerTurnOnCommonFunction failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.IsAnyCableConnected
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.IsAnyCableConnected))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerIsAnyCableConnected(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "IsAnyCableConnected"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerIsAnyCableConnected failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.GenerateUniqueServerId
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.GenerateUniqueServerId))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerGenerateUniqueServerId(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "GenerateUniqueServerId"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerGenerateUniqueServerId failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.ServerInsertedInRack
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.ServerInsertedInRack))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerServerInsertedInRack(Server __instance, ServerSaveData serverSaveData)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "ServerInsertedInRack"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerServerInsertedInRack failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.RegisterLink
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.RegisterLink))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerRegisterLink(Server __instance, CableLink link)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "RegisterLink"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerRegisterLink failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.UnregisterLink
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.UnregisterLink))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerUnregisterLink(Server __instance, CableLink link)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "UnregisterLink"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerUnregisterLink failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.UpdateServerScreenUI
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.UpdateServerScreenUI))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerUpdateServerScreenUI(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "ServerScreenUIChanged"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerUpdateServerScreenUI failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.ButtonClickChangeCustomer
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.ButtonClickChangeCustomer))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerButtonClickChangeCustomer(Server __instance, bool forward)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "ButtonClickChangeCustomer"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerButtonClickChangeCustomer failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.GetNextCustomerID
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.GetNextCustomerID))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerGetNextCustomerID(Server __instance, int currentCustomerID, bool forward)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "GetNextCustomerID"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerGetNextCustomerID failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.ButtonClickChangeIP
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.ButtonClickChangeIP))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerButtonClickChangeIP(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "ButtonClickChangeIP"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerButtonClickChangeIP failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.SetIP
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.SetIP))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerSetIP(Server __instance, string _ip)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "IPSet"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerSetIP failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.GetCustomerID
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.GetCustomerID))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerGetCustomerID(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "GetCustomerID"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerGetCustomerID failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.UpdateCustomer
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.UpdateCustomer))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerUpdateCustomer(Server __instance, int newCustomerID)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "CustomerChanged"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerUpdateCustomer failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.UpdateAppID
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.UpdateAppID))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerUpdateAppID(Server __instance, int _appID)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "AppIDChanged"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerUpdateAppID failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.ItIsBroken
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.ItIsBroken))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerItIsBroken(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "ItIsBroken"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerItIsBroken failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.ValidateRackPosition
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.ValidateRackPosition))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerValidateRackPosition(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "ValidateRackPosition"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerValidateRackPosition failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.ClearWarningSign
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.ClearWarningSign))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerClearWarningSign(Server __instance, bool isPreserved)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "ClearWarningSign"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerClearWarningSign failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.ClearErrorSign
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.ClearErrorSign))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerClearErrorSign(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "ClearErrorSign"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerClearErrorSign failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.SetPowerLightMaterial
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.SetPowerLightMaterial))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerSetPowerLightMaterial(Server __instance, Material material)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "PowerLightMaterialSet"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerSetPowerLightMaterial failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Server.RepairDevice
|
||||
[HarmonyPatch(typeof(Server), nameof(Server.RepairDevice))]
|
||||
[HarmonyPostfix]
|
||||
private static void OnServerRepairDevice(Server __instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
gregEventDispatcher.Emit(
|
||||
gregHookName.Create(GregDomain.Server, "DeviceRepaired"),
|
||||
new
|
||||
{
|
||||
instance = __instance,
|
||||
});
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MelonLogger.Warning($"[gregCore] Hook OnServerRepairDevice failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -13,6 +13,9 @@
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
|
||||
<EnableDefaultNoneItems>false</EnableDefaultNoneItems>
|
||||
<Version>1.0.0.35</Version>
|
||||
<FileVersion>1.0.0.35</FileVersion>
|
||||
<AssemblyVersion>1.0.0.35</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -31,12 +34,19 @@
|
||||
<Reference Include="UnityEngine.CoreModule"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\UnityEngine.CoreModule.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="UnityEngine"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\UnityEngine.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="UnityEngine.UI"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\UnityEngine.UI.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="UnityEngine.UIModule"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\UnityEngine.UIModule.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="UnityEngine.IMGUIModule"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\UnityEngine.IMGUIModule.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="UnityEngine.InputLegacyModule"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\UnityEngine.InputLegacyModule.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="UnityEngine.AIModule"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\UnityEngine.AIModule.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="UnityEngine.AnimationModule"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\UnityEngine.AnimationModule.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="UnityEngine.ImageConversionModule"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\UnityEngine.ImageConversionModule.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="UnityEngine.PhysicsModule"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\UnityEngine.PhysicsModule.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="UnityEngine.TextRenderingModule"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\UnityEngine.TextRenderingModule.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="Unity.InputSystem"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\Unity.InputSystem.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="Unity.TextMeshPro"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\Unity.TextMeshPro.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="Il2CppUMA_Core"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\Il2CppUMA_Core.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="Il2CppTMPro"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\Il2CppTMPro.dll</HintPath><Private>false</Private></Reference>
|
||||
<Reference Include="Unity.Entities"><HintPath>lib\references\MelonLoader\Il2CppAssemblies\Unity.Entities.dll</HintPath><Private>false</Private></Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user