-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainFile.cs
More file actions
34 lines (26 loc) · 846 Bytes
/
Copy pathMainFile.cs
File metadata and controls
34 lines (26 loc) · 846 Bytes
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
using BaseLib.Config;
using Godot;
using GradientLine.GradientLineCode;
using HarmonyLib;
using MegaCrit.Sts2.Core.Modding;
namespace GradientLine;
[ModInitializer(nameof(Initialize))]
public partial class MainFile : Node
{
public const string ModId = "GradientLine";
public static MegaCrit.Sts2.Core.Logging.Logger Logger { get; } =
new(ModId, MegaCrit.Sts2.Core.Logging.LogType.Generic);
private static SceneTree? tree;
public static void Initialize()
{
ModConfigRegistry.Register(ModId, new Config());
Harmony harmony = new(ModId);
harmony.PatchAll();
var tree = Engine.GetMainLoop() as SceneTree;
if (tree != null)
{
var ticker = new GradientTimer();
tree.Root.CallDeferred(Node.MethodName.AddChild, ticker);
}
}
}