forked from DST-Hamlet/PorkLand
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodfrontendmain.lua
More file actions
35 lines (26 loc) · 1.03 KB
/
modfrontendmain.lua
File metadata and controls
35 lines (26 loc) · 1.03 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
local _modname = modname
GLOBAL.setfenv(1, GLOBAL)
local function OnUnloadlevel()
local servercreationscreen = TheFrontEnd:GetOpenScreenOfType("ServerCreationScreen")
PL_EnableWorldLocations = nil
if not (servercreationscreen and servercreationscreen.world_tabs) then
return
end
SERVER_LEVEL_LOCATIONS = {"forest", "cave"}
servercreationscreen:SetLevelLocations()
for i, world_tab in ipairs(servercreationscreen.world_tabs) do
local text = world_tab:GetLocationTabName()
servercreationscreen.world_config_tabs.menu.items[i + 1]:SetText(text)
if world_tab.choose_world_button then
world_tab.choose_world_button:Hide()
end
end
end
local _FrontendUnloadMod = ModManager.FrontendUnloadMod
function ModManager:FrontendUnloadMod(modname, ...)
if not modname or modname == _modname then -- modname is nil unload all level
OnUnloadlevel()
ModManager.FrontendUnloadMod = _FrontendUnloadMod
end
return _FrontendUnloadMod(self, modname, ...)
end