1/2 revert revert, xd, bruh

This commit is contained in:
Van
2025-10-29 20:08:04 +03:00
parent ec3cde237c
commit 3306941c43
3 changed files with 101 additions and 102 deletions

View File

@@ -3,7 +3,7 @@
---@field name string Technical name of the mod.
---@field shortName string
---@field path string Path to the mod folder.
---@field Class table A public class that provides a mod.
---@field Class any A public class that provides a mod.
---@field require fun(FileName:string):table
Mod = {}
@@ -17,9 +17,10 @@ local function getShortModName(name)
end
---Return table with mod name, path and require function.
---@param modname? string Specify a name of mod to get its info
---@return {name: string, shortName: string, path: string, require: fun(FileName : string): table}
function Mod.getInfo()
local name = core.get_current_modname()
function Mod.getInfo(modname)
local name = modname or core.get_current_modname()
local shortName = getShortModName(name)
local path = core.get_modpath(name)
local require = Require.getModRequire(name, path)
@@ -61,4 +62,3 @@ function Mod:getModClassExtended(ChildClass)
return childClass
end

View File

@@ -1,5 +1,5 @@
local modInfo = Mod.getInfo()
local require = modInfo.require
local modInfo = Mod.getInfo()
local require = modInfo.require
local VisualEnum = require('Item.VisualEnum')