-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodmain.lua
More file actions
37 lines (30 loc) · 853 Bytes
/
modmain.lua
File metadata and controls
37 lines (30 loc) · 853 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
35
36
37
Assets =
{
--Asset("ATLAS", "images/menu.xml"),
}
local _G = GLOBAL
local require = _G.require
local MOD_DEVELOPMENT_MENU = {}
MOD_DEVELOPMENT_MENU.MODNAME = modname
MOD_DEVELOPMENT_MENU.KEYBINDSERVICE = require "util/keybindservice"(modname)
_G.MOD_DEVELOPMENT_MENU = MOD_DEVELOPMENT_MENU
require "keybinds"
local function OnPlayerActivated(_, player)
if player ~= _G.ThePlayer then
return
end
local commands =
{
FREECRAFTING = "c_freecrafting()",
GODMODE = "c_supergodmode()"
}
for config, command in pairs(commands) do
if GetModConfigData(config) then
_G.TheNet:SendRemoteExecute(command)
end
end
end
local function OnWorldPostInit(inst)
inst:ListenForEvent("playeractivated", OnPlayerActivated, _G.TheWorld)
end
AddPrefabPostInit("world", OnWorldPostInit)