This repository was archived by the owner on Aug 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModLoader.patch
More file actions
87 lines (85 loc) · 3.5 KB
/
ModLoader.patch
File metadata and controls
87 lines (85 loc) · 3.5 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
@@ -70,6 +70,11 @@
{
.ver 0:64:4510:27485
}
+// ModLoader: Add reference to assembly
+.assembly extern ModLoader
+{
+ .ver 1:0:0:0
+}
.assembly Gnomoria
{
.custom instance void A.AssemblyInfoAttribute::.ctor(string) = ( 01 00 00 00 00 )
@@ -25349,6 +25354,7 @@
{
// Code size 30 (0x1e)
.maxstack 8
+ .locals init (class Game.GUI.InGameHUD V_0)
IL_0000: ldarg.0
IL_0001: ldfld class Game.GUI.Controls.Window Game.GUI.GuiManager::window_0
IL_0006: ldc.i4.0
@@ -25357,7 +25363,14 @@
IL_000d: call instance void Game.GUI.GuiManager::method_2()
IL_0012: ldarg.0
IL_0013: newobj instance void Game.GUI.InGameHUD::.ctor()
+ stloc.0
+ ldloc.0
IL_0018: call instance void Game.GUI.GuiManager::method_1(class Game.GUI.MenuStack)
+ // ModLoader: Hook In-game HUD initialization
+ ldloc.0
+ ldarg.0
+ ldfld class Game.GUI.Controls.Manager Game.GUI.GuiManager::manager_0
+ call void [ModLoader]ModLoader.HookManager::HookInGameHUDInit(class Game.GUI.InGameHUD, class Game.GUI.Controls.Manager)
IL_001d: ret
} // end of method GuiManager::CreateInGameHUD
@@ -126244,6 +126257,8 @@
// Code size 25 (0x19)
.maxstack 1
.locals init (class Game.GnomanEmpire V_0)
+ // ModLoader: Call app init hook
+ call void [ModLoader]ModLoader.ModLoaderMain::HookInit()
IL_0000: call class Game.GnomanEmpire Game.GnomanEmpire::get_Instance()
IL_0005: stloc.0
.try
@@ -201299,6 +201314,10 @@
IL_005a: ldfld class Game.Camera Game.GnomanEmpire::camera_0
IL_005f: ldarg.1
IL_0060: callvirt instance void Game.Camera::Update(float32)
+ // ModLoader: Hook per-frame update
+ ldarg.1
+ ldloc.0
+ call void [ModLoader]ModLoader.HookManager::HookUpdateInGame(float32, float32)
IL_0065: ret
} // end of method GnomanEmpire::method_2
@@ -230208,7 +230227,7 @@
instance void .ctor(class Game.GUI.Controls.Manager manager) cil managed
{
// Code size 614 (0x266)
- .maxstack 3
+ .maxstack 4
.locals init (class Game.GUI.Controls.Button V_0,
class Game.GUI.Controls.Button V_1,
class Game.GUI.Controls.Button V_2,
@@ -230365,6 +230384,11 @@
IL_01b6: callvirt instance valuetype Game.GUI.Controls.Margins Game.GUI.Controls.Control::get_Margins()
IL_01bb: ldfld int32 Game.GUI.Controls.Margins::Bottom
IL_01c0: add
+ // ModLoader: Hook Import/Export Menu GUI initialization
+ // (button2.Top + button2.Height + button2.Margins.Bottom) is now on top of the stack, we hijack it for our hook
+ ldarg.0
+ ldarg.1
+ call int32 [ModLoader]ModLoader.HookManager::HookImportExportListInit(int32, class Game.GUI.ImportExportMenu, class Game.GUI.Controls.Manager)
IL_01c1: ldloc.2
IL_01c2: callvirt instance valuetype Game.GUI.Controls.Margins Game.GUI.Controls.Control::get_Margins()
IL_01c7: ldfld int32 Game.GUI.Controls.Margins::Top
@@ -346018,6 +346042,10 @@
IL_01ba: ldfld class Game.GUI.Controls.Panel Game.GUI.MainMenuWindow::panel_0
IL_01bf: ldloc.s V_4
IL_01c1: callvirt instance void Game.GUI.Controls.Control::Add(class Game.GUI.Controls.Control)
+ // ModLoader: Hook Main Menu GUI initialization
+ ldarg.0
+ ldarg.1
+ call void [ModLoader]ModLoader.ModLoaderMain::HookMainMenuGuiInit(class Game.GUI.MainMenuWindow, class Game.GUI.Controls.Manager)
IL_01c6: ldarg.0
IL_01c7: ldarg.1
IL_01c8: ldstr "Exit"