From 640b0dc4859014f15939cce0be36dd06c2b1419c Mon Sep 17 00:00:00 2001 From: AFCMS Date: Wed, 2 Jun 2021 00:23:11 +0200 Subject: [PATCH 01/17] basic title API working (testing needed) --- mods/HUD/mcl_title/init.lua | 161 ++++++++++++++++++++++++++++++++++++ mods/HUD/mcl_title/mod.conf | 4 + 2 files changed, 165 insertions(+) create mode 100644 mods/HUD/mcl_title/init.lua create mode 100644 mods/HUD/mcl_title/mod.conf diff --git a/mods/HUD/mcl_title/init.lua b/mods/HUD/mcl_title/init.lua new file mode 100644 index 000000000..9975ff840 --- /dev/null +++ b/mods/HUD/mcl_title/init.lua @@ -0,0 +1,161 @@ +--TODO: use SSCSM to reduce lag and network trafic (just send modchannel messages) +--TODO: exactly mc like layout + +local huds_idx = {} + +huds_idx.title = {} +huds_idx.subtitle = {} +huds_idx.actionbar = {} + +mcl_title = {} +mcl_title.defaults = {fadein = 10, stay = 70, fadeout = 20} +mcl_title.layout = {} +mcl_title.layout.title = {position = {x = 0.5, y = 0.5}, alignment = {x = 0, y = -1.3}, size = 5} +mcl_title.layout.subtitle = {position = {x = 0.5, y = 0.5}, alignment = {x = 0, y = 1.9}, size = 2} +mcl_title.layout.actionbar = {position = {x = 0.5, y = 1}, alignment = {x = 0, y = -15}, size = 1} + +local get_color = mcl_util.get_color + +local function gametick_to_secondes(gametick) + return gametick / 20 +end + + +--PARAMS SYSTEM +local player_params = {} + +minetest.register_on_joinplayer(function(player) + player_params[player] = { + stay = gametick_to_secondes(mcl_title.defaults.stay), + --fadeIn = gametick_to_secondes(mcl_title.defaults.fadein), + --fadeOut = gametick_to_secondes(mcl_title.defaults.fadeout), + } +end) + +minetest.register_on_leaveplayer(function(player) + player_params = nil +end) + +function mcl_title.params_set(player, data) + player_params[player] = { + stay = gametick_to_secondes(data.stay) or gametick_to_secondes(mcl_title.defaults.stay), + --fadeIn = gametick_to_secondes(data.fadeIn) or gametick_to_secondes(mcl_title.defaults.fadein), + --fadeOut = gametick_to_secondes(data.fadeOut) or gametick_to_secondes(mcl_title.defaults.fadeout), + } +end + +function mcl_title.params_get(player) + return player_params[player] +end + +--API FUNCTIONS + +function mcl_title.set(player, type, data) + if not data.color then + data.color = "white" + end + local _, hex_color = get_color(data.color) + if not hex_color then + return false + end + + if huds_idx[type][player] then + player:hud_remove(huds_idx[type][player]) + end + + --TODO: enable this code then Fleckenstein's pr get merged + --[[ + local bold + if data.bold == "true" then + bold = true + else + bold = false + end + + local italic + if data.italic == "true" then + italic = true + else + italic = false + end]] + + local stay = mcl_title.params_get(player).stay + + huds_idx[type][player] = player:hud_add({ + hud_elem_type = "text", + position = mcl_title.layout[type].position, + alignment = mcl_title.layout[type].alignment, + text = data.text, + --bold = bold, + --italic = italic, + size = {x = mcl_title.layout[type].size}, + number = hex_color, + z_index = 1100, + }) + + minetest.after(stay, function() + if huds_idx[type][player] then + player:hud_remove(huds_idx[type][player]) + end + huds_idx[type][player] = nil + end) + return true +end + +function mcl_title.remove(player, type) + if huds_idx[type][player] then + player:hud_remove(huds_idx[type][player]) + end + huds_idx[type][player] = nil +end + +function mcl_title.clear(player) + mcl_title.remove(player, "title") + mcl_title.remove(player, "subtitle") + mcl_title.remove(player, "actionbar") +end + +minetest.register_on_dieplayer(function(player) + mcl_title.clear(player) +end) + + +--TEMP STUFF!! +--TODO: remove then testing/tweaking done +minetest.register_chatcommand("title", { + func = function(name, param) + local player = minetest.get_player_by_name(name) + mcl_title.set(player, "title", {text=param, color="gold"}) + end, +}) + +minetest.register_chatcommand("subtitle", { + func = function(name, param) + local player = minetest.get_player_by_name(name) + mcl_title.set(player, "subtitle", {text=param, color="gold"}) + end, +}) + +minetest.register_chatcommand("actionbar", { + func = function(name, param) + local player = minetest.get_player_by_name(name) + mcl_title.set(player, "actionbar", {text=param, color="gold"}) + end, +}) + +minetest.register_chatcommand("timeout", { + func = function(name, param) + local player = minetest.get_player_by_name(name) + mcl_title.params_set(player, {stay = 600}) + end, +}) + +minetest.register_chatcommand("all", { + func = function(name, param) + local player = minetest.get_player_by_name(name) + mcl_title.params_set(player, {stay = 600}) + mcl_title.set(player, "title", {text=param, color="gold"}) + mcl_title.set(player, "subtitle", {text=param, color="gold"}) + mcl_title.set(player, "actionbar", {text=param, color="gold"}) + end, +}) \ No newline at end of file diff --git a/mods/HUD/mcl_title/mod.conf b/mods/HUD/mcl_title/mod.conf new file mode 100644 index 000000000..0f29a8118 --- /dev/null +++ b/mods/HUD/mcl_title/mod.conf @@ -0,0 +1,4 @@ +name = mcl_title +description = Add an API to add in HUD title +depends = mcl_colors +author = AFCMS \ No newline at end of file From 6b53dda79bf8b31309206ea29b6e84184cc17fc7 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Wed, 2 Jun 2021 00:25:15 +0200 Subject: [PATCH 02/17] add todo list --- mods/HUD/mcl_title/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/HUD/mcl_title/init.lua b/mods/HUD/mcl_title/init.lua index 9975ff840..41b4dfc4a 100644 --- a/mods/HUD/mcl_title/init.lua +++ b/mods/HUD/mcl_title/init.lua @@ -1,4 +1,5 @@ --TODO: use SSCSM to reduce lag and network trafic (just send modchannel messages) +--TODO: fadeIn and fadeOut animation (needs engine change: SSCSM or native support) --TODO: exactly mc like layout local huds_idx = {} From c8102838cb80e5ada8649a7ccf48c1c288a4de2b Mon Sep 17 00:00:00 2001 From: AFCMS Date: Wed, 2 Jun 2021 00:26:10 +0200 Subject: [PATCH 03/17] add missing TODO entry (bold+italic) --- mods/HUD/mcl_title/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/HUD/mcl_title/init.lua b/mods/HUD/mcl_title/init.lua index 41b4dfc4a..807ed19c9 100644 --- a/mods/HUD/mcl_title/init.lua +++ b/mods/HUD/mcl_title/init.lua @@ -65,6 +65,7 @@ function mcl_title.set(player, type, data) end --TODO: enable this code then Fleckenstein's pr get merged + --TODO: be sure API is correctly used --[[ local bold if data.bold == "true" then From 7e64470f7086c2978f0ad48710d6c0f253b6c3cb Mon Sep 17 00:00:00 2001 From: AFCMS Date: Wed, 2 Jun 2021 11:07:31 +0200 Subject: [PATCH 04/17] fix future API usage of bold+italic pr --- mods/HUD/mcl_title/init.lua | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/mods/HUD/mcl_title/init.lua b/mods/HUD/mcl_title/init.lua index 807ed19c9..83277b3bf 100644 --- a/mods/HUD/mcl_title/init.lua +++ b/mods/HUD/mcl_title/init.lua @@ -64,22 +64,10 @@ function mcl_title.set(player, type, data) player:hud_remove(huds_idx[type][player]) end - --TODO: enable this code then Fleckenstein's pr get merged - --TODO: be sure API is correctly used - --[[ - local bold - if data.bold == "true" then - bold = true - else - bold = false - end + --TODO: enable this code then Fleckenstein's pr get merged (in about 5-6 years) - local italic - if data.italic == "true" then - italic = true - else - italic = false - end]] + --if data.bold == nil then data.bold = false end + --if data.italic == nil then data.italic = false end local stay = mcl_title.params_get(player).stay @@ -88,8 +76,8 @@ function mcl_title.set(player, type, data) position = mcl_title.layout[type].position, alignment = mcl_title.layout[type].alignment, text = data.text, - --bold = bold, - --italic = italic, + --bold = data.bold, + --italic = data.italic, size = {x = mcl_title.layout[type].size}, number = hex_color, z_index = 1100, From b9fd1ac227c59407a92ca208d1fd71681c7952f0 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Wed, 2 Jun 2021 11:12:15 +0200 Subject: [PATCH 05/17] credit digminecraft for the tutorial --- mods/HUD/mcl_title/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/HUD/mcl_title/init.lua b/mods/HUD/mcl_title/init.lua index 83277b3bf..a2fd82b24 100644 --- a/mods/HUD/mcl_title/init.lua +++ b/mods/HUD/mcl_title/init.lua @@ -1,3 +1,5 @@ +--Based on https://www.digminecraft.com/game_commands/title_command.php + --TODO: use SSCSM to reduce lag and network trafic (just send modchannel messages) --TODO: fadeIn and fadeOut animation (needs engine change: SSCSM or native support) --TODO: exactly mc like layout From 2603c4768ba34be059b8f3dd175985bc08683cea Mon Sep 17 00:00:00 2001 From: AFCMS Date: Mon, 7 Jun 2021 22:32:05 +0200 Subject: [PATCH 06/17] mcl_title: basic mc like layout (collide with other mods) --- mods/HUD/mcl_title/init.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mods/HUD/mcl_title/init.lua b/mods/HUD/mcl_title/init.lua index a2fd82b24..ffd740b4a 100644 --- a/mods/HUD/mcl_title/init.lua +++ b/mods/HUD/mcl_title/init.lua @@ -1,7 +1,11 @@ ---Based on https://www.digminecraft.com/game_commands/title_command.php +--Based on: +--https://www.digminecraft.com/game_commands/title_command.php +--https://youtu.be/oVrtQRO2hpY --TODO: use SSCSM to reduce lag and network trafic (just send modchannel messages) --TODO: fadeIn and fadeOut animation (needs engine change: SSCSM or native support) +--TODO: allow obfuscating text (needs engine change: SSCSM or native support) +--TODO: allow colorizing and styling of part of the text (NEEDS ENGINE CHANGE!!!) --TODO: exactly mc like layout local huds_idx = {} @@ -13,9 +17,9 @@ huds_idx.actionbar = {} mcl_title = {} mcl_title.defaults = {fadein = 10, stay = 70, fadeout = 20} mcl_title.layout = {} -mcl_title.layout.title = {position = {x = 0.5, y = 0.5}, alignment = {x = 0, y = -1.3}, size = 5} -mcl_title.layout.subtitle = {position = {x = 0.5, y = 0.5}, alignment = {x = 0, y = 1.9}, size = 2} -mcl_title.layout.actionbar = {position = {x = 0.5, y = 1}, alignment = {x = 0, y = -15}, size = 1} +mcl_title.layout.title = {position = {x = 0.5, y = 0.5}, alignment = {x = 0, y = -1.3}, size = 7} +mcl_title.layout.subtitle = {position = {x = 0.5, y = 0.5}, alignment = {x = 0, y = 1.7}, size = 4} +mcl_title.layout.actionbar = {position = {x = 0.5, y = 1}, alignment = {x = 0, y = -11}, size = 2} local get_color = mcl_util.get_color From 8e931e92f57ce18792a846828e0e942f52f8eef1 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Fri, 9 Jul 2021 11:34:23 +0200 Subject: [PATCH 07/17] refactor mcl_title to be more efficient --- mods/HUD/mcl_title/init.lua | 120 +++++++++++++++++++++++++++--------- 1 file changed, 90 insertions(+), 30 deletions(-) diff --git a/mods/HUD/mcl_title/init.lua b/mods/HUD/mcl_title/init.lua index ffd740b4a..48c3a909f 100644 --- a/mods/HUD/mcl_title/init.lua +++ b/mods/HUD/mcl_title/init.lua @@ -8,8 +8,17 @@ --TODO: allow colorizing and styling of part of the text (NEEDS ENGINE CHANGE!!!) --TODO: exactly mc like layout +--Note that the table storing timeouts use playername as index insteed of player objects (faster) +--This is intended in order to speedup the process of removing HUD elements the the timeout is up + local huds_idx = {} +local hud_hide_timeouts = {} + +hud_hide_timeouts.title = {} +hud_hide_timeouts.subtitle = {} +hud_hide_timeouts.actionbar = {} + huds_idx.title = {} huds_idx.subtitle = {} huds_idx.actionbar = {} @@ -19,10 +28,13 @@ mcl_title.defaults = {fadein = 10, stay = 70, fadeout = 20} mcl_title.layout = {} mcl_title.layout.title = {position = {x = 0.5, y = 0.5}, alignment = {x = 0, y = -1.3}, size = 7} mcl_title.layout.subtitle = {position = {x = 0.5, y = 0.5}, alignment = {x = 0, y = 1.7}, size = 4} -mcl_title.layout.actionbar = {position = {x = 0.5, y = 1}, alignment = {x = 0, y = -11}, size = 2} +mcl_title.layout.actionbar = {position = {x = 0.5, y = 1}, alignment = {x = 0, y = 0}, size = 1} local get_color = mcl_util.get_color +local string = string +local pairs = pairs + local function gametick_to_secondes(gametick) return gametick / 20 end @@ -32,15 +44,64 @@ end local player_params = {} minetest.register_on_joinplayer(function(player) - player_params[player] = { + local playername = player:get_player_name() + player_params[playername] = { stay = gametick_to_secondes(mcl_title.defaults.stay), --fadeIn = gametick_to_secondes(mcl_title.defaults.fadein), --fadeOut = gametick_to_secondes(mcl_title.defaults.fadeout), - } + } + local _, hex_color = get_color("white") + huds_idx.title[player] = player:hud_add({ + hud_elem_type = "text", + position = mcl_title.layout.title.position, + alignment = mcl_title.layout.title.alignment, + text = "", + --bold = data.bold, + --italic = data.italic, + size = {x = mcl_title.layout.title.size}, + number = hex_color, + z_index = 100, + }) + huds_idx.subtitle[player] = player:hud_add({ + hud_elem_type = "text", + position = mcl_title.layout.subtitle.position, + alignment = mcl_title.layout.subtitle.alignment, + text = "", + --bold = data.bold, + --italic = data.italic, + size = {x = mcl_title.layout.subtitle.size}, + number = hex_color, + z_index = 100, + }) + huds_idx.actionbar[player] = player:hud_add({ + hud_elem_type = "text", + position = mcl_title.layout.actionbar.position, + offset = {x = 0, y = -210}, + alignment = mcl_title.layout.actionbar.alignment, + --bold = data.bold, + --italic = data.italic, + text = "", + size = {x = mcl_title.layout.actionbar.size}, + number = hex_color, + z_index = 100, + }) end) minetest.register_on_leaveplayer(function(player) - player_params = nil + local playername = player:get_player_name() + + --remove player params from the list + player_params[player] = nil + + --remove HUD idx from the list (HUD elements are removed by the engine) + huds_idx.title[player] = nil + huds_idx.subtitle[player] = nil + huds_idx.actionbar[player] = nil + + --remove timers form list + hud_hide_timeouts.title[playername] = nil + hud_hide_timeouts.subtitle[playername] = nil + hud_hide_timeouts.actionbar[playername] = nil end) function mcl_title.params_set(player, data) @@ -66,43 +127,22 @@ function mcl_title.set(player, type, data) return false end - if huds_idx[type][player] then - player:hud_remove(huds_idx[type][player]) - end - --TODO: enable this code then Fleckenstein's pr get merged (in about 5-6 years) --if data.bold == nil then data.bold = false end --if data.italic == nil then data.italic = false end - local stay = mcl_title.params_get(player).stay + player:hud_change(huds_idx[type][player], "text", data.text) + player:hud_change(huds_idx[type][player], "number", hex_color) - huds_idx[type][player] = player:hud_add({ - hud_elem_type = "text", - position = mcl_title.layout[type].position, - alignment = mcl_title.layout[type].alignment, - text = data.text, - --bold = data.bold, - --italic = data.italic, - size = {x = mcl_title.layout[type].size}, - number = hex_color, - z_index = 1100, - }) - - minetest.after(stay, function() - if huds_idx[type][player] then - player:hud_remove(huds_idx[type][player]) - end - huds_idx[type][player] = nil - end) + hud_hide_timeouts[type][player:get_player_name()] = data.stay or mcl_title.params_get(player).stay return true end function mcl_title.remove(player, type) - if huds_idx[type][player] then - player:hud_remove(huds_idx[type][player]) + if player then + player:hud_change(huds_idx[type][player], "text", "") end - huds_idx[type][player] = nil end function mcl_title.clear(player) @@ -115,6 +155,26 @@ minetest.register_on_dieplayer(function(player) mcl_title.clear(player) end) +minetest.register_globalstep(function(dtime) + local new_timeouts = { + title = {}, + subtitle = {}, + actionbar = {}, + } + for element, content in pairs(hud_hide_timeouts) do + for name, timeout in pairs(content) do + timeout = timeout - dtime + if timeout <= 0 then + local player = minetest.get_player_by_name(name) + mcl_title.remove(player, element) + else + new_timeouts[element][name] = timeout + end + end + end + hud_hide_timeouts = new_timeouts +end) + --TEMP STUFF!! --TODO: remove then testing/tweaking done From b5f7ae54583197b55bb5e8f5f81a6605fa4f74e8 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Tue, 20 Jul 2021 15:47:26 +0200 Subject: [PATCH 08/17] working implementation + support of other mods --- mods/ENTITIES/mcl_boats/init.lua | 2 +- mods/ENTITIES/mcl_boats/mod.conf | 2 +- mods/ENTITIES/mcl_minecarts/init.lua | 2 +- mods/ENTITIES/mcl_minecarts/mod.conf | 2 +- mods/HUD/mcl_title/init.lua | 5 ++--- mods/ITEMS/mcl_beds/functions.lua | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mods/ENTITIES/mcl_boats/init.lua b/mods/ENTITIES/mcl_boats/init.lua index 76ace7a45..e81e9ffc5 100644 --- a/mods/ENTITIES/mcl_boats/init.lua +++ b/mods/ENTITIES/mcl_boats/init.lua @@ -84,7 +84,7 @@ local function attach_object(self, obj) end end, name) obj:set_look_horizontal(yaw) - mcl_tmp_message.message(obj, S("Sneak to dismount")) + mcl_title.set(obj, "actionbar", {text=S("Sneak to dismount"), color="white", stay=3}) else obj:get_luaentity()._old_visual_size = visual_size end diff --git a/mods/ENTITIES/mcl_boats/mod.conf b/mods/ENTITIES/mcl_boats/mod.conf index a5d6cc8cb..61463b6ec 100644 --- a/mods/ENTITIES/mcl_boats/mod.conf +++ b/mods/ENTITIES/mcl_boats/mod.conf @@ -1,7 +1,7 @@ name = mcl_boats author = PilzAdam description = Adds drivable boats. -depends = mcl_player, flowlib +depends = mcl_player, flowlib, mcl_title optional_depends = mcl_core, doc_identifier diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index e33e120a1..a76ab538a 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -646,7 +646,7 @@ register_minecart( if player then mcl_player.player_set_animation(player, "sit" , 30) player:set_eye_offset({x=0, y=-5.5, z=0},{x=0, y=-4, z=0}) - mcl_tmp_message.message(clicker, S("Sneak to dismount")) + mcl_title.set(clicker, "actionbar", {text=S("Sneak to dismount"), color="white", stay=3}) end end, name) end diff --git a/mods/ENTITIES/mcl_minecarts/mod.conf b/mods/ENTITIES/mcl_minecarts/mod.conf index 9fff9175d..3b8ae5551 100644 --- a/mods/ENTITIES/mcl_minecarts/mod.conf +++ b/mods/ENTITIES/mcl_minecarts/mod.conf @@ -1,6 +1,6 @@ name = mcl_minecarts author = Krock description = Minecarts are vehicles to move players quickly on rails. -depends = mcl_explosions, mcl_core, mcl_sounds, mcl_player, mcl_achievements, mcl_chests, mcl_furnaces, mesecons_commandblock, mcl_hoppers, mcl_tnt, mesecons +depends = mcl_title, mcl_explosions, mcl_core, mcl_sounds, mcl_player, mcl_achievements, mcl_chests, mcl_furnaces, mesecons_commandblock, mcl_hoppers, mcl_tnt, mesecons optional_depends = doc_identifier, mcl_wip diff --git a/mods/HUD/mcl_title/init.lua b/mods/HUD/mcl_title/init.lua index 48c3a909f..03fe17614 100644 --- a/mods/HUD/mcl_title/init.lua +++ b/mods/HUD/mcl_title/init.lua @@ -45,7 +45,7 @@ local player_params = {} minetest.register_on_joinplayer(function(player) local playername = player:get_player_name() - player_params[playername] = { + player_params[player] = { stay = gametick_to_secondes(mcl_title.defaults.stay), --fadeIn = gametick_to_secondes(mcl_title.defaults.fadein), --fadeOut = gametick_to_secondes(mcl_title.defaults.fadeout), @@ -127,14 +127,13 @@ function mcl_title.set(player, type, data) return false end - --TODO: enable this code then Fleckenstein's pr get merged (in about 5-6 years) + --TODO: enable this code then Fleckenstein's pr get merged (in about 5-6 years lol) --if data.bold == nil then data.bold = false end --if data.italic == nil then data.italic = false end player:hud_change(huds_idx[type][player], "text", data.text) player:hud_change(huds_idx[type][player], "number", hex_color) - hud_hide_timeouts[type][player:get_player_name()] = data.stay or mcl_title.params_get(player).stay return true end diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index dc9afe2ba..f323ca4c7 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -330,7 +330,7 @@ function mcl_beds.on_rightclick(pos, player, is_top) message = select(2, lay_down(player, ppos, other)) end if message then - mcl_tmp_message.message(player, message) + mcl_title.set(player, "actionbar", {text=message, color="white", stay=3}) end else lay_down(player, nil, nil, false) From c31c852a6ea63eb2ffed49089881866fb59df0ed Mon Sep 17 00:00:00 2001 From: AFCMS Date: Tue, 20 Jul 2021 16:14:34 +0200 Subject: [PATCH 09/17] add documentation --- mods/ENTITIES/mcl_boats/init.lua | 2 +- mods/ENTITIES/mcl_minecarts/init.lua | 2 +- mods/HUD/mcl_title/API.md | 42 ++++++++++++++++++++++++++++ mods/HUD/mcl_title/init.lua | 2 +- mods/ITEMS/mcl_beds/functions.lua | 2 +- 5 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 mods/HUD/mcl_title/API.md diff --git a/mods/ENTITIES/mcl_boats/init.lua b/mods/ENTITIES/mcl_boats/init.lua index e81e9ffc5..311b07882 100644 --- a/mods/ENTITIES/mcl_boats/init.lua +++ b/mods/ENTITIES/mcl_boats/init.lua @@ -84,7 +84,7 @@ local function attach_object(self, obj) end end, name) obj:set_look_horizontal(yaw) - mcl_title.set(obj, "actionbar", {text=S("Sneak to dismount"), color="white", stay=3}) + mcl_title.set(obj, "actionbar", {text=S("Sneak to dismount"), color="white", stay=60}) else obj:get_luaentity()._old_visual_size = visual_size end diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index a76ab538a..4d3873cc2 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -646,7 +646,7 @@ register_minecart( if player then mcl_player.player_set_animation(player, "sit" , 30) player:set_eye_offset({x=0, y=-5.5, z=0},{x=0, y=-4, z=0}) - mcl_title.set(clicker, "actionbar", {text=S("Sneak to dismount"), color="white", stay=3}) + mcl_title.set(clicker, "actionbar", {text=S("Sneak to dismount"), color="white", stay=60}) end end, name) end diff --git a/mods/HUD/mcl_title/API.md b/mods/HUD/mcl_title/API.md new file mode 100644 index 000000000..50614be4f --- /dev/null +++ b/mods/HUD/mcl_title/API.md @@ -0,0 +1,42 @@ +# mcl_title + +Allow mods to show messages in the hud of players. + +## mcl_title.set(player, type, data) + +Show a hud message of `type` to player `player` with `data` as params. + +The element will stay for the per-player param `stay` or `data.stay` (in gametick which is 1/20 second). + +Here is a usage exemple: + +```lua +--show a title in the HUD with minecraft color "gold" +mcl_title.set(player, "title", {text="dummy text", color="gold"}) + +--show a subtitle in the HUD with hex color "#612D2D" +mcl_title.set(player, "subtitle", {text="dummy subtitle", color="#612D2D"}) + +--show an actionbar in the HUD (above the hotbar) with minecraft color "red" +mcl_title.set(player, "subtitle", {text="dummy actionbar", color="red"}) + +--show a title in the HUD with minecraft color "gold" staying for 3 seconds (override stay setting) +mcl_title.set(player, "title", {text="dummy text", color="gold", stay=3}) +``` + +## mcl_title.remove(player, type) + +Hide HUD element of type `type` for player `player`. + +## mcl_title.clear(player) + +Remove every title/subtitle/actionbar from a player. +Basicaly run `mcl_title.remove(player, type)` for every type. + +## mcl_title.params_set(player, params) + +Allow mods to set `stay` and upcomming `fadeIn`/`fadeOut` params. + +```lua +mcl_title.params_set(player, {stay = 600}) --elements with no 'data.stay' field will stay during 30s (600/20) +``` \ No newline at end of file diff --git a/mods/HUD/mcl_title/init.lua b/mods/HUD/mcl_title/init.lua index 03fe17614..d1dbece4b 100644 --- a/mods/HUD/mcl_title/init.lua +++ b/mods/HUD/mcl_title/init.lua @@ -134,7 +134,7 @@ function mcl_title.set(player, type, data) player:hud_change(huds_idx[type][player], "text", data.text) player:hud_change(huds_idx[type][player], "number", hex_color) - hud_hide_timeouts[type][player:get_player_name()] = data.stay or mcl_title.params_get(player).stay + hud_hide_timeouts[type][player:get_player_name()] = gametick_to_secondes(data.stay) or mcl_title.params_get(player).stay return true end diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index f323ca4c7..e196f69ad 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -330,7 +330,7 @@ function mcl_beds.on_rightclick(pos, player, is_top) message = select(2, lay_down(player, ppos, other)) end if message then - mcl_title.set(player, "actionbar", {text=message, color="white", stay=3}) + mcl_title.set(player, "actionbar", {text=message, color="white", stay=60}) end else lay_down(player, nil, nil, false) From f8dcf056707c917f2b77aead6669ee0d05905c86 Mon Sep 17 00:00:00 2001 From: NO11 Date: Wed, 11 Aug 2021 15:41:45 +0000 Subject: [PATCH 10/17] Add MC like nodebox for anvils --- mods/ITEMS/mcl_anvils/init.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index fbf6fb751..51b78da6f 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -297,9 +297,10 @@ local anvildef = { node_box = { type = "fixed", fixed = { - {-8/16, 2/16, -5/16, 8/16, 8/16, 5/16}, -- top - {-5/16, -4/16, -2/16, 5/16, 5/16, 2/16}, -- middle - {-8/16, -8/16, -5/16, 8/16, -4/16, 5/16}, -- base + { -6/16, -8/16, -6/16, 6/16, -4/16, 6/16 }, + { -5/16, -4/16, -4/16, 5/16, -3/16, 4/16 }, + { -4/16, -3/16, -2/16, 4/16, 2/16, 2/16 }, + { -8/16, 2/16, -5/16, 8/16, 8/16, 5/16 }, } }, sounds = mcl_sounds.node_sound_metal_defaults(), From cb55c36863b429a8328c98bc478d525d081727ca Mon Sep 17 00:00:00 2001 From: NO11 Date: Wed, 11 Aug 2021 15:44:43 +0000 Subject: [PATCH 11/17] Correct the texture of anvils Because of the new node_nox, the textures have to be a little bit bigger. --- .../mcl_anvils_anvil_top_damaged_0.png | Bin 195 -> 6074 bytes .../mcl_anvils_anvil_top_damaged_1.png | Bin 209 -> 5855 bytes .../mcl_anvils_anvil_top_damaged_2.png | Bin 220 -> 5882 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/mods/ITEMS/mcl_anvils/textures/mcl_anvils_anvil_top_damaged_0.png b/mods/ITEMS/mcl_anvils/textures/mcl_anvils_anvil_top_damaged_0.png index 84c64e9159abbd2703d701a32211caa4cc9b8418..43938aa7265afa58d0394ae683e7815a6159dc40 100644 GIT binary patch literal 6074 zcmeHLc~leE8Xr&uBUW6hpdcYERbaA_1QLnL5+DK+AS~8(GBd%^WF{s9Nd&d1R0PEx zH*hKL3l*y(wSrVZT2aAbU5co>hf9Ifr`Vsmazd}VTxU)EOh5kIO6y+Vtdc~$0%5X z4Xl(6749Bmk3Y;QKN~bc2-&=Bm*%;ugOl5;behBa`K4^Tm&y*i+JgDlrCWU?e-5d$ zPt%6oeGzzMNrz?*X^+eeT;?aXFFU>J_Pm8(SYi>OCv4l2X~sWVMP7Yd<6f1&xt%O5 zYCkseVN7Z@oA`EF(7A7417RJjxqTOXlWl!#{9}%CaCOFZ=Rv^pzF++{bls1K4+p)R zQL<7|i^s8ZO3D2lGrwxFE*@@ElB@bv)PfLdhdJg&3nuUPJ9_NNHP^?$-Z85;?X7yc zLpdHV7c4n@$HTVu&p=;4zmpb?@~LE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&FoX$-nT(SxBT{Nq36`z%8pnV>@G;fPwP z!C}Nd9>ECL?nza0jkaiZfh|z-X@;Zg8OTP#DqhCg_(O15o64n@! z3jG8W!+iM?C5%e=#-ALJ%j6*(HdP8SK`M*I^`P>kVh)wVg&~9oa+q8RvzwFi^^p&xl|U{gG1#ZA|90`mT)|zJRXzF+4(gvekU=mBv(cx;YwW*$&CeiVYMQ6*+j1sOC5GSVe5 zf4mY`hzJ1%RfuE=U4_Yv1BQ(;EC;~|k>PX*D4?-lr%>^IaYRHY@kpgoE}$4@OEyRv z4;9(7^SJPXl(3O#1S1l|iR(ObJ|Y?2*z`1>C4b%L!T+Tc5v$Z<|DVn$XqSpNPH2_* z>`**Z9EZTfmvue|?otXzWT=|J6NG=WsQES?7_79&(x!r)R_Y#5@7UoT>(ZKK6!(1gyy)002NQLKy7d>w#q-TNifa9@7W_0OEvx z-jSBqT`Er6n1Ysmlj4#!x%)SzaDO1L-UaBbs=cRct&4|ev;%}A0Rma`<6kW*+O_w3 z@+>ay?G!GKt4RsnpMOXCW|is8`UkGVZ|ydJvn_vglHU7z!Ut$@-TI$bj_}&tx0C_4 akwUgRUaj0-vC;5ngU~<3Z@15^lz#)4DYXCq delta 163 zcmV;U09^myEztpxBL)B%P)t-slm8VMe;sF9xBvhE0d!JMQvg8b*k%9#0B1==K~#7F z9m~ND0zn8yVRmd_SutKmw*g}ZBrp|#Q-K{g{Tu$8}E3 za0gU)FPMq~VeUxoV_~1)8Mu6f0uhP5d4|=ssf}NuvD_28@-6qm<9r^S{_@Ka5oW~6 RhyMTo002ovPDHLkV1mc^K{fyY diff --git a/mods/ITEMS/mcl_anvils/textures/mcl_anvils_anvil_top_damaged_2.png b/mods/ITEMS/mcl_anvils/textures/mcl_anvils_anvil_top_damaged_2.png index 5f5cfbffa6f0ebd6c1fa06ad201cb312ca6875e0..096f65eac2203e52431aebcd73c473f68a690441 100644 GIT binary patch literal 5882 zcmeHLX;f3!7QPH3rHG)2pbQ~Vs$xbmOH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ES/mcl_boats/locale/mcl_boats.fr.tr | 5 +++-- .../mcl_minecarts/locale/mcl_minecarts.fr.tr | 1 + mods/ENTITIES/mobs_mc/locale/template.txt | 1 + mods/HELP/doc/doc_items/locale/doc_items.fr.tr | 2 +- mods/HUD/mcl_credits/locale/mcl_credits.de.tr | 1 + mods/HUD/mcl_credits/locale/mcl_credits.es.tr | 14 ++++++++++++++ mods/HUD/mcl_credits/locale/mcl_credits.fr.tr | 14 ++++++++++++++ mods/HUD/mcl_credits/locale/mcl_credits.pl.tr | 14 ++++++++++++++ mods/HUD/mcl_credits/locale/mcl_credits.ru.tr | 14 ++++++++++++++ mods/ITEMS/mcl_chests/init.lua | 2 +- mods/ITEMS/mcl_chests/locale/template.txt | 2 +- .../ITEMS/mcl_fireworks/locale/mcl_fireworks.es.tr | 3 +++ .../ITEMS/mcl_fireworks/locale/mcl_fireworks.fr.tr | 3 +++ .../ITEMS/mcl_fireworks/locale/mcl_fireworks.ru.tr | 3 +++ mods/ITEMS/mcl_maps/locale/mcl_maps.fr.tr | 5 ++++- 15 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 mods/HUD/mcl_credits/locale/mcl_credits.es.tr create mode 100644 mods/HUD/mcl_credits/locale/mcl_credits.fr.tr create mode 100644 mods/HUD/mcl_credits/locale/mcl_credits.pl.tr create mode 100644 mods/HUD/mcl_credits/locale/mcl_credits.ru.tr create mode 100644 mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.es.tr create mode 100644 mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.fr.tr create mode 100644 mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.ru.tr diff --git a/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr b/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr index 04d6d9da9..785d50146 100644 --- a/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr +++ b/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr @@ -6,6 +6,7 @@ Boats are used to travel on the surface of water.=Les bateaux sont utilisés pou Dark Oak Boat=Bateau en Chêne Noir Jungle Boat=Bateau en Acajou Oak Boat=Bateau en Chêne -Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.=Faites un clic droit sur une source d'eau pour placer le bateau. Faites un clic droit sur le bateau pour y entrer. Utilisez [Gauche] et [Droite] pour diriger, [Avant] pour accélérer et [Arrière] pour ralentir ou reculer. Cliquez de nouveau avec le bouton droit sur le bateau pour le quitter, frappez le bateau pour le faire tomber en tant qu'objet. +Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.=Faites un clic droit sur une source d'eau pour placer le bateau. Faites un clic droit sur le bateau pour y entrer. Utilisez [Gauche] et [Droite] pour diriger, [Avant] pour accélérer et [Arrière] pour ralentir ou reculer. Utilisez [Sneak] pour le quitter, frappez le bateau pour le faire tomber en tant qu'objet. Spruce Boat=Bateau en Sapin -Water vehicle=Véhicule aquatique \ No newline at end of file +Water vehicle=Véhicule aquatique +Sneak to dismount= \ No newline at end of file diff --git a/mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.fr.tr b/mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.fr.tr index 39cdfd013..67ed5eb1b 100644 --- a/mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.fr.tr +++ b/mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.fr.tr @@ -33,3 +33,4 @@ Activates minecarts when powered=Active les wagonnets lorsqu'il est alimenté Emits redstone power when a minecart is detected=Émet de l'énergie redstone lorsqu'un wagonnet est détecté Vehicle for fast travel on rails=Véhicule pour voyager rapidement sur rails Can be ignited by tools or powered activator rail=Peut être allumé par des outils ou un rail d'activation motorisé +Sneak to dismount= \ No newline at end of file diff --git a/mods/ENTITIES/mobs_mc/locale/template.txt b/mods/ENTITIES/mobs_mc/locale/template.txt index 04ba9e465..7b55c1b89 100644 --- a/mods/ENTITIES/mobs_mc/locale/template.txt +++ b/mods/ENTITIES/mobs_mc/locale/template.txt @@ -28,6 +28,7 @@ Pig= Polar Bear= Rabbit= Killer Bunny= +The Killer Bunny= Sheep= Shulker= Silverfish= diff --git a/mods/HELP/doc/doc_items/locale/doc_items.fr.tr b/mods/HELP/doc/doc_items/locale/doc_items.fr.tr index 5d655404d..824ceeeba 100644 --- a/mods/HELP/doc/doc_items/locale/doc_items.fr.tr +++ b/mods/HELP/doc/doc_items/locale/doc_items.fr.tr @@ -2,7 +2,7 @@ Using it as fuel turns it into: @1.=L'utiliser comme combustible le transforme en : @1. @1 seconds=@1 secondes # Item count times item name -%@1×@2=%@1×@ +@1×@2=@1×@ # Itemname (25%) @1 (@2%)=@1 (@2%) # Itemname (<0.5%) diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.de.tr b/mods/HUD/mcl_credits/locale/mcl_credits.de.tr index 6a38d18e6..fa26f5bc4 100644 --- a/mods/HUD/mcl_credits/locale/mcl_credits.de.tr +++ b/mods/HUD/mcl_credits/locale/mcl_credits.de.tr @@ -7,6 +7,7 @@ Creator of MineClone2=Schöpfer von MineClone2 Developers=Entwickler Jump to speed up (additionally sprint)=Springen, um zu beschleunigen (zusätzlich sprinten) Maintainers=Betreuer +MineClone5=MineClone5 Original Mod Authors=Original-Mod-Autoren Sneak to skip=Schleichen zum Überspringen Textures=Texturen diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.es.tr b/mods/HUD/mcl_credits/locale/mcl_credits.es.tr new file mode 100644 index 000000000..a8886286e --- /dev/null +++ b/mods/HUD/mcl_credits/locale/mcl_credits.es.tr @@ -0,0 +1,14 @@ +# textdomain: mcl_credits +3D Models= +A faithful Open Source clone of Minecraft= +Contributors= +Creator of MineClone= +Creator of MineClone2= +Developers= +Jump to speed up (additionally sprint)= +Maintainers= +MineClone5= +Original Mod Authors= +Sneak to skip= +Textures= +Translations= \ No newline at end of file diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.fr.tr b/mods/HUD/mcl_credits/locale/mcl_credits.fr.tr new file mode 100644 index 000000000..b34249eff --- /dev/null +++ b/mods/HUD/mcl_credits/locale/mcl_credits.fr.tr @@ -0,0 +1,14 @@ +# textdomain: mcl_credits +3D Models=Modèles 3D +A faithful Open Source clone of Minecraft=Un clone open source de Minecraft +Contributors=Contributeurs +Creator of MineClone=Créateur de MineClone +Creator of MineClone2=Créateur de MineClone2 +Developers=Développeurs +Jump to speed up (additionally sprint)=Saut pour accélérer (peut être combiné avec sprint) +Maintainers=Mainteneurs +MineClone5=MineClone5 +Original Mod Authors=Auteurs des mods originaux +Sneak to skip=Shift pour passer +Textures=Textures +Translations=Traductions \ No newline at end of file diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.pl.tr b/mods/HUD/mcl_credits/locale/mcl_credits.pl.tr new file mode 100644 index 000000000..a8886286e --- /dev/null +++ b/mods/HUD/mcl_credits/locale/mcl_credits.pl.tr @@ -0,0 +1,14 @@ +# textdomain: mcl_credits +3D Models= +A faithful Open Source clone of Minecraft= +Contributors= +Creator of MineClone= +Creator of MineClone2= +Developers= +Jump to speed up (additionally sprint)= +Maintainers= +MineClone5= +Original Mod Authors= +Sneak to skip= +Textures= +Translations= \ No newline at end of file diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.ru.tr b/mods/HUD/mcl_credits/locale/mcl_credits.ru.tr new file mode 100644 index 000000000..a8886286e --- /dev/null +++ b/mods/HUD/mcl_credits/locale/mcl_credits.ru.tr @@ -0,0 +1,14 @@ +# textdomain: mcl_credits +3D Models= +A faithful Open Source clone of Minecraft= +Contributors= +Creator of MineClone= +Creator of MineClone2= +Developers= +Jump to speed up (additionally sprint)= +Maintainers= +MineClone5= +Original Mod Authors= +Sneak to skip= +Textures= +Translations= \ No newline at end of file diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index cd66c3fc4..69f6a601d 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -1133,7 +1133,7 @@ for color, desc in pairs(boxtypes) do if mod_doc then if is_canonical then longdesc = S("A shulker box is a portable container which provides 27 inventory slots for any item except shulker boxes. Shulker boxes keep their inventory when broken, so shulker boxes as well as their contents can be taken as a single item. Shulker boxes come in many different colors.") - usagehelp = S("To access the inventory of a shulker box, place and right-click it. To take a shulker box and its contents with you, just break and collect it, the items will not fall out.") + usagehelp = S("To access the inventory of a shulker box, place and right-click it. To take a shulker box and its contents with you, just break and collect it, the items will not fall out. Place the shulker box again to be able to retrieve its contents.") entry_name = S("Shulker Box") else create_entry = false diff --git a/mods/ITEMS/mcl_chests/locale/template.txt b/mods/ITEMS/mcl_chests/locale/template.txt index 1d947184b..d680c24c9 100644 --- a/mods/ITEMS/mcl_chests/locale/template.txt +++ b/mods/ITEMS/mcl_chests/locale/template.txt @@ -24,7 +24,7 @@ Red Shulker Box= Grey Shulker Box= Black Shulker Box= A shulker box is a portable container which provides 27 inventory slots for any item except shulker boxes. Shulker boxes keep their inventory when broken, so shulker boxes as well as their contents can be taken as a single item. Shulker boxes come in many different colors.= -To access the inventory of a shulker box, place and right-click it. To take a shulker box and its contents with you, just break and collect it, the items will not fall out.= +To access the inventory of a shulker box, place and right-click it. To take a shulker box and its contents with you, just break and collect it, the items will not fall out. Place the shulker box again to be able to retrieve its contents.= Shulker Box= Large Chest= Inventory= diff --git a/mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.es.tr b/mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.es.tr new file mode 100644 index 000000000..e66eb06a5 --- /dev/null +++ b/mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.es.tr @@ -0,0 +1,3 @@ +# textdomain: mcl_fireworks +Firework Rocket= +Flight Duration:= \ No newline at end of file diff --git a/mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.fr.tr b/mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.fr.tr new file mode 100644 index 000000000..b02faa428 --- /dev/null +++ b/mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.fr.tr @@ -0,0 +1,3 @@ +# textdomain: mcl_fireworks +Firework Rocket=Fusée +Flight Duration:=Durée de vol : \ No newline at end of file diff --git a/mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.ru.tr b/mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.ru.tr new file mode 100644 index 000000000..e66eb06a5 --- /dev/null +++ b/mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.ru.tr @@ -0,0 +1,3 @@ +# textdomain: mcl_fireworks +Firework Rocket= +Flight Duration:= \ No newline at end of file diff --git a/mods/ITEMS/mcl_maps/locale/mcl_maps.fr.tr b/mods/ITEMS/mcl_maps/locale/mcl_maps.fr.tr index 9ef7cd5c5..1808e839d 100644 --- a/mods/ITEMS/mcl_maps/locale/mcl_maps.fr.tr +++ b/mods/ITEMS/mcl_maps/locale/mcl_maps.fr.tr @@ -1,5 +1,8 @@ # textdomain: mcl_maps Empty Map=Carte Vierge Empty maps are not useful as maps, but they can be stacked and turned to maps which can be used.=Les cartes vierges ne sont pas utiles en tant que cartes, mais elles peuvent être empilées et transformées en cartes utilisables. -Rightclick to start using the map (which can't be stacked anymore).=Clic droit pour commencer à utiliser la carte (qui ne peut plus être empilée). +Rightclick to create a filled map (which can't be stacked anymore).=Clic droit pour créer une carte remplie (qui ne peut plus être empilée). Map=Carte +Shows a map image.=Affiche une carte. +When created, the map saves the nearby area as an image that can be viewed any time by holding the map.=Lors de sa création, la carte sauvegarde le terrain proche sous forme d'image qui peut être consultée n'importe quand en tenant la carte dans la main. +Hold the map in your hand. This will display a map on your screen.=Tenez la carte dans votre main. Cela affichera la carte à l'écran. From 58a292a4f3edcf6816936b89a6b32275fb785299 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Mon, 16 Aug 2021 13:48:08 +0200 Subject: [PATCH 13/17] fix inconsistency --- mods/HUD/mcl_title/init.lua | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/mods/HUD/mcl_title/init.lua b/mods/HUD/mcl_title/init.lua index d1dbece4b..ffdc45639 100644 --- a/mods/HUD/mcl_title/init.lua +++ b/mods/HUD/mcl_title/init.lua @@ -36,7 +36,11 @@ local string = string local pairs = pairs local function gametick_to_secondes(gametick) - return gametick / 20 + if gametick then + return gametick / 20 + else + return nil + end end @@ -46,9 +50,9 @@ local player_params = {} minetest.register_on_joinplayer(function(player) local playername = player:get_player_name() player_params[player] = { - stay = gametick_to_secondes(mcl_title.defaults.stay), - --fadeIn = gametick_to_secondes(mcl_title.defaults.fadein), - --fadeOut = gametick_to_secondes(mcl_title.defaults.fadeout), + stay = mcl_title.defaults.stay, + --fadeIn = mcl_title.defaults.fadein, + --fadeOut = mcl_title.defaults.fadeout, } local _, hex_color = get_color("white") huds_idx.title[player] = player:hud_add({ @@ -106,9 +110,9 @@ end) function mcl_title.params_set(player, data) player_params[player] = { - stay = gametick_to_secondes(data.stay) or gametick_to_secondes(mcl_title.defaults.stay), - --fadeIn = gametick_to_secondes(data.fadeIn) or gametick_to_secondes(mcl_title.defaults.fadein), - --fadeOut = gametick_to_secondes(data.fadeOut) or gametick_to_secondes(mcl_title.defaults.fadeout), + stay = data.stay or mcl_title.defaults.stay, + --fadeIn = data.fadeIn or mcl_title.defaults.fadein, + --fadeOut = data.fadeOut or mcl_title.defaults.fadeout, } end @@ -134,7 +138,7 @@ function mcl_title.set(player, type, data) player:hud_change(huds_idx[type][player], "text", data.text) player:hud_change(huds_idx[type][player], "number", hex_color) - hud_hide_timeouts[type][player:get_player_name()] = gametick_to_secondes(data.stay) or mcl_title.params_get(player).stay + hud_hide_timeouts[type][player:get_player_name()] = gametick_to_secondes(data.stay) or gametick_to_secondes(mcl_title.params_get(player).stay) return true end From 40898d3e9dfeb492ecaca2621308c8c125ef5471 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Mon, 16 Aug 2021 14:19:50 +0200 Subject: [PATCH 14/17] WIP bold and italic support --- mods/HUD/mcl_title/init.lua | 38 +++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/mods/HUD/mcl_title/init.lua b/mods/HUD/mcl_title/init.lua index ffdc45639..933158d20 100644 --- a/mods/HUD/mcl_title/init.lua +++ b/mods/HUD/mcl_title/init.lua @@ -43,6 +43,23 @@ local function gametick_to_secondes(gametick) end end +--https://github.com/minetest/minetest/blob/b3b075ea02034306256b486dd45410aa765f035a/doc/lua_api.txt#L8477 + +local function style_to_bits(bold, italic) + if bold then + if italic then + return 3 + else + return 1 + end + else + if italic then + return 2 + else + return 0 + end + end +end --PARAMS SYSTEM local player_params = {} @@ -60,8 +77,7 @@ minetest.register_on_joinplayer(function(player) position = mcl_title.layout.title.position, alignment = mcl_title.layout.title.alignment, text = "", - --bold = data.bold, - --italic = data.italic, + style = 0, size = {x = mcl_title.layout.title.size}, number = hex_color, z_index = 100, @@ -71,8 +87,7 @@ minetest.register_on_joinplayer(function(player) position = mcl_title.layout.subtitle.position, alignment = mcl_title.layout.subtitle.alignment, text = "", - --bold = data.bold, - --italic = data.italic, + style = 0, size = {x = mcl_title.layout.subtitle.size}, number = hex_color, z_index = 100, @@ -82,8 +97,7 @@ minetest.register_on_joinplayer(function(player) position = mcl_title.layout.actionbar.position, offset = {x = 0, y = -210}, alignment = mcl_title.layout.actionbar.alignment, - --bold = data.bold, - --italic = data.italic, + style = 0, text = "", size = {x = mcl_title.layout.actionbar.size}, number = hex_color, @@ -131,13 +145,12 @@ function mcl_title.set(player, type, data) return false end - --TODO: enable this code then Fleckenstein's pr get merged (in about 5-6 years lol) - - --if data.bold == nil then data.bold = false end - --if data.italic == nil then data.italic = false end - player:hud_change(huds_idx[type][player], "text", data.text) player:hud_change(huds_idx[type][player], "number", hex_color) + + --apply bold and italic + player:hud_change(huds_idx[type][player], "style", style_to_bits(data.bold, data.italic)) + hud_hide_timeouts[type][player:get_player_name()] = gametick_to_secondes(data.stay) or gametick_to_secondes(mcl_title.params_get(player).stay) return true end @@ -145,6 +158,7 @@ end function mcl_title.remove(player, type) if player then player:hud_change(huds_idx[type][player], "text", "") + player:hud_change(huds_idx[type][player], "style", 0) --no styling end end @@ -184,7 +198,7 @@ end) minetest.register_chatcommand("title", { func = function(name, param) local player = minetest.get_player_by_name(name) - mcl_title.set(player, "title", {text=param, color="gold"}) + mcl_title.set(player, "title", {text=param, color="gold", bold=true, italic=true}) end, }) From df4b8e64cc153ba70457a199661e1e6e92e30bf9 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Thu, 19 Aug 2021 19:21:33 +0200 Subject: [PATCH 15/17] finish `mcl_title` API + doc --- mods/HUD/mcl_title/API.md | 8 ++++++ mods/HUD/mcl_title/init.lua | 28 +++++++++++--------- mods/HUD/mcl_tmp_message/API.md | 7 ----- mods/HUD/mcl_tmp_message/init.lua | 44 ------------------------------- mods/HUD/mcl_tmp_message/mod.conf | 3 --- 5 files changed, 23 insertions(+), 67 deletions(-) delete mode 100644 mods/HUD/mcl_tmp_message/API.md delete mode 100644 mods/HUD/mcl_tmp_message/init.lua delete mode 100644 mods/HUD/mcl_tmp_message/mod.conf diff --git a/mods/HUD/mcl_title/API.md b/mods/HUD/mcl_title/API.md index 50614be4f..97d75ece8 100644 --- a/mods/HUD/mcl_title/API.md +++ b/mods/HUD/mcl_title/API.md @@ -39,4 +39,12 @@ Allow mods to set `stay` and upcomming `fadeIn`/`fadeOut` params. ```lua mcl_title.params_set(player, {stay = 600}) --elements with no 'data.stay' field will stay during 30s (600/20) +``` + +## mcl_title.params_get(player) + +Get `stay` and upcomming `fadeIn` and `fadeOut` params of a player as a table. + +```lua +mcl_title.params_get(player) ``` \ No newline at end of file diff --git a/mods/HUD/mcl_title/init.lua b/mods/HUD/mcl_title/init.lua index 933158d20..2ea1571c8 100644 --- a/mods/HUD/mcl_title/init.lua +++ b/mods/HUD/mcl_title/init.lua @@ -32,7 +32,7 @@ mcl_title.layout.actionbar = {position = {x = 0.5, y = 1}, alignment = {x = 0, y local get_color = mcl_util.get_color -local string = string +--local string = string local pairs = pairs local function gametick_to_secondes(gametick) @@ -44,7 +44,7 @@ local function gametick_to_secondes(gametick) end --https://github.com/minetest/minetest/blob/b3b075ea02034306256b486dd45410aa765f035a/doc/lua_api.txt#L8477 - +--[[ local function style_to_bits(bold, italic) if bold then if italic then @@ -60,24 +60,25 @@ local function style_to_bits(bold, italic) end end end +]] --PARAMS SYSTEM local player_params = {} minetest.register_on_joinplayer(function(player) - local playername = player:get_player_name() + --local playername = player:get_player_name() player_params[player] = { stay = mcl_title.defaults.stay, --fadeIn = mcl_title.defaults.fadein, --fadeOut = mcl_title.defaults.fadeout, } - local _, hex_color = get_color("white") + local _, hex_color = get_color("white") huds_idx.title[player] = player:hud_add({ hud_elem_type = "text", position = mcl_title.layout.title.position, alignment = mcl_title.layout.title.alignment, text = "", - style = 0, + --style = 0, size = {x = mcl_title.layout.title.size}, number = hex_color, z_index = 100, @@ -87,7 +88,7 @@ minetest.register_on_joinplayer(function(player) position = mcl_title.layout.subtitle.position, alignment = mcl_title.layout.subtitle.alignment, text = "", - style = 0, + --style = 0, size = {x = mcl_title.layout.subtitle.size}, number = hex_color, z_index = 100, @@ -97,7 +98,7 @@ minetest.register_on_joinplayer(function(player) position = mcl_title.layout.actionbar.position, offset = {x = 0, y = -210}, alignment = mcl_title.layout.actionbar.alignment, - style = 0, + --style = 0, text = "", size = {x = mcl_title.layout.actionbar.size}, number = hex_color, @@ -116,7 +117,7 @@ minetest.register_on_leaveplayer(function(player) huds_idx.subtitle[player] = nil huds_idx.actionbar[player] = nil - --remove timers form list + --remove timers from list hud_hide_timeouts.title[playername] = nil hud_hide_timeouts.subtitle[playername] = nil hud_hide_timeouts.actionbar[playername] = nil @@ -149,7 +150,7 @@ function mcl_title.set(player, type, data) player:hud_change(huds_idx[type][player], "number", hex_color) --apply bold and italic - player:hud_change(huds_idx[type][player], "style", style_to_bits(data.bold, data.italic)) + --player:hud_change(huds_idx[type][player], "style", style_to_bits(data.bold, data.italic)) hud_hide_timeouts[type][player:get_player_name()] = gametick_to_secondes(data.stay) or gametick_to_secondes(mcl_title.params_get(player).stay) return true @@ -158,7 +159,7 @@ end function mcl_title.remove(player, type) if player then player:hud_change(huds_idx[type][player], "text", "") - player:hud_change(huds_idx[type][player], "style", 0) --no styling + --player:hud_change(huds_idx[type][player], "style", 0) --no styling end end @@ -193,8 +194,8 @@ minetest.register_globalstep(function(dtime) end) ---TEMP STUFF!! ---TODO: remove then testing/tweaking done +--DEBUG STUFF!! +--[[ minetest.register_chatcommand("title", { func = function(name, param) local player = minetest.get_player_by_name(name) @@ -231,4 +232,5 @@ minetest.register_chatcommand("all", { mcl_title.set(player, "subtitle", {text=param, color="gold"}) mcl_title.set(player, "actionbar", {text=param, color="gold"}) end, -}) \ No newline at end of file +}) +]] \ No newline at end of file diff --git a/mods/HUD/mcl_tmp_message/API.md b/mods/HUD/mcl_tmp_message/API.md deleted file mode 100644 index 0a3fc06a3..000000000 --- a/mods/HUD/mcl_tmp_message/API.md +++ /dev/null @@ -1,7 +0,0 @@ -# mcl_temp_message - -Allow mods to show short messages in the hud of players. - -## mcl_tmp_message.message(player, message) - -Show above the hotbar a hud message to player . \ No newline at end of file diff --git a/mods/HUD/mcl_tmp_message/init.lua b/mods/HUD/mcl_tmp_message/init.lua deleted file mode 100644 index 1456cd592..000000000 --- a/mods/HUD/mcl_tmp_message/init.lua +++ /dev/null @@ -1,44 +0,0 @@ -mcl_tmp_message = {} - -local huds = {} -local hud_hide_timeouts = {} - -function mcl_tmp_message.message(player, message) - local name = player:get_player_name() - player:hud_change(huds[name], "text", message) - hud_hide_timeouts[name] = 3 -end - -minetest.register_on_joinplayer(function(player) - huds[player:get_player_name()] = player:hud_add({ - hud_elem_type = "text", - position = {x=0.5, y=1}, - offset = {x = 0, y = -210}, - alignment = {x=0, y=0}, - number = 0xFFFFFF , - text = "", - z_index = 100, - }) -end) - -minetest.register_on_leaveplayer(function(player) - local name = player:get_player_name() - huds[name] = nil - hud_hide_timeouts[name] = nil -end) - -minetest.register_globalstep(function(dtime) - local new_timeouts = {} - for name, timeout in pairs(hud_hide_timeouts) do - timeout = timeout - dtime - if timeout <= 0 then - local player = minetest.get_player_by_name(name) - if player then - player:hud_change(huds[name], "text", "") - end - else - new_timeouts[name] = timeout - end - end - hud_hide_timeouts = new_timeouts -end) diff --git a/mods/HUD/mcl_tmp_message/mod.conf b/mods/HUD/mcl_tmp_message/mod.conf deleted file mode 100644 index ad453643e..000000000 --- a/mods/HUD/mcl_tmp_message/mod.conf +++ /dev/null @@ -1,3 +0,0 @@ -name = mcl_tmp_message -author = Fleckenstein -description = A simple API to show a temporary message to a player From af8e88f44cad6465e91530b0f87e8588e885cff3 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Tue, 24 Aug 2021 08:25:42 +0200 Subject: [PATCH 16/17] fix error in `mcl_title` documentation --- mods/HUD/mcl_title/API.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/HUD/mcl_title/API.md b/mods/HUD/mcl_title/API.md index 97d75ece8..37f1c279f 100644 --- a/mods/HUD/mcl_title/API.md +++ b/mods/HUD/mcl_title/API.md @@ -21,7 +21,7 @@ mcl_title.set(player, "subtitle", {text="dummy subtitle", color="#612D2D"}) mcl_title.set(player, "subtitle", {text="dummy actionbar", color="red"}) --show a title in the HUD with minecraft color "gold" staying for 3 seconds (override stay setting) -mcl_title.set(player, "title", {text="dummy text", color="gold", stay=3}) +mcl_title.set(player, "title", {text="dummy text", color="gold", stay=60}) ``` ## mcl_title.remove(player, type) From f0af15fcd8006a66ce91ba3efbf77c24a8e8ffca Mon Sep 17 00:00:00 2001 From: NO11 Date: Thu, 26 Aug 2021 10:14:57 +0000 Subject: [PATCH 17/17] Make anvil selection/collision box more MC like --- mods/ITEMS/mcl_anvils/init.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index 51b78da6f..e1685c60e 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -284,6 +284,12 @@ local function damage_anvil_by_falling(pos, distance) end end +local anvilbox = { + type = "fixed", + fixed = { + { -8 / 16, -8 / 16, -6 / 16, 8 / 16, 8 / 16, 6 / 16 }, + }, +} local anvildef = { groups = {pickaxey=1, falling_node=1, falling_node_damage=1, crush_after_fall=1, deco_block=1, anvil=1}, tiles = {"mcl_anvils_anvil_top_damaged_0.png^[transformR90", "mcl_anvils_anvil_base.png", "mcl_anvils_anvil_side.png"}, @@ -297,12 +303,14 @@ local anvildef = { node_box = { type = "fixed", fixed = { - { -6/16, -8/16, -6/16, 6/16, -4/16, 6/16 }, - { -5/16, -4/16, -4/16, 5/16, -3/16, 4/16 }, - { -4/16, -3/16, -2/16, 4/16, 2/16, 2/16 }, - { -8/16, 2/16, -5/16, 8/16, 8/16, 5/16 }, + { -6 / 16, -8 / 16, -6 / 16, 6 / 16, -4 / 16, 6 / 16 }, + { -5 / 16, -4 / 16, -4 / 16, 5 / 16, -3 / 16, 4 / 16 }, + { -4 / 16, -3 / 16, -2 / 16, 4 / 16, 2 / 16, 2 / 16 }, + { -8 / 16, 2 / 16, -5 / 16, 8 / 16, 8 / 16, 5 / 16 }, } }, + selection_box = anvilbox, + collision_box = anvilbox, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 1200, _mcl_hardness = 5,