-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmod.lua
More file actions
40 lines (38 loc) · 1.14 KB
/
Copy pathmod.lua
File metadata and controls
40 lines (38 loc) · 1.14 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
return DMod:new("mission_dumper", {
name = "Mission Dumper",
author = "RogerXIII",
config = {
{ "menu", "dump_mission", { type = "keybind", text = "Dump Mission" } },
},
hooks = {
{
"lib/managers/missionmanager", function(module)
local MissionScript = module:hook_class("MissionScript")
-- prevent any script data from being manipulated, will softlock missions
module:hook(MissionScript, "activate", function(self, ...)
-- managers.mission:add_persistent_debug_output("")
-- managers.mission:add_persistent_debug_output("Activate mission " .. self._name, Color(1, 0, 1, 0))
for _, element in pairs(self._elements) do
element:on_script_activated()
end
-- for _, element in pairs(self._elements) do
-- if element:value("execute_on_startup") then
-- element:on_executed(...)
-- end
-- end
end)
end,
},
{
"OnKeyPressed", "dump_mission", function()
local module = D:module("mission_dumper")
local path = module:path()
require(path .. "log.lua")
local _, data = pcall(loadfile, path .. "script_converter.lua")
if data then
data()
end
end,
},
},
})