From 4691bd2d0e7527cab9f13987de06efad5926ac06 Mon Sep 17 00:00:00 2001 From: Zughy <4279489-marco_a@users.noreply.gitlab.com> Date: Sun, 9 Jan 2022 23:26:52 +0100 Subject: [PATCH] Editor: clean up (new Customise section) --- init.lua | 1 + locale/arena_lib.it.tr | 2 ++ locale/template.txt | 2 ++ src/editor/editor_icons.lua | 10 ++++---- src/editor/editor_main.lua | 7 +++-- src/editor/tools_bgm.lua | 10 ++------ src/editor/tools_customise.lua | 19 ++++++++++++++ src/editor/tools_players.lua | 1 - src/editor/tools_settings.lua | 1 - src/editor/tools_sign.lua | 1 - src/editor/tools_sky.lua | 24 +++--------------- src/editor/tools_spawner.lua | 1 - ...tor_bgm.png => arenalib_customise_bgm.png} | Bin ...tor_sky.png => arenalib_customise_sky.png} | Bin textures/arenalib_editor_customise.png | Bin 0 -> 163 bytes textures/arenalib_gui_hotbar10.png | Bin 174 -> 0 bytes textures/arenalib_gui_hotbar9.png | Bin 0 -> 172 bytes textures/arenalib_immunity.png | Bin 189 -> 0 bytes textures/arenalib_tool_settings_rename.png | Bin 132 -> 0 bytes textures/arenalib_tool_settings_timer.png | Bin 191 -> 200 bytes 20 files changed, 38 insertions(+), 41 deletions(-) create mode 100644 src/editor/tools_customise.lua rename textures/{arenalib_editor_bgm.png => arenalib_customise_bgm.png} (100%) rename textures/{arenalib_editor_sky.png => arenalib_customise_sky.png} (100%) create mode 100644 textures/arenalib_editor_customise.png delete mode 100755 textures/arenalib_gui_hotbar10.png create mode 100755 textures/arenalib_gui_hotbar9.png delete mode 100755 textures/arenalib_immunity.png delete mode 100755 textures/arenalib_tool_settings_rename.png diff --git a/init.lua b/init.lua index 8c0e244..e3ba24e 100755 --- a/init.lua +++ b/init.lua @@ -19,6 +19,7 @@ dofile(srcpath .. "/dependencies/parties.lua") dofile(srcpath .. "/editor/editor_main.lua") dofile(srcpath .. "/editor/editor_icons.lua") dofile(srcpath .. "/editor/tools_bgm.lua") +dofile(srcpath .. "/editor/tools_customise.lua") dofile(srcpath .. "/editor/tools_players.lua") dofile(srcpath .. "/editor/tools_settings.lua") dofile(srcpath .. "/editor/tools_sign.lua") diff --git a/locale/arena_lib.it.tr b/locale/arena_lib.it.tr index b3b2b50..5d320f9 100755 --- a/locale/arena_lib.it.tr +++ b/locale/arena_lib.it.tr @@ -175,6 +175,8 @@ Spawners=Spawner Spawners | sel. ID: @1 (right click slot #2 to change)=Spawner | ID sel.: @1 (tasto dx su slot #2 per cambiare) Signs=Cartelli One sign per arena=Un cartello per arena +Customise=Personalizza +Pimp my arena=Rendila bella bellina Settings=Impostazioni Arena settings=Impostazioni arena Info=Info diff --git a/locale/template.txt b/locale/template.txt index 71243a6..afd0edf 100755 --- a/locale/template.txt +++ b/locale/template.txt @@ -175,6 +175,8 @@ Spawners= Spawners | sel. ID: @1 (right click slot #2 to change)= Signs= One sign per arena= +Customise= +Pimp my arena= Settings= Arena settings= Info= diff --git a/src/editor/editor_icons.lua b/src/editor/editor_icons.lua index 81f1c28..516a89a 100755 --- a/src/editor/editor_icons.lua +++ b/src/editor/editor_icons.lua @@ -78,20 +78,20 @@ minetest.register_tool("arena_lib:editor_signs", { -minetest.register_tool("arena_lib:editor_bgm", { +minetest.register_tool("arena_lib:editor_customise", { - description = S("BGM"), - inventory_image = "arenalib_editor_bgm.png", + description = S("Customise"), + inventory_image = "arenalib_editor_customise.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("Background music")) + arena_lib.HUD_send_msg("hotbar", user:get_player_name(), S("Pimp my arena")) minetest.after(0, function() - arena_lib.give_bgm_tools(user) + arena_lib.give_customise_tools(user) end) end diff --git a/src/editor/editor_main.lua b/src/editor/editor_main.lua index ec31a1c..78fae57 100755 --- a/src/editor/editor_main.lua +++ b/src/editor/editor_main.lua @@ -6,8 +6,7 @@ local editor_tools = { "arena_lib:editor_players", "arena_lib:editor_spawners", "arena_lib:editor_signs", - "arena_lib:editor_sky", - "arena_lib:editor_bgm", + "arena_lib:editor_customise", "arena_lib:editor_settings", "", "arena_lib:editor_info", @@ -115,8 +114,8 @@ function arena_lib.enter_editor(sender, mod, arena_name) player:get_meta():set_string("arena_lib_editor.mod", mod) player:get_meta():set_string("arena_lib_editor.arena", arena_name) - player:hud_set_hotbar_itemcount(10) - player:hud_set_hotbar_image("arenalib_gui_hotbar10.png") + player:hud_set_hotbar_itemcount(9) + player:hud_set_hotbar_image("arenalib_gui_hotbar9.png") -- imposto volta celeste, controllando ogni elemento onde evitare un ripristino causa passaggio zero argomenti if next(arena.celestial_vault) then diff --git a/src/editor/tools_bgm.lua b/src/editor/tools_bgm.lua index 562cef1..d3ccb38 100755 --- a/src/editor/tools_bgm.lua +++ b/src/editor/tools_bgm.lua @@ -8,10 +8,10 @@ local audio_currently_playing = {} -- KEY p_name; VALUE sound handle -minetest.register_tool("arena_lib:editor_bgm", { +minetest.register_tool("arena_lib:customise_bgm", { description = S("Background music"), - inventory_image = "arenalib_editor_bgm.png", + inventory_image = "arenalib_customise_bgm.png", groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = "2"}, on_place = function() end, on_drop = function() end, @@ -28,12 +28,6 @@ minetest.register_tool("arena_lib:editor_bgm", { -function arena_lib.give_bgm_tools(player) - player:get_inventory():set_list("main", bgm_tools) -end - - - ---------------------------------------------- diff --git a/src/editor/tools_customise.lua b/src/editor/tools_customise.lua new file mode 100644 index 0000000..71c6e6c --- /dev/null +++ b/src/editor/tools_customise.lua @@ -0,0 +1,19 @@ +local S = minetest.get_translator("arena_lib") + +local customise_tools = { + "arena_lib:customise_bgm", + "arena_lib:customise_sky", + "", + "", + "", + "", + "", + "arena_lib:editor_return", + "arena_lib:editor_quit", +} + + + +function arena_lib.give_customise_tools(user) + user:get_inventory():set_list("main", customise_tools) +end diff --git a/src/editor/tools_players.lua b/src/editor/tools_players.lua index 17c8d8c..d96c10e 100755 --- a/src/editor/tools_players.lua +++ b/src/editor/tools_players.lua @@ -10,7 +10,6 @@ local players_tools = { "", -- arena_lib:players_teams_on/off "", "", - "", "arena_lib:editor_return", "arena_lib:editor_quit", } diff --git a/src/editor/tools_settings.lua b/src/editor/tools_settings.lua index 1ee2e4d..b877f54 100755 --- a/src/editor/tools_settings.lua +++ b/src/editor/tools_settings.lua @@ -12,7 +12,6 @@ local settings_tools = { "", -- timer_off/_on "", "", - "", "arena_lib:settings_delete", "", "arena_lib:editor_return", diff --git a/src/editor/tools_sign.lua b/src/editor/tools_sign.lua index 762c77d..577acf0 100755 --- a/src/editor/tools_sign.lua +++ b/src/editor/tools_sign.lua @@ -7,7 +7,6 @@ local spawners_tools = { "", "", "", - "", "arena_lib:editor_return", "arena_lib:editor_quit", } diff --git a/src/editor/tools_sky.lua b/src/editor/tools_sky.lua index 8b35010..49712f1 100755 --- a/src/editor/tools_sky.lua +++ b/src/editor/tools_sky.lua @@ -12,25 +12,13 @@ local function get_palette_col_and_sorted_table() end local function compare_elem() end local temp_sky_settings = {} -- KEY = p_name; VALUE = {all the sky settings} -local sky_tools = { - "arena_lib:sky", - "", - "", - "", - "", - "", - "", - "", - "arena_lib:editor_return", - "arena_lib:editor_quit", -} -minetest.register_tool("arena_lib:editor_sky", { +minetest.register_tool("arena_lib:customise_sky", { description = S("Celestial vault"), - inventory_image = "arenalib_editor_sky.png", + inventory_image = "arenalib_customise_sky.png", groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = "2"}, on_place = function() end, on_drop = function() end, @@ -44,16 +32,12 @@ minetest.register_tool("arena_lib:editor_sky", { fill_tempsky(p_name, arena) - minetest.show_formspec(p_name, "arena_lib:settings_sky", get_celvault_formspec(p_name, "sky")) + minetest.show_formspec(p_name, "arena_lib:celestial_vault", get_celvault_formspec(p_name, "sky")) end }) -function arena_lib.give_sky_tools(player) - player:get_inventory():set_list("main", sky_tools) -end - ---------------------------------------------- @@ -412,7 +396,7 @@ end minetest.register_on_player_receive_fields(function(player, formname, fields) - if formname ~= "arena_lib:settings_sky" then return end + if formname ~= "arena_lib:celestial_vault" then return end local p_name = player:get_player_name() local temp_sky = temp_sky_settings[p_name].sky diff --git a/src/editor/tools_spawner.lua b/src/editor/tools_spawner.lua index fa71df5..493271f 100755 --- a/src/editor/tools_spawner.lua +++ b/src/editor/tools_spawner.lua @@ -21,7 +21,6 @@ local spawners_tools_noteam = { "arena_lib:spawner_deleteall", "", "", - "", "arena_lib:editor_return", "arena_lib:editor_quit", } diff --git a/textures/arenalib_editor_bgm.png b/textures/arenalib_customise_bgm.png similarity index 100% rename from textures/arenalib_editor_bgm.png rename to textures/arenalib_customise_bgm.png diff --git a/textures/arenalib_editor_sky.png b/textures/arenalib_customise_sky.png similarity index 100% rename from textures/arenalib_editor_sky.png rename to textures/arenalib_customise_sky.png diff --git a/textures/arenalib_editor_customise.png b/textures/arenalib_editor_customise.png new file mode 100644 index 0000000000000000000000000000000000000000..d93692b501e096df7e2470b25d2427487b9a780b GIT binary patch literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`S)MMAAr-fh6C{idIJm#JzuD#Z zr<_~(pKvON$HjlAICdn>NRv>@;P5y&UH6g(S7#BUhtM*~w!|cs!wk=IW*qx{f8U{- zC+;b}DA^S2;3Ki1d!h)p!TX6%WK(8eG(6eal_D-6thePX_Yww%YS(#IADcJT0c~aQ MboFyt=akR{0Px#8f&c&j literal 0 HcmV?d00001 diff --git a/textures/arenalib_gui_hotbar10.png b/textures/arenalib_gui_hotbar10.png deleted file mode 100755 index 6ae7f3425cefa8cac67aabc3e46b01a8136db94b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 174 zcmeAS@N?(olHy`uVBq!ia0y~yU@QT$)ft(Ar0N01zd(vDz$e5NNCUyr^quE{6jMo% zUob=Q{`qhB0ePXGE{-7;w~`YU7*6;P1ndg`?(-d~f75uxS)gCOqy7qW=V6CG{OeXU zGA?~2^4SILLkuc{0A%Mt3I_17txfgwWp#|o|# QZBCH2p00i_>zopr0HD@6)c^nh diff --git a/textures/arenalib_gui_hotbar9.png b/textures/arenalib_gui_hotbar9.png new file mode 100755 index 0000000000000000000000000000000000000000..8379a0619897491a3bd77ce9b0b937af6a1afc0b GIT binary patch literal 172 zcmeAS@N?(olHy`uVBq!ia0y~yVDtyF)ft(AyS}+407an*uJzt9ILZ9m+Qjgs=&^PY})FQDAds^4K{+ hiJ9eqWRJpQhBedqdP+9By#m_6;OXk;vd$@?2>_PlJ#+v7 diff --git a/textures/arenalib_tool_settings_rename.png b/textures/arenalib_tool_settings_rename.png deleted file mode 100755 index be871de8cf60f45952cc2017e5431d19424635aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`-kvUwAr-fh6C@-LIJm#JzsNPw z(C5v+?d$(@N-+g@^dzzgnlMBP8ntx_zGZS^Q>gCM&{vRd&~uw6UeLyQlr7*5YYk(k eb}f%G14GuO*EX9kY~2ntmci52&t;ucLK6TWk|&S= diff --git a/textures/arenalib_tool_settings_timer.png b/textures/arenalib_tool_settings_timer.png index abfe6f19e06f7270c5abb3ecb1bd4921e65a1649..dae90192cf92fab8966294b21005cb0a59d9c443 100755 GIT binary patch delta 172 zcmdnbc!F_)O1)fwPl&6#uFd^#Uk!Bh7DNZ{uZ;MzMY^eAO4sX;{vp{5CikVMoZra6 zz`$4%=b|$;&I?mMP1bBrZXbl28Vt5EfNd*0~3G3=Nt! z1&#;+MYvR1jym$VJ9fG_3K}r4kUEhNAjZO^%qHM0b4WG8NKC{ej3GKPXH83%CJO_@ Y>$P0`$IJ|4ftE0My85}Sb4q9e0N0y0WdHyG delta 163 zcmV;U09^mb0lxu|B!3uCOjJbx001y7E}&aef^d|-d06zc8;a}k-}d#!3!6&-0004W zQchCwZ{MyUXh zkzQP024c9E7n_%tfEhqJAcH}u90(K{K#Vd7gHfrxTuA_Ig&dNSAgZMh005#@7a8Sf Rp(p?V002ovPDHLkV1krSI_3ZX