Avoid hud_elem_type deprecation warnings if MT 5.9+

This commit is contained in:
marco_a 2024-09-02 01:02:11 +02:00
parent 92bb9d2718
commit da5289d977
2 changed files with 20 additions and 19 deletions

View File

@ -1,5 +1,5 @@
panel_lib = {}
local version = "3.2.0"
local version = "3.2.1"
local srcpath = minetest.get_modpath("panel_lib") .. "/src"
dofile(srcpath .. "/api.lua")

View File

@ -1,9 +1,10 @@
local panels = {} -- KEY: p_name; VALUE: {{"panel name" = panel}, {"panel name 2" = panel2}, ...}
local function clone_table() end
local function add_sub_elem() end
local function update_sub_elems() end
local panels = {} -- KEY: p_name; VALUE: {{"panel name" = panel}, {"panel name 2" = panel2}, ...}
local hud_type = minetest.features.hud_def_type_field and "type" or "hud_elem_type"
Panel = {
name = "",
-- player to show the panel to
@ -15,7 +16,7 @@ Panel = {
-- because the panel is composed by a background and a text we need to
-- define the two HUD to use later
background_def = {
hud_elem_type = "image",
[hud_type] = "image",
position = { x = 0.5, y = 0.5 },
scale = { x = 1, y = 1 },
alignment = { x = 0, y = 0 },
@ -24,7 +25,7 @@ Panel = {
z_index = 0
},
title_def = {
hud_elem_type = "text",
[hud_type] = "text",
position = {x = 0.5, y = 0.5},
alignment = {x = 0, y = 0},
offset = {x = 0, y = 0},