fix HUD, remove tothepoint

This commit is contained in:
MisterE 2024-07-07 12:07:38 -04:00
parent 350a34a3f8
commit cf3a0268f8
4 changed files with 28 additions and 21 deletions

View File

@ -263,19 +263,19 @@ bb_schems.register_arena({
bb_schems.register_arena({
-- bb_schems.register_arena({
name = "ToThePoint", --the author of the arenas
author = "MisterE",
schem = schemdir.."tothepoint.mts", --the absolute file location of the schematic
min = 2, --minimum players
max = 2, --maximum players
spawns = {
vector.new(12,1,5),
vector.new(1,1,1),
}, --a table of spawn locations
spectator_pos = vector.new(7,13,4), -- spectator position
})
-- name = "ToThePoint", --the author of the arenas
-- author = "MisterE",
-- schem = schemdir.."tothepoint.mts", --the absolute file location of the schematic
-- min = 2, --minimum players
-- max = 2, --maximum players
-- spawns = {
-- vector.new(12,1,5),
-- vector.new(1,1,1),
-- }, --a table of spawn locations
-- spectator_pos = vector.new(7,13,4), -- spectator position
-- })

View File

@ -25,7 +25,7 @@ arena_lib.register_minigame(modname,{
background_image = "bb_player_gui_hotbar_2.png",
selected_image = "blank.png",
},
load_time = 8,
load_time = 4,
min_players = 2,
regenerate_map = true,
disable_inventory = true,

View File

@ -1,23 +1,27 @@
local infohuds = {}
function blockbomber.add_info_hud(p_name)
local player = minetest.get_player_by_name(p_name)
if not player then return end
infohuds[p_name] = player:hud_add({
local id = player:hud_add({
hud_elem_type = "text",
number = 0xE6482E,
position = { x = .97, y = .03},
offset = {x = 0, y = 0},
text = "Loading ...",
alignment = {x = -1, y = 1}, -- change y later!
scale = {x = 100, y = 100}, -- covered later
alignment = {x = -1, y = 1},
scale = {x = 100, y = 100},
size = {x = 2 },
})
infohuds[p_name] = id
end
function blockbomber.remove_info_hud(p_name)
local player = minetest.get_player_by_name(p_name)
if not player then return end
if infohuds[p_name] then
player:hud_remove(infohuds[p_name])
infohuds[p_name] = nil
@ -27,6 +31,7 @@ end
function blockbomber.set_info_hud(p_name, info)
local player = minetest.get_player_by_name(p_name)
if not player then return end
if infohuds[p_name] then
player:hud_change(infohuds[p_name],"text", info)
end

View File

@ -148,13 +148,11 @@ arena_lib.on_celebration(blockbomber.modname, function(arena, winner)
})
end
for pl_name, stats in pairs(arena.players) do
cleanup_player(pl_name, stats)
end
-- for pl_name, stats in pairs(arena.players) do
-- cleanup_player(pl_name, stats)
-- end
end
end)
arena_lib.on_end(blockbomber.modname, function(arena, winners, is_forced)
@ -163,6 +161,10 @@ arena_lib.on_end(blockbomber.modname, function(arena, winners, is_forced)
end
end)
arena_lib.on_eliminate(blockbomber.modname, function(arena, p_name, xc_name, p_properties)
cleanup_player(p_name, p_properties)
end)
arena_lib.on_time_tick(blockbomber.modname, function(arena)
-- handle sudden death
if arena.current_time > arena.sudden_death_time and not arena.sudden_death then