-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.lua
More file actions
54 lines (44 loc) · 1.32 KB
/
Copy pathinit.lua
File metadata and controls
54 lines (44 loc) · 1.32 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
---@type MetaLevelingPublic
MLP = dofile_once("mods/meta_leveling/files/scripts/meta_leveling_public.lua")
---@type meta_leveling
ML = dofile_once("mods/meta_leveling/files/scripts/meta_leveling.lua")
---@type ML_gui
local gui = dofile_once("mods/meta_leveling/files/scripts/classes/private/gui/gui.lua")
dofile_once("mods/meta_leveling/files/scripts/on_init/load_file_into_vfs.lua")
---On mod init
function OnModInit()
dofile_once("mods/meta_leveling/files/scripts/hardmode/init.lua")
dofile_once("mods/meta_leveling/files/scripts/on_init/appends.lua")
end
---After OnModPostInit
function OnMagicNumbersAndWorldSeedInitialized()
ML:OnMagicNumbersAndWorldSeedInitialized()
end
---Idk why it's called before initialized
function OnWorldPostUpdate()
ML:UpdateCommonParameters()
gui:Draw()
end
---World actually loaded
function OnWorldInitialized()
ML:StartUp()
gui:UpdateSettings()
gui:Init()
end
---?
function OnPlayerSpawned()
ML:OnSpawn()
end
---On player death
---@param player_unit entity_id
function OnPlayerDied(player_unit)
GameAddFlagRun("player_died")
end
---Update settings when paused
---@param is_paused boolean
function OnPausedChanged(is_paused)
if not is_paused then return end
ML:UpdateSettings()
gui:UpdateSettings()
if MLP.get:mod_setting_boolean("session_exp_close_ui_on_pause") then ML.gui = false end
end