diff --git a/mods/HUD/mcl_credits/init.lua b/mods/HUD/mcl_credits/init.lua new file mode 100644 index 000000000..05e7aeff4 --- /dev/null +++ b/mods/HUD/mcl_credits/init.lua @@ -0,0 +1,105 @@ +mcl_credits = { + players = {}, +} + +mcl_credits.description = "A faithful Open Source imitation of Minecraft" + +-- Sub-lists are sorted by number of commits +mcl_credits.people = { + {"Creator of MineClone", { + "davedevils", + }}, + {"Creator of MineClone2", { + "Wuzzy", + }}, + {"Maintainers", { + "Fleckenstein", + "kay27", + "oilboi", + }}, + {"Developers", { + "bzoss", + "AFCMS", + "epCode", + "ryvnf", + "iliekprogrammar", + "MysticTempest", + "Rootyjr", + "Nicu", + "aligator", + }}, + {"Contributors", { + "Code-Sploit", + "Laurent Rocher", + "HimbeerserverDE", + "TechDudie", + "Alexander Minges", + "ArTee3", + "ZeDique la Ruleta", + "pitchum", + "wuniversales", + "Bu-Gee", + "David McMackins II", + "Nicholas Niro", + "Wouters Dorian", + "Blue Blancmange", + "Jared Moody", + "Li0n", + "Midgard", + "NO11", + "Saku Laesvuori", + "Yukitty", + "ZedekThePD", + "aldum", + "dBeans", + "nickolas360", + "yutyo", + }}, + {"3D Models", { + "22i", + "tobyplowy", + }}, + {"Textures", { + "XSSheep", + "kingoscargames", + "leorockway", + "xMrVizzy", + }}, +} + +function mcl_credits.show(player) + local name = player:get_player_name() + if mcl_credits.players[name] then + return + end + local hud_list = { + player:hud_add({ + hud_elem_type = "image", + text = "menu_bg.png", + position = {x = 0, y = 0}, + alignment = {x = 1, y = 1}, + scale = {x = -100, y = -100}, + z_index = 1000, + }) + } + mcl_credits.players[name] = hud_list +end + +function mcl_credits.hide(player) + local name = player:get_player_name() + local list = mcl_credits.players[name] + if list then + for _, id in pairs(list) do + player:hud_remove(id) + end + end + mcl_credits.players[name] = nil +end + +controls.register_on_press(function(player, key) + if key == "sneak" then + mcl_credits.hide(player) + elseif key == "aux1" then + mcl_credits.show(player) + end +end) diff --git a/mods/HUD/mcl_credits/mod.conf b/mods/HUD/mcl_credits/mod.conf new file mode 100644 index 000000000..b5532cd30 --- /dev/null +++ b/mods/HUD/mcl_credits/mod.conf @@ -0,0 +1,4 @@ +name = mcl_credits +author = Fleckenstein +description = Show a HUD containing the credits +depends = controls diff --git a/mods/HUD/mcl_credits/textures/mineclone2_logo.png b/mods/HUD/mcl_credits/textures/mineclone2_logo.png new file mode 100644 index 000000000..11435df51 Binary files /dev/null and b/mods/HUD/mcl_credits/textures/mineclone2_logo.png differ diff --git a/mods/ITEMS/mcl_portals/portal_end.lua b/mods/ITEMS/mcl_portals/portal_end.lua index ab09c5966..bf93b4c1f 100644 --- a/mods/ITEMS/mcl_portals/portal_end.lua +++ b/mods/ITEMS/mcl_portals/portal_end.lua @@ -170,6 +170,7 @@ function mcl_portals.end_teleport(obj, pos) -- Teleport back to the player's spawn or world spawn in the Overworld. if obj:is_player() then target = mcl_spawn.get_player_spawn_pos(obj) + end target = target or mcl_spawn.get_world_spawn_pos(obj) @@ -211,6 +212,9 @@ function mcl_portals.end_teleport(obj, pos) -- Look towards the main End island if dim ~= "end" then obj:set_look_horizontal(math.pi/2) + -- Show credits + else + mcl_credits.show(obj) end mcl_worlds.dimension_change(obj, mcl_worlds.pos_to_dimension(target)) minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16}, true)