fixed dependency issues, removed table.lua, removed filesystem as a core dependency

This commit is contained in:
FatalErr42O 2024-01-05 21:00:23 -08:00
parent e5c1fc90b3
commit 7e5cace034
3 changed files with 10 additions and 29 deletions

View File

@ -1,10 +1,10 @@
mtul = {
binary = {}, --provided entirely by modlib.
utils = {}, --provided entirely by modlib.
tbl = {}, --modified by libs.modlib, source.
mtul = mtul or {
loaded_modules = {}
}
--initialize namespace vars if not present.
mtul.binary = mtul.binary or {}
mtul.utils = mtul.utils or {}
mtul.loaded_modules.filesystem = true
--optionally allow user to overset local math with mtul while still keeping core funcs & consts.
mtul.math = {}
for i, v in pairs(math) do
@ -12,8 +12,7 @@ for i, v in pairs(math) do
end
--run files. These will directly modify the mtul sub tables.
mtul.path = minetest.get_modpath("mtul_core")
mtul.path = minetest.get_modpath("mtul_filesystem")
dofile(mtul.path.."/modlib/binary.lua")
dofile(mtul.path.."/modlib/table.lua")
dofile(mtul.path.."/modlib/mod_utils.lua")
dofile(mtul.path.."/modlib/mod_utils_media.lua")

View File

@ -1,4 +1,4 @@
name = mtul_core
title = MTUL core
description = integrates various dependancies, implements some universal math features.
author = FatalError42O, Appgurue
name = mtul_filesystem
title = MTUL filesystem
description = adds dependencies for binary file reading, as well as other file utilities.
author = FatalError42O, (coded by Appgurue)

View File

@ -1,18 +0,0 @@
--adds a list to the end of another list without ovewriting data.
function mtul.tbl.append(table, other_table)
local length = #table
for index, value in ipairs(other_table) do
table[length + index] = value
end
return table
end
--this... I guess lists keys by their order??? I have no idea, depended on by b3d standalone.
function mtul.tbl.keys(table)
local keys = {}
for key, _ in pairs(table) do
keys[#keys + 1] = key
end
return keys
end