areas/api.md

22 lines
540 B
Markdown
Raw Normal View History

# API Extension
Adding your protections to the HUD
----------------------------------
If you are providing an extra protection mod to work in cunjunction with the
HUD feature of `areas`, you can register a callback to add your mod's code to
display your protection's existence. For example
local myhandler = function(pos,arealist)
local areaowner = find_my_protections(pos)
if areaowner then
arealist["mymodname"] = {
name = "Protection name",
owner = areaowner,
}
end
end
areas.register_hud_handler(myhandler)