hud_elem_type deprecation fix breaks pre-5.9.0 Minetest
Since you recently switched from hud_elem_type
to type
in a1a489b6, this breaks all pre-5.9.0 clients because HUD elements become all garbled. Despite what the commit message claims, this change is NOT retrocompatible.
If you want to preserve-backwards-compability (and I hope you want to), you could assign the correct field name in a variable like so:
local hud_def_type_field
if minetest.features.hud_def_type_field then
hud_def_type_field = "type"
else
hud_def_type_field = "hud_elem_type"
end
-- ... lots of code ...
player:hud_add({
[hud_def_type_field] = "text",
offset = { x = 0, y = 0 },
-- etc.
})
It's unfortunate this field was deprecated (in fact, I HATE it) but sadly, we have to live with that for now.
Edited by Wuzzy