Files
gregCore/src/gregSdk/gregNativeEventHooks.cs
T
Marvin 07bc596c77
gregCore CI / build (push) Has been cancelled
Refactor and enhance gregCore framework
- Disabled IMGUI drawing in Core.cs for Unity 6 stability.
- Consolidated GregCoreMod and DataCenterModLoaderMod into a single GregCoreMod class for better organization and clarity.
- Updated GregBootstrapper to use a boolean flag for hook integration.
- Simplified HookIntegration class by removing unnecessary fields and methods, focusing on essential functionality.
- Updated PlayerPatch and ShopPatch to emit hooks using string representation for better compatibility.
- Introduced ModMenu and GregHardwareID classes for centralized mod configuration and unique object identification.
- Enhanced GregDevConsole for improved logging and UI management.
- Added legacy shims for backward compatibility with older mods.
- Improved UI management with CanvasGroup for better input handling.
- Updated QoL settings to allow for a range in slider values.
2026-04-24 15:45:10 +02:00

42 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
namespace greg.Sdk
{
public static class gregNativeEventHooks
{
// Change to Action<object> to support legacy API callbacks with null parameters
public static Action<object> OnCoinsChanged;
public static Action<object> OnXpChanged;
public static Action<object> OnReputationChanged;
public static Action<object> SystemGameLoaded;
public static Action<object> SystemGameSaved;
public static Action<object> GameLoaded;
public static Action<object> GameSaved;
public static Action<object> MoneyChanged;
public static Action<object> XpChanged;
public static Action<object> ReputationChanged;
public static Action<object> DayEnded;
public static Action<object> MonthEnded;
public static Action<object> GetByEventId(string eventId) => eventId switch
{
"OnCoinsChanged" => OnCoinsChanged,
"OnXpChanged" => OnXpChanged,
"OnReputationChanged" => OnReputationChanged,
"system.GameLoaded" => SystemGameLoaded,
"system.GameSaved" => SystemGameSaved,
"GameLoaded" => GameLoaded,
"GameSaved" => GameSaved,
"MoneyChanged" => MoneyChanged,
"XpChanged" => XpChanged,
"ReputationChanged" => ReputationChanged,
"DayEnded" => DayEnded,
"MonthEnded" => MonthEnded,
_ => null
};
}
}