Proper default media
parent
091c896478
commit
256723b698
6
conf.lua
6
conf.lua
|
@ -53,10 +53,10 @@ local conf_spec = {type = "table", children = {
|
|||
}}
|
||||
|
||||
config = modlib.conf.import("voxelizer", conf_spec)
|
||||
local mediapath = minetest.get_modpath("voxelizer").."/default_media/"
|
||||
local fallback_defaults = {texture = mediapath.."character.png", model = mediapath.."character.obj", nodemap = mediapath.."colors.txt"}
|
||||
default_media_path = modlib.mod.get_resource(minetest.get_current_modname(), "default_media", "")
|
||||
local fallback_defaults = {texture = "character.png", model = "character.obj", nodemap = "colors.txt"}
|
||||
for key, alt in pairs(fallback_defaults) do
|
||||
if config.defaults[key] == nil then
|
||||
config.defaults[key] = alt
|
||||
config.defaults[key] = default_media_path .. alt
|
||||
end
|
||||
end
|
6
main.lua
6
main.lua
|
@ -1,5 +1,9 @@
|
|||
function get_media(name)
|
||||
return minetest.get_worldpath().."/media/"..name
|
||||
local path = minetest.get_worldpath() .. "/media/" .. name
|
||||
if not modlib.file.exists(path) then
|
||||
path = default_media_path .. "/" .. name
|
||||
end
|
||||
return path
|
||||
end
|
||||
|
||||
function get_obj_bounding_box(vertexes)
|
||||
|
|
Loading…
Reference in New Issue