Update from 22.06.2025: add MapGen mod outline, fix some require() issues
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
_G.Mod = {}
|
||||
Mod = {}
|
||||
|
||||
function Mod:new(addToGlobal)
|
||||
for key, value in pairs(addToGlobal) do
|
||||
_G[key] = value
|
||||
end
|
||||
local modName = core.get_current_modname()
|
||||
local modPath = core.get_modpath(modName)
|
||||
|
||||
local modTable = ModTable:new(modName, modPath)
|
||||
modTable.require = ModTable:getRequire()
|
||||
function Mod.getInfo()
|
||||
local name = core.get_current_modname()
|
||||
local path = core.get_modpath(name)
|
||||
local require = Require.getModRequire(name, path)
|
||||
|
||||
return {name = name, path = path, require = require}
|
||||
end
|
||||
|
||||
function Mod:new()
|
||||
local mod = Mod.getInfo()
|
||||
|
||||
setmetatable(mod, self)
|
||||
self.__index = self
|
||||
|
||||
return mod
|
||||
end
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
name = api__mod
|
||||
depends = api__mod_table, api__require,
|
||||
name = api__mod_table
|
||||
|
||||
Reference in New Issue
Block a user