2020-05-29 14:22:47 -07:00
|
|
|
local S = minetest.get_translator("arena_lib")
|
|
|
|
|
|
|
|
|
2020-06-23 14:13:11 -07:00
|
|
|
|
|
|
|
minetest.register_tool("arena_lib:editor_players", {
|
|
|
|
|
|
|
|
description = S("Players"),
|
|
|
|
inventory_image = "arenalib_editor_players.png",
|
|
|
|
groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = "2"},
|
|
|
|
on_place = function() end,
|
|
|
|
on_drop = function() end,
|
|
|
|
|
|
|
|
on_use = function(itemstack, user)
|
|
|
|
|
2020-06-26 09:43:13 -07:00
|
|
|
local mod = user:get_meta():get_string("arena_lib_editor.mod")
|
|
|
|
local arena_name = user:get_meta():get_string("arena_lib_editor.arena")
|
|
|
|
local id, arena = arena_lib.get_arena_by_name(mod, arena_name)
|
|
|
|
|
2020-06-26 16:04:42 -07:00
|
|
|
if arena.teams_enabled then
|
2020-06-26 09:43:13 -07:00
|
|
|
minetest.chat_send_player(user:get_player_name(), minetest.colorize("#ffdddd", "[arena_lib] " .. S("Values are PER TEAM!")))
|
|
|
|
end
|
|
|
|
|
2020-06-23 14:13:11 -07:00
|
|
|
user:get_meta():set_int("arena_lib_editor.players_number", 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))
|
2022-07-05 06:35:28 -07:00
|
|
|
arena_lib.give_players_tools(user:get_inventory(), mod, arena)
|
2020-06-23 14:13:11 -07:00
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2020-05-29 14:22:47 -07:00
|
|
|
|
2020-05-28 17:34:22 -07:00
|
|
|
minetest.register_tool("arena_lib:editor_spawners", {
|
|
|
|
|
2020-05-29 14:22:47 -07:00
|
|
|
description = S("Spawners"),
|
2020-05-28 17:34:22 -07:00
|
|
|
inventory_image = "arenalib_editor_spawners.png",
|
|
|
|
groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = "2"},
|
|
|
|
on_place = function() end,
|
|
|
|
on_drop = function() end,
|
|
|
|
|
|
|
|
on_use = function(itemstack, user)
|
|
|
|
|
|
|
|
user:get_meta():set_int("arena_lib_editor.spawner_ID", 1)
|
2020-05-31 13:38:59 -07:00
|
|
|
user:get_meta():set_int("arena_lib_editor.team_ID", 1)
|
|
|
|
|
2020-05-29 14:22:47 -07:00
|
|
|
arena_lib.HUD_send_msg("hotbar", user:get_player_name(), S("Spawners | sel. ID: @1 (right click slot #2 to change)", 1))
|
2022-07-05 06:35:28 -07:00
|
|
|
arena_lib.give_spawners_tools(user)
|
2020-05-28 17:34:22 -07:00
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minetest.register_tool("arena_lib:editor_signs", {
|
|
|
|
|
2020-05-29 14:22:47 -07:00
|
|
|
description = S("Signs"),
|
2020-05-28 17:34:22 -07:00
|
|
|
inventory_image = "arenalib_editor_signs.png",
|
|
|
|
groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = "2"},
|
|
|
|
on_place = function() end,
|
|
|
|
on_drop = function() end,
|
|
|
|
|
|
|
|
on_use = function(itemstack, user)
|
2020-05-29 14:22:47 -07:00
|
|
|
arena_lib.HUD_send_msg("hotbar", user:get_player_name(), S("One sign per arena"))
|
2022-07-05 06:35:28 -07:00
|
|
|
arena_lib.give_signs_tools(user)
|
2020-05-28 17:34:22 -07:00
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-09 14:26:52 -08:00
|
|
|
minetest.register_tool("arena_lib:editor_customise", {
|
2020-12-01 13:30:27 -08:00
|
|
|
|
2022-01-09 14:26:52 -08:00
|
|
|
description = S("Customise"),
|
|
|
|
inventory_image = "arenalib_editor_customise.png",
|
2020-12-01 13:30:27 -08:00
|
|
|
groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = "2"},
|
|
|
|
on_place = function() end,
|
|
|
|
on_drop = function() end,
|
|
|
|
|
|
|
|
on_use = function(itemstack, user)
|
2022-01-09 14:26:52 -08:00
|
|
|
arena_lib.HUD_send_msg("hotbar", user:get_player_name(), S("Pimp my arena"))
|
2022-07-05 06:35:28 -07:00
|
|
|
arena_lib.give_customise_tools(user)
|
2020-12-01 13:30:27 -08:00
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-30 16:29:32 -07:00
|
|
|
minetest.register_tool("arena_lib:editor_settings", {
|
|
|
|
|
|
|
|
description = S("Settings"),
|
|
|
|
inventory_image = "arenalib_editor_settings.png",
|
|
|
|
groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = "2"},
|
|
|
|
on_place = function() end,
|
|
|
|
on_drop = function() end,
|
|
|
|
|
|
|
|
on_use = function(itemstack, user)
|
|
|
|
|
|
|
|
arena_lib.HUD_send_msg("hotbar", user:get_player_name(), S("Arena settings"))
|
|
|
|
|
2022-07-05 06:35:28 -07:00
|
|
|
arena_lib.give_settings_tools(user)
|
2020-08-30 16:29:32 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 17:34:22 -07:00
|
|
|
minetest.register_tool("arena_lib:editor_info", {
|
|
|
|
|
2020-05-29 14:22:47 -07:00
|
|
|
description = S("Info"),
|
2020-05-28 17:34:22 -07:00
|
|
|
inventory_image = "arenalib_editor_info.png",
|
|
|
|
groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = "2"},
|
|
|
|
on_place = function() end,
|
|
|
|
on_drop = function() end,
|
|
|
|
|
|
|
|
on_use = function(itemstack, user)
|
|
|
|
|
|
|
|
local mod = user:get_meta():get_string("arena_lib_editor.mod")
|
|
|
|
local arena_name = user:get_meta():get_string("arena_lib_editor.arena")
|
|
|
|
|
|
|
|
arena_lib.print_arena_info(user:get_player_name(), mod, arena_name)
|
|
|
|
end
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minetest.register_tool("arena_lib:editor_return", {
|
|
|
|
|
2020-05-29 14:22:47 -07:00
|
|
|
description = S("Go back"),
|
2020-05-28 17:34:22 -07:00
|
|
|
inventory_image = "arenalib_editor_return.png",
|
|
|
|
groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = "2"},
|
|
|
|
on_place = function() end,
|
|
|
|
on_drop = function() end,
|
|
|
|
|
|
|
|
on_use = function(itemstack, user)
|
2022-07-05 06:35:28 -07:00
|
|
|
arena_lib.show_main_editor(user)
|
2020-05-28 17:34:22 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-13 05:44:15 -07:00
|
|
|
minetest.register_tool("arena_lib:editor_enable", {
|
|
|
|
|
|
|
|
description = S("Enable and leave"),
|
|
|
|
inventory_image = "arenalib_editor_enable.png",
|
|
|
|
groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = "2"},
|
|
|
|
on_place = function() end,
|
|
|
|
on_drop = function() end,
|
|
|
|
|
|
|
|
on_use = function(itemstack, user)
|
|
|
|
|
|
|
|
local mod = user:get_meta():get_string("arena_lib_editor.mod")
|
|
|
|
local arena_name = user:get_meta():get_string("arena_lib_editor.arena")
|
|
|
|
|
2020-07-01 05:47:23 -07:00
|
|
|
arena_lib.enable_arena(user:get_player_name(), mod, arena_name, true)
|
2020-06-13 05:44:15 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 17:34:22 -07:00
|
|
|
minetest.register_tool("arena_lib:editor_quit", {
|
|
|
|
|
2021-02-15 14:53:32 -08:00
|
|
|
description = S("Leave"),
|
2020-05-28 17:34:22 -07:00
|
|
|
inventory_image = "arenalib_editor_quit.png",
|
|
|
|
groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = "2"},
|
|
|
|
on_place = function() end,
|
|
|
|
on_drop = function() end,
|
|
|
|
|
|
|
|
on_use = function(itemstack, user)
|
|
|
|
arena_lib.quit_editor(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
})
|