mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-26 03:07:32 +01:00
Add credits overlay prototype
This commit is contained in:
parent
f54f4ebcf9
commit
90f312f772
105
mods/HUD/mcl_credits/init.lua
Normal file
105
mods/HUD/mcl_credits/init.lua
Normal file
@ -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)
|
4
mods/HUD/mcl_credits/mod.conf
Normal file
4
mods/HUD/mcl_credits/mod.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
name = mcl_credits
|
||||||
|
author = Fleckenstein
|
||||||
|
description = Show a HUD containing the credits
|
||||||
|
depends = controls
|
BIN
mods/HUD/mcl_credits/textures/mineclone2_logo.png
Normal file
BIN
mods/HUD/mcl_credits/textures/mineclone2_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 76 KiB |
@ -170,6 +170,7 @@ function mcl_portals.end_teleport(obj, pos)
|
|||||||
-- Teleport back to the player's spawn or world spawn in the Overworld.
|
-- Teleport back to the player's spawn or world spawn in the Overworld.
|
||||||
if obj:is_player() then
|
if obj:is_player() then
|
||||||
target = mcl_spawn.get_player_spawn_pos(obj)
|
target = mcl_spawn.get_player_spawn_pos(obj)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
target = target or mcl_spawn.get_world_spawn_pos(obj)
|
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
|
-- Look towards the main End island
|
||||||
if dim ~= "end" then
|
if dim ~= "end" then
|
||||||
obj:set_look_horizontal(math.pi/2)
|
obj:set_look_horizontal(math.pi/2)
|
||||||
|
-- Show credits
|
||||||
|
else
|
||||||
|
mcl_credits.show(obj)
|
||||||
end
|
end
|
||||||
mcl_worlds.dimension_change(obj, mcl_worlds.pos_to_dimension(target))
|
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)
|
minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16}, true)
|
||||||
|
Loading…
Reference in New Issue
Block a user