Avoid hud_elem_type
deprecation warnings if MT 5.9+
This commit is contained in:
parent
92bb9d2718
commit
da5289d977
2
init.lua
2
init.lua
@ -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")
|
||||
|
37
src/api.lua
37
src/api.lua
@ -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,24 +16,24 @@ 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",
|
||||
position = { x = 0.5, y = 0.5 },
|
||||
scale = { x = 1, y = 1 },
|
||||
alignment = { x = 0, y = 0 },
|
||||
offset = {x = 0, y = 0},
|
||||
text = "panel_bg.png",
|
||||
z_index = 0
|
||||
[hud_type] = "image",
|
||||
position = { x = 0.5, y = 0.5 },
|
||||
scale = { x = 1, y = 1 },
|
||||
alignment = { x = 0, y = 0 },
|
||||
offset = {x = 0, y = 0},
|
||||
text = "panel_bg.png",
|
||||
z_index = 0
|
||||
},
|
||||
title_def = {
|
||||
hud_elem_type = "text",
|
||||
position = {x = 0.5, y = 0.5},
|
||||
alignment = {x = 0, y = 0},
|
||||
offset = {x = 0, y = 0},
|
||||
size = { x = 1 },
|
||||
number = 0xFFFFFF,
|
||||
text = "",
|
||||
style = 0,
|
||||
z_index = 0
|
||||
[hud_type] = "text",
|
||||
position = {x = 0.5, y = 0.5},
|
||||
alignment = {x = 0, y = 0},
|
||||
offset = {x = 0, y = 0},
|
||||
size = { x = 1 },
|
||||
number = 0xFFFFFF,
|
||||
text = "",
|
||||
style = 0,
|
||||
z_index = 0
|
||||
},
|
||||
|
||||
sub_img_elems = {}, -- KEY: ID, VALUE: name
|
||||
|
Loading…
x
Reference in New Issue
Block a user