From b6eb0ab66ce4c90741a71928913615a6cdf37fd7 Mon Sep 17 00:00:00 2001 From: NO11 Date: Sat, 10 Jul 2021 15:12:41 +0000 Subject: [PATCH 1/6] Fix #1808 (Make end credits speed up when pressing jump) --- mods/HUD/mcl_credits/init.lua | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/mods/HUD/mcl_credits/init.lua b/mods/HUD/mcl_credits/init.lua index 2943738753..633a68c8fd 100644 --- a/mods/HUD/mcl_credits/init.lua +++ b/mods/HUD/mcl_credits/init.lua @@ -156,7 +156,16 @@ function mcl_credits.show(player) offset = {x = -5, y = -5}, z_index = 1001, number = 0xFFFFFF, - }) + }), + player:hud_add({ + hud_elem_type = "text", + text = " Jump to speed up (additionally sprint)", + position = {x = 0, y = 1}, + alignment = {x = 1, y = -1}, + offset = {x = -5, y = -5}, + z_index = 1002, + number = 0xFFFFFF, + }), }, } add_hud_element({ @@ -216,13 +225,24 @@ end) minetest.register_globalstep(function(dtime) for _, huds in pairs(mcl_credits.players) do local player = huds.player - if not huds.new and player:get_player_control().sneak then + local control = player:get_player_control() + if not huds.new and control.sneak then mcl_credits.hide(player) else local moving = {} local any for id, y in pairs(huds.moving) do - y = y - 1 + + if not control.jump then + y = y - 1 + else + if not control.aux1 then + y = y - 3 + else + y = y - 8 + end + end + if y > -100 then if id == huds.icon then y = math.max(400, y) From b7e6db537b65f4ea7cfbaff9dba588138a1d319e Mon Sep 17 00:00:00 2001 From: NO11 Date: Sat, 10 Jul 2021 17:32:01 +0000 Subject: [PATCH 2/6] Support new credits background --- mods/HUD/mcl_credits/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/HUD/mcl_credits/init.lua b/mods/HUD/mcl_credits/init.lua index 633a68c8fd..40373df16d 100644 --- a/mods/HUD/mcl_credits/init.lua +++ b/mods/HUD/mcl_credits/init.lua @@ -142,7 +142,7 @@ function mcl_credits.show(player) ids = { player:hud_add({ hud_elem_type = "image", - text = "menu_bg.png", + text = "credits_bg.png", position = {x = 0, y = 0}, alignment = {x = 1, y = 1}, scale = {x = -100, y = -100}, From f46c4ebad7c1b1539062f7f9c073f9c61715ffd4 Mon Sep 17 00:00:00 2001 From: NO11 Date: Sun, 11 Jul 2021 11:11:22 +0000 Subject: [PATCH 3/6] Simplify code --- mods/HUD/mcl_credits/init.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/mods/HUD/mcl_credits/init.lua b/mods/HUD/mcl_credits/init.lua index 40373df16d..929a9992b4 100644 --- a/mods/HUD/mcl_credits/init.lua +++ b/mods/HUD/mcl_credits/init.lua @@ -232,14 +232,12 @@ minetest.register_globalstep(function(dtime) local moving = {} local any for id, y in pairs(huds.moving) do - - if not control.jump then - y = y - 1 - else - if not control.aux1 then - y = y - 3 - else - y = y - 8 + y = y - 1 + + if control.jump then + y = y - 2 + if control.aux1 then + y = y - 5 end end From 46d48ccf2f62a80b6710c4b7bbe12ca3a6417aa9 Mon Sep 17 00:00:00 2001 From: NO11 Date: Sun, 11 Jul 2021 11:42:12 +0000 Subject: [PATCH 4/6] Add support for translation --- mods/HUD/mcl_credits/init.lua | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/mods/HUD/mcl_credits/init.lua b/mods/HUD/mcl_credits/init.lua index 929a9992b4..235b2a3cbd 100644 --- a/mods/HUD/mcl_credits/init.lua +++ b/mods/HUD/mcl_credits/init.lua @@ -1,23 +1,26 @@ +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) + mcl_credits = { players = {}, } -mcl_credits.description = "A faithful Open Source clone of Minecraft" +mcl_credits.description = S("A faithful Open Source clone of Minecraft") -- Sub-lists are sorted by number of commits, but the list should not be rearranged (-> new contributors are just added at the end of the list) mcl_credits.people = { - {"Creator of MineClone", 0x0A9400, { + { S("Creator of MineClone"), 0x0A9400, { "davedevils", }}, - {"Creator of MineClone2", 0xFBF837, { + { S("Creator of MineClone2"), 0xFBF837, { "Wuzzy", }}, - {"Maintainers", 0xFF51D5, { + { S("Maintainers"), 0xFF51D5, { "Fleckenstein", "kay27", "oilboi", }}, - {"Developers", 0xF84355, { + { S("Developers"), 0xF84355, { "bzoss", "AFCMS", "epCode", @@ -30,7 +33,7 @@ mcl_credits.people = { "Code-Sploit", "NO11", }}, - {"Contributors", 0x52FF00, { + { S("Contributors"), 0x52FF00, { "Laurent Rocher", "HimbeerserverDE", "TechDudie", @@ -64,7 +67,7 @@ mcl_credits.people = { "NO11", "j45", }}, - {"Original Mod Authors", 0x343434, { + { S("Original Mod Authors"), 0x343434, { "Wuzzy", "Fleckenstein", "BlockMen", @@ -96,12 +99,12 @@ mcl_credits.people = { "jordan4ibanez", "paramat", }}, - {"3D Models", 0x0019FF, { + { S("3D Models"), 0x0019FF, { "22i", "tobyplowy", "epCode", }}, - {"Textures", 0xFF9705, { + { S("Textures"), 0xFF9705, { "XSSheep", "Wuzzy", "kingoscargames", @@ -110,7 +113,7 @@ mcl_credits.people = { "yutyo", "NO11", }}, - {"Translations", 0x00FF60, { + { S("Translations"), 0x00FF60, { "Wuzzy", "Rocher Laurent", "wuniversales", @@ -150,7 +153,7 @@ function mcl_credits.show(player) }), player:hud_add({ hud_elem_type = "text", - text = "Sneak to skip", + text = S("Sneak to skip"), position = {x = 1, y = 1}, alignment = {x = -1, y = -1}, offset = {x = -5, y = -5}, @@ -159,7 +162,7 @@ function mcl_credits.show(player) }), player:hud_add({ hud_elem_type = "text", - text = " Jump to speed up (additionally sprint)", + text = " "..S("Jump to speed up (additionally sprint)"), position = {x = 0, y = 1}, alignment = {x = 1, y = -1}, offset = {x = -5, y = -5}, @@ -233,7 +236,7 @@ minetest.register_globalstep(function(dtime) local any for id, y in pairs(huds.moving) do y = y - 1 - + if control.jump then y = y - 2 if control.aux1 then From a0d3f517458de005d130361cf4d96bef17d6f206 Mon Sep 17 00:00:00 2001 From: NO11 Date: Sun, 11 Jul 2021 11:43:28 +0000 Subject: [PATCH 5/6] Add template for translations --- mods/HUD/mcl_credits/locale/template.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mods/HUD/mcl_credits/locale/template.txt diff --git a/mods/HUD/mcl_credits/locale/template.txt b/mods/HUD/mcl_credits/locale/template.txt new file mode 100644 index 0000000000..3ee9fa56c2 --- /dev/null +++ b/mods/HUD/mcl_credits/locale/template.txt @@ -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= From 848f1489e861d78fba56bac9d27886bf5c5dd909 Mon Sep 17 00:00:00 2001 From: NO11 Date: Sun, 11 Jul 2021 11:44:00 +0000 Subject: [PATCH 6/6] Add german translation --- mods/HUD/mcl_credits/locale/mcl_credits.de.tr | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 mods/HUD/mcl_credits/locale/mcl_credits.de.tr diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.de.tr b/mods/HUD/mcl_credits/locale/mcl_credits.de.tr new file mode 100644 index 0000000000..6a38d18e62 --- /dev/null +++ b/mods/HUD/mcl_credits/locale/mcl_credits.de.tr @@ -0,0 +1,13 @@ +# textdomain: mcl_credits +3D Models=3D Modelle +A faithful Open Source clone of Minecraft=Ein treuer Open-Source-Klon von Minecraft +Contributors=Mitwirkende +Creator of MineClone=Schöpfer von MineClone +Creator of MineClone2=Schöpfer von MineClone2 +Developers=Entwickler +Jump to speed up (additionally sprint)=Springen, um zu beschleunigen (zusätzlich sprinten) +Maintainers=Betreuer +Original Mod Authors=Original-Mod-Autoren +Sneak to skip=Schleichen zum Überspringen +Textures=Texturen +Translations=Übersetzungen