Partially revert latest commit (fixes #334)
This commit is contained in:
parent
a1a489b668
commit
f40ed854d0
@ -1,10 +1,10 @@
|
|||||||
local player_huds = {} -- KEY: p_name, INDEX: {HUD_BG_ID, HUD_TXT_ID}
|
local player_huds = {} -- KEY: p_name, INDEX: {HUD_BG_ID, HUD_TXT_ID}
|
||||||
|
local hud_type = minetest.features.hud_def_type_field and "type" or "hud_elem_type"
|
||||||
|
|
||||||
|
|
||||||
function arena_lib.HUD_add(player)
|
function arena_lib.HUD_add(player)
|
||||||
local HUD_TITLE_IMG = player:hud_add({
|
local HUD_TITLE_IMG = player:hud_add({
|
||||||
type = "image",
|
[hud_type] = "image",
|
||||||
position = { x = 0.5, y = 0.25},
|
position = { x = 0.5, y = 0.25},
|
||||||
offset = { x = 0, y = 50},
|
offset = { x = 0, y = 50},
|
||||||
text = "",
|
text = "",
|
||||||
@ -14,7 +14,7 @@ function arena_lib.HUD_add(player)
|
|||||||
})
|
})
|
||||||
|
|
||||||
local HUD_TITLE_TXT = player:hud_add({
|
local HUD_TITLE_TXT = player:hud_add({
|
||||||
type = "text",
|
[hud_type] = "text",
|
||||||
position = { x = 0.5, y = 0.25},
|
position = { x = 0.5, y = 0.25},
|
||||||
offset = { x = 0, y = 50},
|
offset = { x = 0, y = 50},
|
||||||
text = "",
|
text = "",
|
||||||
@ -24,7 +24,7 @@ function arena_lib.HUD_add(player)
|
|||||||
})
|
})
|
||||||
|
|
||||||
local HUD_BROADCAST_IMG = player:hud_add({
|
local HUD_BROADCAST_IMG = player:hud_add({
|
||||||
type = "image",
|
[hud_type] = "image",
|
||||||
position = { x = 0.5, y = 0.25},
|
position = { x = 0.5, y = 0.25},
|
||||||
text = "",
|
text = "",
|
||||||
scale = { x = 25, y = 2},
|
scale = { x = 25, y = 2},
|
||||||
@ -33,7 +33,7 @@ function arena_lib.HUD_add(player)
|
|||||||
})
|
})
|
||||||
|
|
||||||
local HUD_BROADCAST_TXT = player:hud_add({
|
local HUD_BROADCAST_TXT = player:hud_add({
|
||||||
type = "text",
|
[hud_type] = "text",
|
||||||
position = { x = 0.5, y = 0.25},
|
position = { x = 0.5, y = 0.25},
|
||||||
text = "",
|
text = "",
|
||||||
number = 0xFFFFFF,
|
number = 0xFFFFFF,
|
||||||
@ -41,7 +41,7 @@ function arena_lib.HUD_add(player)
|
|||||||
})
|
})
|
||||||
|
|
||||||
local HUD_HOTBAR_IMG = player:hud_add({
|
local HUD_HOTBAR_IMG = player:hud_add({
|
||||||
type = "image",
|
[hud_type] = "image",
|
||||||
position = { x = 0.5, y = 1},
|
position = { x = 0.5, y = 1},
|
||||||
offset = {x = 0, y = -105},
|
offset = {x = 0, y = -105},
|
||||||
text = "",
|
text = "",
|
||||||
@ -51,7 +51,7 @@ function arena_lib.HUD_add(player)
|
|||||||
})
|
})
|
||||||
|
|
||||||
local HUD_HOTBAR_TXT = player:hud_add({
|
local HUD_HOTBAR_TXT = player:hud_add({
|
||||||
type = "text",
|
[hud_type] = "text",
|
||||||
position = { x = 0.5, y = 1},
|
position = { x = 0.5, y = 1},
|
||||||
offset = {x = 0, y = -105},
|
offset = {x = 0, y = -105},
|
||||||
text = "",
|
text = "",
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
local S = minetest.get_translator("arena_lib")
|
local S = minetest.get_translator("arena_lib")
|
||||||
|
|
||||||
local waypoints = {} -- KEY: player name; VALUE: {Waypoints IDs}
|
local waypoints = {} -- KEY: player name; VALUE: {Waypoints IDs}
|
||||||
|
local hud_type = minetest.features.hud_def_type_field and "type" or "hud_elem_type"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -18,8 +20,8 @@ function arena_lib.show_waypoints(p_name, mod, arena)
|
|||||||
if not arena.teams_enabled then
|
if not arena.teams_enabled then
|
||||||
for ID, spwn in pairs(arena.spawn_points) do
|
for ID, spwn in pairs(arena.spawn_points) do
|
||||||
local HUD_ID = player:hud_add({
|
local HUD_ID = player:hud_add({
|
||||||
|
[hud_type] = "waypoint",
|
||||||
name = "#" .. ID,
|
name = "#" .. ID,
|
||||||
type = "waypoint",
|
|
||||||
precision = 0,
|
precision = 0,
|
||||||
world_pos = spwn.pos
|
world_pos = spwn.pos
|
||||||
})
|
})
|
||||||
@ -30,8 +32,8 @@ function arena_lib.show_waypoints(p_name, mod, arena)
|
|||||||
for i = 1, #arena.teams do
|
for i = 1, #arena.teams do
|
||||||
for ID, spwn in pairs(arena.spawn_points[i]) do
|
for ID, spwn in pairs(arena.spawn_points[i]) do
|
||||||
local HUD_ID = player:hud_add({
|
local HUD_ID = player:hud_add({
|
||||||
|
[hud_type] = "waypoint",
|
||||||
name = "#" .. ID .. ", " .. arena.teams[i].name,
|
name = "#" .. ID .. ", " .. arena.teams[i].name,
|
||||||
type = "waypoint",
|
|
||||||
precision = 0,
|
precision = 0,
|
||||||
world_pos = spwn.pos
|
world_pos = spwn.pos
|
||||||
})
|
})
|
||||||
@ -43,8 +45,8 @@ function arena_lib.show_waypoints(p_name, mod, arena)
|
|||||||
|
|
||||||
-- punto di ritorno
|
-- punto di ritorno
|
||||||
local HUD_ID = player:hud_add({
|
local HUD_ID = player:hud_add({
|
||||||
|
[hud_type] = "waypoint",
|
||||||
name = arena.custom_return_point and S("Return point (custom)") or S("Return point"),
|
name = arena.custom_return_point and S("Return point (custom)") or S("Return point"),
|
||||||
type = "waypoint",
|
|
||||||
precision = 0,
|
precision = 0,
|
||||||
world_pos = arena.custom_return_point and arena.custom_return_point.pos or arena_lib.mods[mod].settings.return_point.pos
|
world_pos = arena.custom_return_point and arena.custom_return_point.pos or arena_lib.mods[mod].settings.return_point.pos
|
||||||
})
|
})
|
||||||
@ -62,15 +64,15 @@ function arena_lib.show_waypoints(p_name, mod, arena)
|
|||||||
-- personalizzazioni grafiche dell'arena (quindi prob anche peggio)
|
-- personalizzazioni grafiche dell'arena (quindi prob anche peggio)
|
||||||
if arena.pos1 then
|
if arena.pos1 then
|
||||||
local pos1 = player:hud_add({
|
local pos1 = player:hud_add({
|
||||||
|
[hud_type] = "waypoint",
|
||||||
name = "Pos1",
|
name = "Pos1",
|
||||||
type = "waypoint",
|
|
||||||
precision = 0,
|
precision = 0,
|
||||||
world_pos = arena.pos1
|
world_pos = arena.pos1
|
||||||
})
|
})
|
||||||
|
|
||||||
local pos2 = player:hud_add({
|
local pos2 = player:hud_add({
|
||||||
|
[hud_type] = "waypoint",
|
||||||
name = "Pos2",
|
name = "Pos2",
|
||||||
type = "waypoint",
|
|
||||||
precision = 0,
|
precision = 0,
|
||||||
world_pos = arena.pos2
|
world_pos = arena.pos2
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user