mirror of
https://github.com/minetest-mods/areas.git
synced 2024-11-16 23:50:18 +01:00
add API documentation for modding extension
This commit is contained in:
parent
77a30f9e05
commit
70ed7e34a0
21
api.md
Normal file
21
api.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
# 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)
|
Loading…
Reference in New Issue
Block a user