2026-11-03 09:11:46 +08:00
|
|
|
namespace Decentralized
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// mod 入口(游戏自带 mod 系统)。Init / OnEnable 在主菜单阶段调用:这里只订阅钩子、登记物品和人脉升级,
|
|
|
|
|
/// 不碰存档和店里的东西(那些在读档 / 新游戏的钩子里做)。
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class ModEntry : IMod
|
|
|
|
|
{
|
|
|
|
|
public void Init(ModManifest manifest) { }
|
|
|
|
|
|
|
|
|
|
public void OnEnable()
|
|
|
|
|
{
|
|
|
|
|
Items.Subscribe();
|
|
|
|
|
Items.OpenTerminal = TerminalWindow.Open;
|
2026-11-04 18:56:24 +08:00
|
|
|
Items.OpenGpuHandbook = () => GpuGuide.Open();
|
|
|
|
|
ModHook.OnModAssetsLoaded += GpuGuide.OnAssetsLoaded;
|
2026-11-03 22:58:24 +08:00
|
|
|
Items.AddWallet = TerminalWindow.AddWallet;
|
|
|
|
|
Items.CanAddWallet = TerminalWindow.CanAddWallet;
|
2026-11-04 15:34:38 +08:00
|
|
|
Settings.DefineWhenReady(ModHelper.GetConfig(ModInfo.Id));
|
2026-11-03 09:11:46 +08:00
|
|
|
Unlock.Register();
|
|
|
|
|
Night.Subscribe();
|
2026-11-03 09:27:28 +08:00
|
|
|
DealerStock.Subscribe();
|
2026-11-03 11:40:10 +08:00
|
|
|
UsedDealerClient.Subscribe();
|
2026-11-03 16:01:20 +08:00
|
|
|
CoinCustomers.Subscribe();
|
2026-11-03 19:48:26 +08:00
|
|
|
BlackDelivery.Subscribe();
|
2026-11-04 09:12:47 +08:00
|
|
|
TumblerStory.Subscribe();
|
2026-11-03 12:08:51 +08:00
|
|
|
GpuInspectView.Ensure();
|
2026-11-03 09:11:46 +08:00
|
|
|
ModHook.OnGameLoadedLate += Session.Load;
|
|
|
|
|
ModHook.OnNewGameStarted += OnNewGame;
|
|
|
|
|
Log.Info($"{ModInfo.Name} {ModInfo.Version} 已启用");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void OnDisable()
|
|
|
|
|
{
|
|
|
|
|
Items.Unsubscribe();
|
|
|
|
|
Night.Unsubscribe();
|
2026-11-03 09:27:28 +08:00
|
|
|
DealerStock.Unsubscribe();
|
2026-11-03 11:40:10 +08:00
|
|
|
UsedDealerClient.Unsubscribe();
|
2026-11-03 16:01:20 +08:00
|
|
|
CoinCustomers.Unsubscribe();
|
2026-11-03 19:48:26 +08:00
|
|
|
BlackDelivery.Unsubscribe();
|
2026-11-04 09:12:47 +08:00
|
|
|
TumblerStory.Unsubscribe();
|
2026-11-03 12:08:51 +08:00
|
|
|
GpuInspectView.Remove();
|
2026-11-03 22:29:42 +08:00
|
|
|
WalletDriver.Remove();
|
2026-11-04 18:56:24 +08:00
|
|
|
ModHook.OnModAssetsLoaded -= GpuGuide.OnAssetsLoaded;
|
2026-11-03 09:11:46 +08:00
|
|
|
ModHook.OnGameLoadedLate -= Session.Load;
|
|
|
|
|
ModHook.OnNewGameStarted -= OnNewGame;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void OnNewGame(string scenarioId) => Session.Load();
|
|
|
|
|
}
|
|
|
|
|
}
|