wasplib: add get_hud_by_texture
parent
a3cc763e87
commit
ed50852a6a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue