hudlib/init.lua
octacian 8b62f99c9a Add waypoint element API
Implements an API specifically for the purpose of manipulating waypoint HUD elements.
2017-03-27 22:24:46 -07:00

46 lines
1010 B
Lua

-- hudlib/init.lua
hudlib = {}
hudlib.VERSION = 0.1
hudlib.RELEASE = "alpha"
local modpath = minetest.get_modpath("hudlib")
-- [function] Log
function hudlib.log(content, log_type)
if not content then return false end
if log_type == nil then log_type = "action" end
minetest.log(log_type, "[HUD Library] "..content)
end
---------------------
---- CHATCOMMAND ----
---------------------
-- [register cmd] /hudlib
minetest.register_chatcommand("hudlib", {
description = "Check HUD Library version",
func = function(name)
return true, "HUD Library: Version "..tostring(hudlib.VERSION).." ("..hudlib.RELEASE..")"
end,
})
------------------------
-- LOAD API RESOURCES --
------------------------
-- Load Main API
dofile(modpath.."/api.lua")
-- Load HUD API
dofile(modpath.."/hud.lua")
-- Load Image API
dofile(modpath.."/image.lua")
-- Load Text API
dofile(modpath.."/text.lua")
-- Load Inventory API
dofile(modpath.."/inventory.lua")
-- Load Waypoint API
dofile(modpath.."/waypoint.lua")