-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMainFile.cs
More file actions
87 lines (72 loc) · 3.08 KB
/
MainFile.cs
File metadata and controls
87 lines (72 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using Godot;
using HarmonyLib;
using lemonSpire2.Chat;
using lemonSpire2.ColorEx;
using lemonSpire2.PlayerStateEx;
using lemonSpire2.PlayerStateEx.RemoteFlash;
using lemonSpire2.SendGameItem;
using lemonSpire2.StatsTracker;
using lemonSpire2.SyncReward;
using lemonSpire2.SyncShop;
using lemonSpire2.SynergyIndicator;
using lemonSpire2.util;
using MegaCrit.Sts2.Core.Logging;
using MegaCrit.Sts2.Core.Modding;
using Logger = MegaCrit.Sts2.Core.Logging.Logger;
namespace lemonSpire2;
[ModInitializer(nameof(Initialize))]
public partial class MainFile : Node
{
internal const string ModId = "lemonSpire2";
public static Logger Log { get; } = new(ModId, LogType.Generic);
public static void Initialize()
{
LemonSpireConfig.TryInitializeRitsuLibBackends();
ModSoundManager.Initialize();
// 设置日志级别为 Debug,启用所有模块的调试日志
SetupLogLevels();
Harmony harmony = new(ModId);
PlayerPanelRegistry.RegisterBuiltins();
if (LemonSpireConfig.EnableQoL)
harmony.CreateClassProcessor(typeof(NMultiplayerPlayerExpandedStatePatch)).Patch();
if (LemonSpireConfig.EnableChat)
{
harmony.CreateClassProcessor(typeof(ChatUiPatch)).Patch();
harmony.CreateClassProcessor(typeof(ChatUiCleanupPatch)).Patch();
harmony.CreateClassProcessor(typeof(SendItemInputPatch)).Patch();
harmony.CreateClassProcessor(typeof(ItemInputCaptureCleanupPatch)).Patch();
}
if (LemonSpireConfig.EnableSynergyIndicator)
{
harmony.CreateClassProcessor(typeof(SynergyIndicatorPatch)).Patch();
harmony.CreateClassProcessor(typeof(SynergyIndicatorNetworkPatch)).Patch();
}
if (LemonSpireConfig.EnableStatsTracker)
{
StatsTrackerManager.Instance.Initialize();
PlayerTooltipRegistry.Register(new StatsTooltipProvider());
}
if (LemonSpireConfig.EnableSync)
{
harmony.CreateClassProcessor(typeof(ShopRoomPatch)).Patch();
harmony.CreateClassProcessor(typeof(CardRewardNetworkInitPatch)).Patch();
harmony.CreateClassProcessor(typeof(RewardsScreenPatch)).Patch();
harmony.CreateClassProcessor(typeof(RunManagerPatch)).Patch();
}
if (LemonSpireConfig.EnablePlayerColor)
{
harmony.CreateClassProcessor(typeof(PlayerNameColorPatch)).Patch();
harmony.CreateClassProcessor(typeof(MapDrawColorPatch)).Patch();
harmony.CreateClassProcessor(typeof(RemoteCursorColorPatch)).Patch();
harmony.CreateClassProcessor(typeof(ColorNetworkPatch)).Patch();
harmony.CreateClassProcessor(typeof(PlayerColorButtonPatch)).Patch();
}
harmony.CreateClassProcessor(typeof(RemoteUiFlashInitPatch)).Patch();
harmony.CreateClassProcessor(typeof(AncientRelicChoicePatch)).Patch();
harmony.CreateClassProcessor(typeof(NMultiplayerPlayerStatePatch)).Patch();
Log.Info("lemonSpire2 mod initialized");
}
private static void SetupLogLevels()
{
}
}