wasplib: add get_hud_by_texture

master
cora 2021-08-31 21:47:42 +02:00
parent a3cc763e87
commit ed50852a6a
1 changed files with 14 additions and 0 deletions

View File

@ -166,6 +166,20 @@ function ws.do_area(radius,func,plane)
end
end
function ws.get_hud_by_texture(texture)
local def
local i = -1
repeat
i = i + 1
def = minetest.localplayer:hud_get(i)
until not def or def.text == texture
if def then
return def
end
def.number=0
return def
end
function ws.display_wp(pos,name)
local ix = #ws.displayed_wps + 1