Fix deprecated field 'hud_elem_type' and limit line length

This commit is contained in:
SmallJoker 2025-06-15 15:28:18 +02:00
parent 240e6cc68a
commit dd17b6ce17
3 changed files with 12 additions and 7 deletions

View File

@ -1,6 +1,6 @@
unused_args = false
allow_defined_top = true
max_line_length = 999
max_line_length = 131
globals = {
"unified_inventory",
@ -11,8 +11,9 @@ read_globals = {
table = {fields = {"copy", "getn"}},
"dump",
"minetest", "vector",
"core", "minetest",
"ItemStack", "datastorage",
"vector",
"hb",
"doors",

View File

@ -143,18 +143,21 @@ local function formspec_add_categories(player, formspec, ui_peruser)
if ui.current_category[player_name] == category.name then
scale = 1
end
formspec[n] = formspec_button(ui_peruser, "category_"..category.name, category.symbol, categories_pos, {column-1, 0}, scale, category.label)
formspec[n] = formspec_button(ui_peruser, "category_"..category.name, category.symbol, categories_pos,
{column-1, 0}, scale, category.label)
n = n + 1
end
end
if category_count > ui_peruser.pagecols and scroll_offset > 0 then
-- prev
formspec[n] = formspec_button(ui_peruser, "prev_category", "ui_left_icon.png", categories_scroll_pos, {ui_peruser.pagecols - 2, 0}, 0.8, S("Scroll categories left"))
formspec[n] = formspec_button(ui_peruser, "prev_category", "ui_left_icon.png", categories_scroll_pos,
{ui_peruser.pagecols - 2, 0}, 0.8, S("Scroll categories left"))
n = n + 1
end
if category_count > ui_peruser.pagecols and category_count - scroll_offset > ui_peruser.pagecols then
-- next
formspec[n] = formspec_button(ui_peruser, "next_category", "ui_right_icon.png", categories_scroll_pos, {ui_peruser.pagecols - 1, 0}, 0.8, S("Scroll categories right"))
formspec[n] = formspec_button(ui_peruser, "next_category", "ui_right_icon.png", categories_scroll_pos,
{ui_peruser.pagecols - 1, 0}, 0.8, S("Scroll categories right"))
end
end

View File

@ -164,7 +164,8 @@ ui.register_page("waypoints", {
},
{
"toggle_display_pos",
waypoint.display_pos and "ui_green_icon_background.png^ui_xyz_icon.png" or "ui_red_icon_background.png^ui_xyz_icon.png^(ui_no.png^[transformR90)",
waypoint.display_pos and "ui_green_icon_background.png^ui_xyz_icon.png" or
"ui_red_icon_background.png^ui_xyz_icon.png^(ui_no.png^[transformR90)",
waypoint.display_pos and S("Hide coordinates") or S("Show coordinates")
},
{
@ -254,7 +255,7 @@ local function update_hud(player, waypoints, temp, i)
end
if waypoint.active then
temp.hud = player:hud_add({
hud_elem_type = "waypoint",
[core.features.hud_def_type_field and "type" or "hud_elem_type"] = "waypoint",
number = hud_colors[waypoint.color or 1][2] ,
name = name,
text = "m",