Editor: team toggler is now hidden if no team has been declared
This commit is contained in:
parent
16e613c17f
commit
21ec90e00e
@ -25,7 +25,7 @@ minetest.register_tool("arena_lib:editor_players", {
|
|||||||
arena_lib.HUD_send_msg("hotbar", user:get_player_name(), S("Players | num to set: @1 (left/right click slot #3 to change)", 2))
|
arena_lib.HUD_send_msg("hotbar", user:get_player_name(), S("Players | num to set: @1 (left/right click slot #3 to change)", 2))
|
||||||
|
|
||||||
minetest.after(0, function()
|
minetest.after(0, function()
|
||||||
arena_lib.give_players_tools(user:get_inventory(), arena)
|
arena_lib.give_players_tools(user:get_inventory(), mod, arena)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -129,13 +129,18 @@ minetest.register_tool("arena_lib:players_teams_off", {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function arena_lib.give_players_tools(inv, arena)
|
function arena_lib.give_players_tools(inv, mod, arena)
|
||||||
|
|
||||||
inv:set_list("main", players_tools)
|
inv:set_list("main", players_tools)
|
||||||
|
|
||||||
inv:set_stack("main", 1, "arena_lib:players_min " .. arena.min_players)
|
inv:set_stack("main", 1, "arena_lib:players_min " .. arena.min_players)
|
||||||
inv:set_stack("main", 2, "arena_lib:players_max " .. arena.max_players)
|
inv:set_stack("main", 2, "arena_lib:players_max " .. arena.max_players)
|
||||||
|
|
||||||
|
local mod_ref = arena_lib.mods[mod]
|
||||||
|
|
||||||
|
-- se non ha le squadre, non do l'oggetto per attivarle/disattivarle
|
||||||
|
if not next(mod_ref.teams) then return end
|
||||||
|
|
||||||
if arena.teams_enabled then
|
if arena.teams_enabled then
|
||||||
inv:set_stack("main", 5, "arena_lib:players_teams_on")
|
inv:set_stack("main", 5, "arena_lib:players_teams_on")
|
||||||
else
|
else
|
||||||
|
2
api.lua
2
api.lua
@ -431,7 +431,7 @@ function arena_lib.toggle_teams_per_arena(sender, mod, arena_name, enable, in_ed
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- se non ci sono team nella mod, annullo
|
-- se non ci sono team nella mod, annullo
|
||||||
if #arena_lib.mods[mod].teams == 1 then
|
if not next(arena_lib.mods[mod].teams) then
|
||||||
minetest.chat_send_player(sender, minetest.colorize("#e6482e", S("[!] Teams are not enabled!")))
|
minetest.chat_send_player(sender, minetest.colorize("#e6482e", S("[!] Teams are not enabled!")))
|
||||||
return end
|
return end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user