Editor: players section, show current value as stack (closes #218)

This commit is contained in:
Zughy 2023-03-27 16:17:08 +02:00
parent ff824337ba
commit 39cc5b87a2
4 changed files with 10 additions and 14 deletions

View File

@ -152,13 +152,10 @@ Arena_lib editor | Now editing: @1=Arena_lib editor | Stai modificando: @1
# editor/editor_icons.lua
Players=Giocatorɜ
Players | num to set: @1 (left/right click slot #4 to change)=Giocatorɜ | num: @1 (click sx/dx su casella #4 per cambiare)
Values are PER TEAM!=I valori sono PER SQUADRA!
Values are PER TEAM! Use item #4 to change value=I valori sono PER SQUADRA! Usa il 4° oggetto per cambiare valore
Spawners=Punti di rinascita
Customise=Personalizza
Pimp my arena=Rendila bella bellina
Settings=Impostazioni
Arena settings=Impostazioni arena
Info=Info
Go back=Torna indietro
Enable and leave=Abilita ed esci
@ -183,7 +180,7 @@ Players required=Giocatorɜ minimɜ
Players supported (right click to remove the limit)=Giocatorɜ massimɜ (tasto dx per rimuovere il limite)
Players supported (click to set a limit)=Giocatorɜ massimɜ (premi per impostare un limite)
Teams amount=Numero squadre
Change the current number=Cambia il numero attuale
Change value (LMB increases, RMB decreases)=Cambia valore (sx aumenta, dx diminuisce)
Teams: on (click to toggle off)=Squadre: attive (premi per disattivare)
Teams: off (click to toggle on)=Squadre: non attive (premi per attivare)

View File

@ -152,13 +152,10 @@ Arena_lib editor | Now editing: @1=
# editor/editor_icons.lua
Players=
Players | num to set: @1 (left/right click slot #4 to change)=
Values are PER TEAM!=
Values are PER TEAM! Use item #4 to change value=
Spawners=
Customise=
Pimp my arena=
Settings=
Arena settings=
Info=
Go back=
Enable and leave=
@ -183,7 +180,7 @@ Players required=
Players supported (right click to remove the limit)=
Players supported (click to set a limit)=
Teams amount=
Change the current number=
Change value (LMB increases, RMB decreases)=
Teams: on (click to toggle off)=
Teams: off (click to toggle on)=

View File

@ -16,7 +16,7 @@ minetest.register_tool("arena_lib:editor_players", {
local _, arena = arena_lib.get_arena_by_name(mod, arena_name)
if arena.teams_enabled then
minetest.chat_send_player(user:get_player_name(), minetest.colorize("#ffdddd", "[arena_lib] " .. S("Values are PER TEAM!")))
minetest.chat_send_player(user:get_player_name(), minetest.colorize("#ffdddd", "[arena_lib] " .. S("Values are PER TEAM! Use item #4 to change value")))
end
user:get_meta():set_int("arena_lib_editor.players_number", 2)

View File

@ -8,7 +8,7 @@ local players_tools = {
"", -- arena_lib:players_min
"", -- arena_lib:players_max or players_max_inf
"", -- arena_lib:teams_amount
"arena_lib:players_change",
"arena_lib:players_change 2",
"",
"", -- arena_lib:players_teams_on/off
"",
@ -119,10 +119,11 @@ minetest.register_node("arena_lib:players_teams_amount", {
minetest.register_tool("arena_lib:players_change", {
minetest.register_node("arena_lib:players_change", {
description = S("Change the current number"),
description = S("Change value (LMB increases, RMB decreases)"),
inventory_image = "arenalib_tool_players_change.png",
wield_image = "arenalib_tool_players_change.png",
groups = {not_in_creative_inventory = 1},
on_drop = function() end,
@ -234,6 +235,7 @@ function change_amount(player, decrease)
else return end
end
player:set_wielded_item("arena_lib:players_change " .. amount)
player:get_meta():set_int("arena_lib_editor.players_number", amount)
end