forked from VoxeLibre/VoxeLibre
Disable all huds.
This commit is contained in:
parent
0d8bcfd009
commit
79c2d1492e
|
@ -1,199 +0,0 @@
|
|||
mcl_bossbars = {
|
||||
bars = {},
|
||||
huds = {},
|
||||
static = {},
|
||||
colors = {"light_purple", "blue", "red", "green", "yellow", "dark_purple", "white"},
|
||||
max_bars = tonumber(minetest.settings:get("max_bossbars")) or 4
|
||||
}
|
||||
|
||||
function mcl_bossbars.recalculate_colors()
|
||||
local sorted = {}
|
||||
local colors = mcl_bossbars.colors
|
||||
local color_count = #colors
|
||||
local frame_count = color_count * 2
|
||||
for i, color in ipairs(colors) do
|
||||
local idx = i * 2 - 1
|
||||
local image = "mcl_bossbars.png"
|
||||
.. "^[transformR270"
|
||||
.. "^[verticalframe:" .. frame_count .. ":" .. (idx - 1)
|
||||
.. "^(mcl_bossbars_empty.png"
|
||||
.. "^[lowpart:%d:mcl_bossbars.png"
|
||||
.. "^[transformR270"
|
||||
.. "^[verticalframe:" .. frame_count .. ":" .. idx .. ")"
|
||||
local _, hex = mcl_util.get_color(color)
|
||||
sorted[color] = {
|
||||
image = image,
|
||||
hex = hex,
|
||||
}
|
||||
end
|
||||
mcl_bossbars.colors_sorted = sorted
|
||||
end
|
||||
|
||||
local function get_color_info(color, percentage)
|
||||
local cdef = mcl_bossbars.colors_sorted[color]
|
||||
return cdef.hex, string.format(cdef.image, percentage)
|
||||
end
|
||||
|
||||
local last_id = 0
|
||||
|
||||
function mcl_bossbars.add_bar(player, def, dynamic, priority)
|
||||
local name = player:get_player_name()
|
||||
local bars = mcl_bossbars.bars[name]
|
||||
local bar = {text = def.text, priority = priority or 0, timeout = def.timeout}
|
||||
bar.color, bar.image = get_color_info(def.color, def.percentage)
|
||||
if dynamic then
|
||||
for _, other in pairs(bars) do
|
||||
if not other.id and other.color == bar.color and (other.original_text or other.text) == bar.text and other.image == bar.image then
|
||||
if not other.count then
|
||||
other.count = 1
|
||||
other.original_text = other.text
|
||||
end
|
||||
other.count = other.count + 1
|
||||
other.text = other.original_text .. " x" .. other.count
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
table.insert(bars, bar)
|
||||
if not dynamic then
|
||||
bar.raw_color = def.color
|
||||
bar.id = last_id + 1
|
||||
last_id = bar.id
|
||||
mcl_bossbars.static[bar.id] = bar
|
||||
return bar.id
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_bossbars.remove_bar(id)
|
||||
mcl_bossbars.static[id].id = nil
|
||||
mcl_bossbars.static[id] = nil
|
||||
end
|
||||
|
||||
function mcl_bossbars.update_bar(id, def, priority)
|
||||
local old = mcl_bossbars.static[id]
|
||||
old.color = get_color_info(def.color or old.raw_color, def.percentage or old.percentage)
|
||||
old.text = def.text or old.text
|
||||
old.priority = priority or old.priority
|
||||
end
|
||||
|
||||
function mcl_bossbars.update_boss(object, name, color)
|
||||
local props = object:get_luaentity()
|
||||
if not props or not props.is_mob then
|
||||
props = object:get_properties()
|
||||
props.health = object:get_hp()
|
||||
end
|
||||
|
||||
local bardef = {
|
||||
color = color,
|
||||
text = props.nametag,
|
||||
percentage = math.floor(props.health / props.hp_max * 100),
|
||||
}
|
||||
|
||||
if not bardef.text or bardef.text == "" then
|
||||
bardef.text = name
|
||||
end
|
||||
|
||||
local pos = object:get_pos()
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
local d = vector.distance(pos, player:get_pos())
|
||||
if d <= 80 then
|
||||
mcl_bossbars.add_bar(player, bardef, true, d)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
mcl_bossbars.huds[name] = {}
|
||||
mcl_bossbars.bars[name] = {}
|
||||
end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
mcl_bossbars.huds[name] = nil
|
||||
for _, bar in pairs(mcl_bossbars.bars[name]) do
|
||||
if bar.id then
|
||||
mcl_bossbars.static[bar.id] = nil
|
||||
end
|
||||
end
|
||||
mcl_bossbars.bars[name] = nil
|
||||
end)
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
local bars = mcl_bossbars.bars[name]
|
||||
local huds = mcl_bossbars.huds[name]
|
||||
table.sort(bars, function(a, b) return a.priority < b.priority end)
|
||||
local huds_new = {}
|
||||
local bars_new = {}
|
||||
local i = 0
|
||||
|
||||
while #huds > 0 or #bars > 0 do
|
||||
local bar = table.remove(bars, 1)
|
||||
local hud = table.remove(huds, 1)
|
||||
|
||||
if bar and bar.id then
|
||||
if bar.timeout then
|
||||
bar.timeout = bar.timeout - dtime
|
||||
end
|
||||
if not bar.timeout or bar.timeout > 0 then
|
||||
table.insert(bars_new, bar)
|
||||
end
|
||||
end
|
||||
|
||||
if bar and not hud then
|
||||
if i < mcl_bossbars.max_bars then
|
||||
hud = {
|
||||
color = bar.color,
|
||||
image = bar.image,
|
||||
text = bar.text,
|
||||
text_id = player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
text = bar.text,
|
||||
number = bar.color,
|
||||
position = {x = 0.5, y = 0},
|
||||
alignment = {x = 0, y = 1},
|
||||
offset = {x = 0, y = i * 40},
|
||||
}),
|
||||
image_id = player:hud_add({
|
||||
hud_elem_type = "image",
|
||||
text = bar.image,
|
||||
position = {x = 0.5, y = 0},
|
||||
alignment = {x = 0, y = 1},
|
||||
offset = {x = 0, y = i * 40 + 25},
|
||||
scale = {x = 3, y = 3},
|
||||
}),
|
||||
}
|
||||
end
|
||||
elseif hud and not bar then
|
||||
player:hud_remove(hud.text_id)
|
||||
player:hud_remove(hud.image_id)
|
||||
hud = nil
|
||||
else
|
||||
if bar.text ~= hud.text then
|
||||
player:hud_change(hud.text_id, "text", bar.text)
|
||||
hud.text = bar.text
|
||||
end
|
||||
|
||||
if bar.color ~= hud.color then
|
||||
player:hud_change(hud.text_id, "number", bar.color)
|
||||
hud.color = bar.color
|
||||
end
|
||||
|
||||
if bar.image ~= hud.image then
|
||||
player:hud_change(hud.image_id, "text", bar.image)
|
||||
hud.image = bar.image
|
||||
end
|
||||
end
|
||||
|
||||
table.insert(huds_new, hud)
|
||||
i = i + 1
|
||||
end
|
||||
|
||||
mcl_bossbars.huds[name] = huds_new
|
||||
mcl_bossbars.bars[name] = bars_new
|
||||
end
|
||||
end)
|
||||
|
||||
mcl_bossbars.recalculate_colors()
|
|
@ -1,4 +0,0 @@
|
|||
name = mcl_bossbars
|
||||
author = Fleckenstein
|
||||
description = Show enderdragon & wither boss bars. Also allows custom bars.
|
||||
depends = mcl_util, mcl_colors
|
Binary file not shown.
Before Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.3 KiB |
|
@ -1,246 +0,0 @@
|
|||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
mcl_death_messages = {
|
||||
assist = {},
|
||||
messages = {
|
||||
in_fire = {
|
||||
_translator = S,
|
||||
plain = "@1 went up in flames",
|
||||
assist = "@1 walked into fire whilst fighting @2",
|
||||
},
|
||||
lightning_bolt = {
|
||||
_translator = S,
|
||||
plain = "@1 was struck by lightning",
|
||||
assist = "@1 was struck by lightning whilst fighting @2",
|
||||
},
|
||||
on_fire = {
|
||||
_translator = S,
|
||||
plain = "@1 burned to death",
|
||||
assist = "@1 was burnt to a crisp whilst fighting @2",
|
||||
},
|
||||
lava = {
|
||||
_translator = S,
|
||||
plain = "@1 tried to swim in lava",
|
||||
assist = "@1 tried to swim in lava to escape @2"
|
||||
},
|
||||
hot_floor = {
|
||||
_translator = S,
|
||||
plain = "@1 discovered the floor was lava",
|
||||
assist = "@1 walked into danger zone due to @2",
|
||||
},
|
||||
in_wall = {
|
||||
_translator = S,
|
||||
plain = "@1 suffocated in a wall",
|
||||
assist = "@1 suffocated in a wall whilst fighting @2",
|
||||
},
|
||||
drown = {
|
||||
_translator = S,
|
||||
plain = "@1 drowned",
|
||||
assist = "@1 drowned whilst trying to escape @2",
|
||||
},
|
||||
starve = {
|
||||
_translator = S,
|
||||
plain = "@1 starved to death",
|
||||
assist = "@1 starved to death whilst fighting @2",
|
||||
},
|
||||
cactus = {
|
||||
_translator = S,
|
||||
plain = "@1 was pricked to death",
|
||||
assist = "@1 walked into a cactus whilst trying to escape @2",
|
||||
},
|
||||
fall = {
|
||||
_translator = S,
|
||||
plain = "@1 hit the ground too hard",
|
||||
assist = "@1 hit the ground too hard whilst trying to escape @2",
|
||||
-- "@1 fell from a high place" -- for fall distance > 5 blocks
|
||||
-- "@1 fell while climbing"
|
||||
-- "@1 fell off some twisting vines"
|
||||
-- "@1 fell off some weeping vines"
|
||||
-- "@1 fell off some vines"
|
||||
-- "@1 fell off scaffolding"
|
||||
-- "@1 fell off a ladder"
|
||||
},
|
||||
fly_into_wall = {
|
||||
_translator = S,
|
||||
plain = "@1 experienced kinetic energy",
|
||||
assist = "@1 experienced kinetic energy whilst trying to escape @2",
|
||||
},
|
||||
out_of_world = {
|
||||
_translator = S,
|
||||
plain = "@1 fell out of the world",
|
||||
assist = "@1 didn't want to live in the same world as @2",
|
||||
},
|
||||
generic = {
|
||||
_translator = S,
|
||||
plain = "@1 died",
|
||||
assist = "@1 died because of @2",
|
||||
},
|
||||
magic = {
|
||||
_translator = S,
|
||||
plain = "@1 was killed by magic",
|
||||
assist = "@1 was killed by magic whilst trying to escape @2",
|
||||
killer = "@1 was killed by @2 using magic",
|
||||
item = "@1 was killed by @2 using @3",
|
||||
},
|
||||
dragon_breath = {
|
||||
_translator = S,
|
||||
plain = "@1 was roasted in dragon breath",
|
||||
killer = "@1 was roasted in dragon breath by @2",
|
||||
},
|
||||
wither = {
|
||||
_translator = S,
|
||||
plain = "@1 withered away",
|
||||
escape = "@1 withered away whilst fighting @2",
|
||||
},
|
||||
wither_skull = {
|
||||
_translator = S,
|
||||
plain = "@1 was killed by magic",
|
||||
killer = "@1 was shot by a skull from @2",
|
||||
},
|
||||
anvil = {
|
||||
_translator = S,
|
||||
plain = "@1 was squashed by a falling anvil",
|
||||
escape = "@1 was squashed by a falling anvil whilst fighting @2",
|
||||
},
|
||||
falling_node = {
|
||||
_translator = S,
|
||||
plain = "@1 was squashed by a falling block",
|
||||
assist = "@1 was squashed by a falling block whilst fighting @2",
|
||||
},
|
||||
mob = {
|
||||
_translator = S,
|
||||
killer = "@1 was slain by @2",
|
||||
item = "@1 was slain by @2 using @3",
|
||||
},
|
||||
player = {
|
||||
_translator = S,
|
||||
killer = "@1 was slain by @2",
|
||||
item = "@1 was slain by @2 using @3"
|
||||
},
|
||||
arrow = {
|
||||
_translator = S,
|
||||
killer = "@1 was shot by @2",
|
||||
item = "@1 was shot by @2 using @3",
|
||||
},
|
||||
fireball = {
|
||||
_translator = S,
|
||||
killer = "@1 was fireballed by @2",
|
||||
item = "@1 was fireballed by @2 using @3",
|
||||
},
|
||||
thorns = {
|
||||
_translator = S,
|
||||
killer = "@1 was killed trying to hurt @2",
|
||||
item = "@1 was killed by @3 trying to hurt @2", -- yes, the order is intentional: @1 @3 @2
|
||||
},
|
||||
explosion = {
|
||||
_translator = S,
|
||||
plain = "@1 blew up",
|
||||
killer = "@1 was blown up by @2",
|
||||
item = "@1 was blown up by @2 using @3",
|
||||
-- "@1 was killed by [Intentional Game Design]" -- for exploding bed in nether or end
|
||||
},
|
||||
cramming = {
|
||||
_translator = S,
|
||||
plain = "@1 was squished too much",
|
||||
assist = "@1 was squashed by @2", -- surprisingly "escape" is actually the correct subtype
|
||||
},
|
||||
fireworks = {
|
||||
_translator = S,
|
||||
plain = "@1 went off with a bang",
|
||||
item = "@1 went off with a bang due to a firework fired from @3 by @2", -- order is intentional
|
||||
},
|
||||
-- Missing snowballs: The Minecraft wiki mentions them but the MC source code does not.
|
||||
},
|
||||
}
|
||||
|
||||
local function get_item_killer_message(obj, messages, reason)
|
||||
if messages.item then
|
||||
local wielded = mcl_util.get_wielded_item(reason.source)
|
||||
local itemname = wielded:get_meta():get_string("name")
|
||||
if itemname ~= "" then
|
||||
itemname = "[" .. itemname .. "]"
|
||||
if mcl_enchanting.is_enchanted(wielded:get_name()) then
|
||||
itemname = minetest.colorize(mcl_colors.AQUA, itemname)
|
||||
end
|
||||
return messages._translator(messages.item, mcl_util.get_object_name(obj), mcl_util.get_object_name(reason.source), itemname)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function get_plain_killer_message(obj, messages, reason)
|
||||
return messages.killer and messages._translator(messages.killer, mcl_util.get_object_name(obj), mcl_util.get_object_name(reason.source))
|
||||
end
|
||||
|
||||
local function get_killer_message(obj, messages, reason)
|
||||
return reason.source and (get_item_killer_message(obj, messages, reason) or get_plain_killer_message(obj, messages, reason))
|
||||
end
|
||||
|
||||
local function get_assist_message(obj, messages, reason)
|
||||
if messages.assist and mcl_death_messages.assist[obj] then
|
||||
return messages._translator(messages.assist, mcl_util.get_object_name(obj), mcl_death_messages.assist[obj].name)
|
||||
end
|
||||
end
|
||||
|
||||
local function get_plain_message(obj, messages, reason)
|
||||
if messages.plain then
|
||||
return messages._translator(messages.plain, mcl_util.get_object_name(obj))
|
||||
end
|
||||
end
|
||||
|
||||
local function get_fallback_message(obj, messages, reason)
|
||||
return "mcl_death_messages.messages." .. reason.type .. " " .. mcl_util.get_object_name(obj)
|
||||
end
|
||||
|
||||
local function fallback_translator(s)
|
||||
return s
|
||||
end
|
||||
|
||||
mcl_damage.register_on_death(function(obj, reason)
|
||||
if not minetest.settings:get_bool("mcl_showDeathMessages", true) then
|
||||
return
|
||||
end
|
||||
|
||||
local send_to
|
||||
|
||||
if obj:is_player() then
|
||||
send_to = true
|
||||
end
|
||||
|
||||
-- ToDo: add mob death messages for owned mobs, only send to owner (sent_to = "player name")
|
||||
|
||||
if send_to then
|
||||
local messages = mcl_death_messages.messages[reason.type] or {}
|
||||
messages._translator = messages._translator or fallback_translator
|
||||
|
||||
local message =
|
||||
get_killer_message(obj, messages, reason) or
|
||||
get_assist_message(obj, messages, reason) or
|
||||
get_plain_message(obj, messages, reason) or
|
||||
get_fallback_message(obj, messages, reason)
|
||||
|
||||
if send_to == true then
|
||||
minetest.chat_send_all(message)
|
||||
else
|
||||
minetest.chat_send_player(send_to, message)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
mcl_damage.register_on_damage(function(obj, damage, reason)
|
||||
if obj:get_hp() - damage > 0 then
|
||||
if reason.source then
|
||||
mcl_death_messages.assist[obj] = {name = mcl_util.get_object_name(reason.source), timeout = 5}
|
||||
else
|
||||
mcl_death_messages.assist[obj] = nil
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
for obj, tbl in pairs(mcl_death_messages.assist) do
|
||||
tbl.timeout = tbl.timeout - dtime
|
||||
if not obj:is_player() and not obj:get_luaentity() or tbl.timeout > 0 then
|
||||
mcl_death_messages.assist[obj] = nil
|
||||
end
|
||||
end
|
||||
end)
|
|
@ -1,58 +0,0 @@
|
|||
# textdomain: mcl_death_messages
|
||||
@1 went up in flames=@1 ging in Flammen auf
|
||||
@1 walked into fire whilst fighting @2=@1 ist während eines Kampfes mit @2 in ein Feuer gelaufen
|
||||
@1 was struck by lightning=@1 wurde von einem Blitz erschlagen
|
||||
@1 was struck by lightning whilst fighting @2=@1 wurde während eines Kampfes mit @2 von einem Blitz erschlagen
|
||||
@1 burned to death=@1 ist verbrannt
|
||||
@1 was burnt to a crisp whilst fighting @2=@1 ist während eines Kampfes mit @2 verbrannt
|
||||
@1 tried to swim in lava=@1 hat versucht, in Lava zu schwimmen
|
||||
@1 tried to swim in lava to escape @2=@1 hat versucht, in Lava zu schwimmen, um @2 zu entkommen
|
||||
@1 discovered the floor was lava=@1 hat festgestellt, dass der Boden Lava ist
|
||||
@1 walked into danger zone due to @2=@1 ist wegen @2 in eine Gefahrenzone gelaufen
|
||||
@1 suffocated in a wall=@1 ist in einer Mauer erstickt
|
||||
@1 suffocated in a wall whilst fighting @2=@1 ist während eines Kampfes mit @2 in einer Mauer erstickt
|
||||
@1 drowned=@1 ist ertrunken
|
||||
@1 drowned whilst trying to escape @2=@1 ist während dem Versuch, @2 zu entkommen, ertrunken
|
||||
@1 starved to death=@1 ist verhungert
|
||||
@1 starved to death whilst fighting @2=@1 ist während eines Kampfes mit @2 verhungert
|
||||
@1 was pricked to death=@1 wurde zu Tode gestochen
|
||||
@1 walked into a cactus whilst trying to escape @2=@1 ist während dem Versuch, @2 zu entkommen, in einen Kaktus gelaufen
|
||||
@1 hit the ground too hard=@1 ist zu hart auf dem Boden aufgetroffen
|
||||
@1 hit the ground too hard whilst trying to escape @2=@1 ist während dem Versuch, @2 zu entkommen, zu hart auf dem Boden aufgetroffen
|
||||
@1 experienced kinetic energy=@1 hat kinetische Energie erfahren
|
||||
@1 experienced kinetic energy whilst trying to escape @2=@1 hat während dem Versuch, @2 zu entkommen, kinetische Energie erfahren
|
||||
@1 fell out of the world=@1 ist aus der Welt gefallen
|
||||
@1 didn't want to live in the same world as @2=@1 wollte nicht in der gleichen Welt wie @2 leben
|
||||
@1 died=@1 ist gestorben
|
||||
@1 died because of @2=@1 ist wegen @2 gestorben
|
||||
@1 was killed by magic=@1 wurde von Magie getötet
|
||||
@1 was killed by magic whilst trying to escape @2=@1 wurde während dem Versuch, @2 zu entkommen, von Magie getötet
|
||||
@1 was killed by @2 using magic=@1 wurde von @2 mit Magie getötet
|
||||
@1 was killed by @2 using @3=@1 wurde von @2 mit @3 getötet
|
||||
@1 was roasted in dragon breath=@1 wurde in Drachenatem geröstet
|
||||
@1 was roasted in dragon breath by @2=@1 wurde in Drachenatem von @2 geröstet
|
||||
@1 withered away=@1 ist davon gewithert
|
||||
@1 withered away whilst fighting @2=@1 ist während einem Kampf mit @2 davon gewithert
|
||||
@1 was killed by magic=@1 wurde von Magie getötet
|
||||
@1 was shot by a skull from @2=@1 wurde von einem Schädel von @2 erschossen
|
||||
@1 was squashed by a falling anvil=@1 wurde von einem fallenden Amboss erquetscht
|
||||
@1 was squashed by a falling anvil whilst fighting @2=@1 wurde während einem Kampf mit @2 von einem fallenden Amboss erquetscht
|
||||
@1 was squashed by a falling block=@1 wurde von einem fallenden Block erquetscht
|
||||
@1 was squashed by a falling block whilst fighting @2=@1 wurde während einem Kampf mit @2 von einem fallenden Block erquetscht
|
||||
@1 was slain by @2=@1 wurde von @2 erschlagen
|
||||
@1 was slain by @2 using @3=@1 wurde von @2 mit @3 erschlagen
|
||||
@1 was slain by @2=@1 wurde von @2 erschlagen
|
||||
@1 was slain by @2 using @3=@1 wurde von @2 mit @3 erschlagen
|
||||
@1 was shot by @2=@1 wurde von @2 erschossen
|
||||
@1 was shot by @2 using @3=@1 wurde von @2 mit @3 erschossen
|
||||
@1 was fireballed by @2=@1 wurde von @2 gefeuerballt
|
||||
@1 was fireballed by @2 using @3=@1 wurde von @2 mit @3 gefeuerballt
|
||||
@1 was killed trying to hurt @2=@1 ist bei dem Versuch, @2 zu verletzten gestorben
|
||||
@1 was killed by @3 trying to hurt @2=@1 ist bei dem Versuch, @2 zu verletzten, von @3 getötet worden
|
||||
@1 blew up=@1 ist gesprengt worden
|
||||
@1 was blown up by @2=@1 wurde von @2 gesprengt
|
||||
@1 was blown up by @2 using @3=@1 wurde von @2 mit @3 gesprengt
|
||||
@1 was squished too much=@1 war zu gequetscht
|
||||
@1 was squashed by @2=@1 wurde von @2 erquetscht
|
||||
@1 went off with a bang=@1 ging mit einem Knall ab
|
||||
@1 went off with a bang due to a firework fired from @3 by @2=@1 ging mit einem Knall wegen eines Feuerwerks, das mit @3 von @2 gefeuert wurde, ab
|
|
@ -1,58 +0,0 @@
|
|||
# textdomain: mcl_death_messages
|
||||
@1 was fatally hit by an arrow.=@1 fue golpeado muy duro por una flecha.
|
||||
@1 has been killed by an arrow.=@1 ha sido asesinado por una flecha.
|
||||
@1 was shot by an arrow from @2.=@1 fue disparado por una flecha de @2.
|
||||
@1 was shot by an arrow from a skeleton.=@1 fue disparado por una flecha de un esqueleto.
|
||||
@1 was shot by an arrow from a stray.=@1 fue disparado por una flecha de un extraviado.
|
||||
@1 was shot by an arrow from an illusioner.=@1 fue disparado por una flecha de un ilusionista.
|
||||
@1 was shot by an arrow.=@1 fue disparado por una flecha.
|
||||
@1 forgot to breathe.=@1 olvidó respirar.
|
||||
@1 drowned.=@1 ahogado.
|
||||
@1 ran out of oxygen.=@1 se quedó sin oxígeno.
|
||||
@1 was killed by @2.=@1 fue matado por @2.
|
||||
@1 was killed by a mob.=@1 fue asesinado por un animal.
|
||||
@1 was burned to death by a blaze's fireball.=@1 fue quemado hasta la muerte por la bola de fuego de un incendio.
|
||||
@1 was killed by a fireball from a blaze.=@1 fue asesinado por una bola de fuego de un incendio.
|
||||
@1 was burned by a fire charge.=@1 fue quemado por una carga de fuego.
|
||||
A ghast scared @1 to death.=Se ha asustado @1 hasta morir.
|
||||
@1 has been fireballed by a ghast.=@1 ha sido disparado por un fantasma.
|
||||
@1 fell from a high cliff.=@1 cayó de un acantilado.
|
||||
@1 took fatal fall damage.=@1 se hizo daño crítico por una caída.
|
||||
@1 fell victim to gravity.=@1 cayó víctima de la gravedad.
|
||||
@1 died.=@1 murió.
|
||||
@1 was killed by a zombie.=@1 fue asesinado por un zombie.
|
||||
@1 was killed by a baby zombie.=@1 fue asesinado por un bebé zombie.
|
||||
@1 was killed by a blaze.=@1 fue asesinado por una llamarada.
|
||||
@1 was killed by a slime.=@1 fue asesinado por un Slime.
|
||||
@1 was killed by a witch.=@1 fue asesinado por una bruja.
|
||||
@1 was killed by a magma cube.=@1 fue asesinado por un cubo de lava.
|
||||
@1 was killed by a wolf.=@1 fue asesinado por un lobo.
|
||||
@1 was killed by a cat.=@1 fue asesinado por un gato.
|
||||
@1 was killed by an ocelot.=@1 fue asesinado por un ocelote.
|
||||
@1 was killed by an ender dragon.=@1 fue asesinado por un dragón ender.
|
||||
@1 was killed by a wither.=@1 fue asesinado por un Wither.
|
||||
@1 was killed by an enderman.=@1 fue asesinado por un Enderman.
|
||||
@1 was killed by an endermite.=@1 fue asesinado por un Endermite.
|
||||
@1 was killed by a ghast.=@1 fue asesinado por un Ghast.
|
||||
@1 was killed by an elder guardian.=@1 fue asesinado por un gran guardián.
|
||||
@1 was killed by a guardian.=@1 fue asesinado por un guardián.
|
||||
@1 was killed by an iron golem.=@1 fue asesinado por un golem de hierro.
|
||||
@1 was killed by a polar_bear.=@1 fue asesinado por un oso polar.
|
||||
@1 was killed by a killer bunny.=@1 fue asesinado por un conejo asesino.
|
||||
@1 was killed by a shulker.=@1 fue asesinado por un shulker.
|
||||
@1 was killed by a silverfish.=@1 fue asesinado por un pez plateado.
|
||||
@1 was killed by a skeleton.=@1 fue asesinado por un esqueleto.
|
||||
@1 was killed by a stray.=@1 fue asesinado por un extraviado.
|
||||
@1 was killed by a slime.=@1 fue asesinado por un limo.
|
||||
@1 was killed by a spider.=@1 fue asesinado por una araña.
|
||||
@1 was killed by a cave spider.=@1 fue asesinado por una araña de cueva.
|
||||
@1 was killed by a vex.=@1 fue asesinado por un vex.
|
||||
@1 was killed by an evoker.=@1 fue asesinado por un mago.
|
||||
@1 was killed by an illusioner.=@1 fue asesinado por un ilusionista.
|
||||
@1 was killed by a vindicator.=@1 fue asesinado por un vindicador.
|
||||
@1 was killed by a zombie villager.=@1 fue asesinado por un aldeano zombie.
|
||||
@1 was killed by a husk.=@1 fue asesinado por un husk.
|
||||
@1 was killed by a baby husk.=@1 fue asesinado por un bebé husk.
|
||||
@1 was killed by a zombie pigman.=@1 fue asesinado por un cerdo zombie.
|
||||
@1 was killed by a baby zombie pigman.=@1 fue asesinado por un bebé cerdo zombie.
|
||||
@1 was slain by @2.=
|
|
@ -1,59 +0,0 @@
|
|||
# textdomain: mcl_death_messages
|
||||
@1 was fatally hit by an arrow.=@1 a été mortellement touché par une flèche.
|
||||
@1 has been killed with an arrow.=@1 a été tué avec une flèche.
|
||||
@1 was shot by an arrow from @2.=@1 a été abattu par une flèche de @2.
|
||||
@1 was shot by an arrow from a skeleton.=@1 a été abattu par une flèche d'un squelette.
|
||||
@1 was shot by an arrow from a stray.=@1 a été abattu par une flèche d'un vagabond.
|
||||
@1 was shot by an arrow from an illusioner.=@1 a été abattu par une flèche d'un illusionniste.
|
||||
@1 was shot by an arrow.=@1 a été abattu par une flèche.
|
||||
@1 forgot to breathe.=@1 a oublié de respirer.
|
||||
@1 drowned.=@1 s'est noyé.
|
||||
@1 ran out of oxygen.=@1 a manqué d'oxygène.
|
||||
@1 was killed by @2.=@1 a été tué par @2.
|
||||
@1 was killed.=@1 a été tué.
|
||||
@1 was killed by a mob.=@1 a été tué par un mob.
|
||||
@1 was burned to death by a blaze's fireball.=@1 a été brûlé vif par la boule de feu d'un blaze.
|
||||
@1 was killed by a fireball from a blaze.=@1 a été tué par une boule de feu lors d'un blaze.
|
||||
@1 was burned by a fire charge.=@1 a été brûlé par un incendie.
|
||||
A ghast scared @1 to death.=Un ghast a éffrayé @1 à mort.
|
||||
@1 has been fireballed by a ghast.=@1 a été pétrifié par un ghast.
|
||||
@1 fell from a high cliff.=@1 est tombé d'une haute falaise.
|
||||
@1 took fatal fall damage.=@1 a succombé à un chute mortelle.
|
||||
@1 fell victim to gravity.=@1 a été victime de la gravité.
|
||||
@1 died.=@1 est mort.
|
||||
@1 was killed by a zombie.=@1 a été tué par un zombie.
|
||||
@1 was killed by a baby zombie.=@1 a été tué par un bébé zombie.
|
||||
@1 was killed by a blaze.=@1 a été tué par un blaze.
|
||||
@1 was killed by a slime.=@1 a été tué par un slime.
|
||||
@1 was killed by a witch.=@1 a été tué par un sorcier.
|
||||
@1 was killed by a magma cube.=@1 a été tué par un cube de magma.
|
||||
@1 was killed by a wolf.=@1 a été tué par un loup.
|
||||
@1 was killed by a cat.=@1 a été tué par un chat.
|
||||
@1 was killed by an ocelot.=@1 a été tué par un ocelot.
|
||||
@1 was killed by an ender dragon.=@1 a été tué par un ender dragon.
|
||||
@1 was killed by a wither.=@1 a été tué par un wither.
|
||||
@1 was killed by an enderman.=@1 a été tué par un enderman.
|
||||
@1 was killed by an endermite.=@1 a été tué par un endermite.
|
||||
@1 was killed by a ghast.=@1 a été tué par un ghast.
|
||||
@1 was killed by an elder guardian.=@1 a été tué par un grand gardien.
|
||||
@1 was killed by a guardian.=@1 a été tué par un gardien.
|
||||
@1 was killed by an iron golem.=@1 a été tué par un golem de fer.
|
||||
@1 was killed by a polar_bear.=@1 a été tué par un ours blanc.
|
||||
@1 was killed by a killer bunny.=@1 a été tué par un lapin tueur.
|
||||
@1 was killed by a shulker.=@1 a été tué par un shulker.
|
||||
@1 was killed by a silverfish.=@1 a été tué par un poisson d'argent.
|
||||
@1 was killed by a skeleton.=@1 a été tué par un squelette.
|
||||
@1 was killed by a stray.=@1 a été tué par un vagabond.
|
||||
@1 was killed by a slime.=@1 a été tué par un slime.
|
||||
@1 was killed by a spider.=@1 a été tué par une araignée.
|
||||
@1 was killed by a cave spider.=@1 a été tué par une araignée venimeuse.
|
||||
@1 was killed by a vex.=@1 a été tué par un vex.
|
||||
@1 was killed by an evoker.=@1 a été tué par un invocateur.
|
||||
@1 was killed by an illusioner.=@1 a été tué par un illusionniste.
|
||||
@1 was killed by a vindicator.=@1 a été tué par un vindicateur.
|
||||
@1 was killed by a zombie villager.=@1 a été tué par un villageois zombie.
|
||||
@1 was killed by a husk.=@1 a été tué par un zombie momie.
|
||||
@1 was killed by a baby husk.=@1 a été tué par un bébé zombie momie.
|
||||
@1 was killed by a zombie pigman.=@1 a été tué par un zombie-couchon.
|
||||
@1 was killed by a baby zombie pigman.=@1 a été tué par un bébé zombie-couchon
|
||||
@1 was slain by @2.=
|
|
@ -1,59 +0,0 @@
|
|||
# textdomain: mcl_death_messages
|
||||
@1 went up in flames=@1 stanęła w płomieniach
|
||||
@1 walked into fire whilst fighting @2=@1 weszła w płomienie podczas walki z @2
|
||||
@1 was struck by lightning=@1 została trafiona piorunem
|
||||
@1 was struck by lightning whilst fighting @2=@1 została trafiona piorunem z @2
|
||||
@1 burned to death=@1 została spalona żywcem
|
||||
@1 was burnt to a crisp whilst fighting @2=@1 została usmażona podczas walki z @2
|
||||
@1 tried to swim in lava=@1 próbowała pływać w lawie
|
||||
@1 tried to swim in lava to escape @2=@1 próbowała pływać w lawie by uciec od @20
|
||||
@1 discovered the floor was lava=@1 odkryła, że podłoga to lawa
|
||||
@1 walked into danger zone due to @2=@1 weszła do niebezpiecznej strony przez @2
|
||||
@1 suffocated in a wall=@1 udusiła się w ścianie
|
||||
@1 suffocated in a wall whilst fighting @2=@1 udusiła się w ścianie podczas walki z @2
|
||||
@1 drowned=@1 utopiła się
|
||||
@1 drowned whilst trying to escape @2=@1 utopiła się podczas ucieczki przed @2
|
||||
@1 starved to death=@1 zagłodziła się na śmierć
|
||||
@1 starved to death whilst fighting @2=@1 zagłodziła się na śmierć podczas walki z @2
|
||||
@1 was pricked to death=@1 została zakłuta na śmierć
|
||||
@1 walked into a cactus whilst trying to escape @2=@1 weszła w kaktus podczas ucieczki przed @2
|
||||
@1 hit the ground too hard=@1 zbyt twardo wylądowała
|
||||
@1 hit the ground too hard whilst trying to escape @2=@1 zby twardo wylądowała podczas walki z @2
|
||||
@1 experienced kinetic energy=@1 doświadczyła energii kinetycznej
|
||||
@1 experienced kinetic energy whilst trying to escape @2=@1 doświadczyła energii kinetycznej podczas ucieczki przed @2
|
||||
@1 fell out of the world=@1 wyleciała poza świat
|
||||
@1 didn't want to live in the same world as @2=@1 nie chciała żyć w tym samym świecie co @2
|
||||
@1 died=@1 umarła
|
||||
@1 died because of @2=@1 umarła przez @2
|
||||
@1 was killed by magic=@1 została zabita magią
|
||||
@1 was killed by magic whilst trying to escape @2=@1 została zabita magią podczas ucieczki przed @2
|
||||
@1 was killed by @2 using magic=@1 została zabita przez @2 korzystając z magii
|
||||
@1 was killed by @2 using @3=@1 została zabita przez @2 korzystając z @3
|
||||
@1 was roasted in dragon breath=@1 została usmażona przez oddech smoka
|
||||
@1 was roasted in dragon breath by @2=@1 została usmażona przez oddech smoka od @2
|
||||
@1 withered away=@1 odeszła na wieki
|
||||
@1 withered away whilst fighting @2=@1 odeszła na wieki podczas walki z @2
|
||||
@1 was killed by magic=@1 została zabita magią
|
||||
@1 was shot by a skull from @2=@1 została zastrzelona czaszką przez @2
|
||||
@1 was squashed by a falling anvil=@1 została zmiażdżona spadającym kowadłem
|
||||
@1 was squashed by a falling anvil whilst fighting @2=@1 została zmiażdżona spadającym kowadłem podczas walki z @2
|
||||
@1 was squashed by a falling block=@1 została zmiażdżona spadającym blokiem
|
||||
@1 was squashed by a falling block whilst fighting @2=@1 została zmiażdżona spadającym blokiem podczas walki z @2
|
||||
@1 was slain by @2=@1 została zabita przez @2
|
||||
@1 was slain by @2 using @3=@1 została zabita przez @2 przy użyciu @3
|
||||
@1 was slain by @2=@1 została zabita przez @2
|
||||
@1 was slain by @2 using @3=@1 została zabita przez @2 przy użyciu @3
|
||||
@1 was shot by @2=@1 została zastrzelona przez @2
|
||||
@1 was shot by @2 using @3=@1 została zastrzelona przez @2 przy użyciu @3
|
||||
@1 was fireballed by @2=@1 została zabita kulą ognia przez @2
|
||||
@1 was fireballed by @2 using @3=@1 została zabita kulą ognia przez @2 przy użyciu @3
|
||||
@1 was killed trying to hurt @2=@1 została zabita gdy próbowała skrzywdzić @2
|
||||
@1 was killed by @3 trying to hurt @2=@1 została zabita przez @3 gdy próbowała skrzywdzić @2
|
||||
@1 blew up=@1 wybuchła
|
||||
@1 was blown up by @2=@1 została wysadzona przez @2
|
||||
@1 was blown up by @2 using @3=@1 została wysadzona przez @2 przy użyciu @3
|
||||
@1 was squished too much=@1 została zbyt mocno ściśnięta
|
||||
@1 was squashed by @2=@1 została ściśnięta przez @2
|
||||
@1 went off with a bang=@1 odeszła z hukiem
|
||||
@1 went off with a bang due to a firework fired from @3 by @2=@1 odeszła z hukiem przez fajerwerki wystrzelone z @3 przez @2
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
# textdomain: mcl_death_messages
|
||||
@1 was fatally hit by an arrow.=@1 застрелил лучник.
|
||||
@1 has been killed with an arrow.=@1 убило стрелой из лука.
|
||||
@1 was shot by an arrow from @2.=@1 убило стрелой @2.
|
||||
@1 was shot by an arrow from a skeleton.=@1 был(а) убит(а) стрелой скелета.
|
||||
@1 was shot by an arrow from a stray.=@1 был(а) убит(а) стрелой странника.
|
||||
@1 was shot by an arrow from an illusioner.=@1 был(а) убит(а) стрелой иллюзора.
|
||||
@1 was shot by an arrow.=@1 был(а) убит(а) стрелой.
|
||||
@1 forgot to breathe.=@1 забыл(а) подышать.
|
||||
@1 drowned.=@1 утонул(а).
|
||||
@1 ran out of oxygen.=У @1 закончился кислород.
|
||||
@1 was killed by @2.=@1 был(а) убит(а) @2.
|
||||
@1 was killed.=@1 был(а) убит(а).
|
||||
@1 was killed by a mob.=@1 был(а) убит(а) мобом.
|
||||
@1 was burned to death by a blaze's fireball.=@1 до смерти прожарило файерболом ифрита.
|
||||
@1 was killed by a fireball from a blaze.=@1 был(а) убит(а) файерболом ифрита.
|
||||
@1 was burned by a fire charge.=@1 сожгло огненным разрядом.
|
||||
A ghast scared @1 to death.=Гаст напугал @1 до смерти.
|
||||
@1 has been fireballed by a ghast.=@1 настиг файербол Гаста.
|
||||
@1 fell from a high cliff.=@1 свалился(ась) с высокого утёса.
|
||||
@1 took fatal fall damage.=@1 получил(а) смертельный урон от падения.
|
||||
@1 fell victim to gravity.=@1 стал(а) жертвой гравитации.
|
||||
@1 died.=@1 умер(ла).
|
||||
@1 was killed by a zombie.=@1 был(а) убит(а) зомби.
|
||||
@1 was killed by a baby zombie.=@1 был(а) убит(а) малышом-зомби.
|
||||
@1 was killed by a blaze.=@1 был(а) убит(а) ифритом.
|
||||
@1 was killed by a slime.=@1 был(а) убит(а) слизняком.
|
||||
@1 was killed by a witch.=@1 был(а) убит(а) ведьмой.
|
||||
@1 was killed by a magma cube.=@1 был(а) убит(а) лавовым кубом.
|
||||
@1 was killed by a wolf.=@1 был(а) убит(а) волком.
|
||||
@1 was killed by a cat.=@1 был(а) убит(а) кошкой.
|
||||
@1 was killed by an ocelot.=@1 был(а) убит(а) оцелотом.
|
||||
@1 was killed by an ender dragon.=@1 был(а) убит(а) драконом предела.
|
||||
@1 was killed by a wither.=@1 был(а) убит(а) иссушителем.
|
||||
@1 was killed by an enderman.=@1 был(а) убит(а) эндерменом.
|
||||
@1 was killed by an endermite.=@1 был(а) убит(а) эндермитом.
|
||||
@1 was killed by a ghast.=@1 был(а) убит(а) гастом.
|
||||
@1 was killed by an elder guardian.=@1 был(а) убит(а) древним стражем.
|
||||
@1 was killed by a guardian.=@1 был(а) убит(а) стражем.
|
||||
@1 was killed by an iron golem.=@1 был(а) убит(а) железным големом.
|
||||
@1 was killed by a polar_bear.=@1 был(а) убит(а) полярным медведем.
|
||||
@1 was killed by a killer bunny.=@1 был(а) убит(а) кроликом-убийцей.
|
||||
@1 was killed by a shulker.=@1 был(а) убит(а) шалкером.
|
||||
@1 was killed by a silverfish.=@1 был(а) убит(а) чешуйницей.
|
||||
@1 was killed by a skeleton.=@1 был(а) убит(а) скелетом.
|
||||
@1 was killed by a stray.=@1 был(а) убит(а) странником.
|
||||
@1 was killed by a slime.=@1 был(а) убит(а) слизняком.
|
||||
@1 was killed by a spider.=@1 был(а) убит(а) пауком.
|
||||
@1 was killed by a cave spider.=@1 был(а) убит(а) пещерным пауком.
|
||||
@1 was killed by a vex.=@1 был(а) убит(а) досаждателем.
|
||||
@1 was killed by an evoker.=@1 был(а) убит(а) магом.
|
||||
@1 was killed by an illusioner.=@1 был(а) убит(а) иллюзором.
|
||||
@1 was killed by a vindicator.=@1 был(а) убит(а) поборником.
|
||||
@1 was killed by a zombie villager.=@1 был(а) убит(а) зомби-жителем.
|
||||
@1 was killed by a husk.=@1 был(а) убит(а) кадавром.
|
||||
@1 was killed by a baby husk.=@1 был(а) убит(а) машылом-кадавром.
|
||||
@1 was killed by a zombie pigman.=@1 был(а) убит(а) зомби-свиночеловеком.
|
||||
@1 was killed by a baby zombie pigman.=@1 был(а) убит(а) малышом-зомби-свиночеловеком.
|
||||
@1 was slain by @2.=
|
|
@ -1,58 +0,0 @@
|
|||
# textdomain: mcl_death_messages
|
||||
@1 went up in flames=
|
||||
@1 walked into fire whilst fighting @2=
|
||||
@1 was struck by lightning=
|
||||
@1 was struck by lightning whilst fighting @2=
|
||||
@1 burned to death=
|
||||
@1 was burnt to a crisp whilst fighting @2=
|
||||
@1 tried to swim in lava=
|
||||
@1 tried to swim in lava to escape @2=
|
||||
@1 discovered the floor was lava=
|
||||
@1 walked into danger zone due to @2=
|
||||
@1 suffocated in a wall=
|
||||
@1 suffocated in a wall whilst fighting @2=
|
||||
@1 drowned=
|
||||
@1 drowned whilst trying to escape @2=
|
||||
@1 starved to death=
|
||||
@1 starved to death whilst fighting @2=
|
||||
@1 was pricked to death=
|
||||
@1 walked into a cactus whilst trying to escape @2=
|
||||
@1 hit the ground too hard=
|
||||
@1 hit the ground too hard whilst trying to escape @2=
|
||||
@1 experienced kinetic energy=
|
||||
@1 experienced kinetic energy whilst trying to escape @2=
|
||||
@1 fell out of the world=
|
||||
@1 didn't want to live in the same world as @2=
|
||||
@1 died=
|
||||
@1 died because of @2=
|
||||
@1 was killed by magic=
|
||||
@1 was killed by magic whilst trying to escape @2=
|
||||
@1 was killed by @2 using magic=
|
||||
@1 was killed by @2 using @3=
|
||||
@1 was roasted in dragon breath=
|
||||
@1 was roasted in dragon breath by @2=
|
||||
@1 withered away=
|
||||
@1 withered away whilst fighting @2=
|
||||
@1 was killed by magic=
|
||||
@1 was shot by a skull from @2=
|
||||
@1 was squashed by a falling anvil=
|
||||
@1 was squashed by a falling anvil whilst fighting @2=
|
||||
@1 was squashed by a falling block=
|
||||
@1 was squashed by a falling block whilst fighting @2=
|
||||
@1 was slain by @2=
|
||||
@1 was slain by @2 using @3=
|
||||
@1 was slain by @2=
|
||||
@1 was slain by @2 using @3=
|
||||
@1 was shot by @2=
|
||||
@1 was shot by @2 using @3=
|
||||
@1 was fireballed by @2=
|
||||
@1 was fireballed by @2 using @3=
|
||||
@1 was killed trying to hurt @2=
|
||||
@1 was killed by @3 trying to hurt @2=
|
||||
@1 blew up=
|
||||
@1 was blown up by @2=
|
||||
@1 was blown up by @2 using @3=
|
||||
@1 was squished too much=
|
||||
@1 was squashed by @2=
|
||||
@1 went off with a bang=
|
||||
@1 went off with a bang due to a firework fired from @3 by @2=
|
|
@ -1,4 +0,0 @@
|
|||
name = mcl_death_messages
|
||||
author = 4Evergreen4
|
||||
description = Shows messages in chat when a player dies.
|
||||
depends = mcl_colors
|
|
@ -1,11 +0,0 @@
|
|||
mcl_formspec = {}
|
||||
|
||||
function mcl_formspec.get_itemslot_bg(x, y, w, h)
|
||||
local out = ""
|
||||
for i = 0, w - 1, 1 do
|
||||
for j = 0, h - 1, 1 do
|
||||
out = out .."image["..x+i..","..y+j..";1,1;mcl_formspec_itemslot.png]"
|
||||
end
|
||||
end
|
||||
return out
|
||||
end
|
|
@ -1,3 +0,0 @@
|
|||
name = mcl_formspec
|
||||
author = Wuzzy
|
||||
description = Helper mod to simplify creation of formspecs a little bit
|
Binary file not shown.
Before Width: | Height: | Size: 231 B |
|
@ -1,3 +0,0 @@
|
|||
minetest.register_on_joinplayer(function(player)
|
||||
player:set_formspec_prepend(mcl_vars.gui_nonbg .. mcl_vars.gui_bg_color .. mcl_vars.gui_bg_img)
|
||||
end)
|
|
@ -1,4 +0,0 @@
|
|||
name = mcl_formspec_prepend
|
||||
author = Wuzzy
|
||||
description = Formspec prepend for MCL2
|
||||
depends = mcl_init
|
|
@ -0,0 +1,18 @@
|
|||
minetest.register_on_joinplayer(function(player)
|
||||
local hasdebug, _ = minetest.check_player_privs(player, "debug")
|
||||
if not hasdebug then
|
||||
-- Hide health, inventory hud, etc.
|
||||
player:set_inventory_formspec("")
|
||||
-- Disable all provided huds.
|
||||
local hud_flags = player:hud_get_flags()
|
||||
for key,_ in pairs(hud_flags) do
|
||||
hud_flags[key] = false
|
||||
end
|
||||
player:hud_set_flags(hud_flags)
|
||||
else
|
||||
minetest.chat_send_player(
|
||||
player:get_player_name(),
|
||||
"[Server]: You have the debug privlage, so certian huds are now visible. To disable, revoke the privlage and rejoin."
|
||||
)
|
||||
end
|
||||
end)
|
|
@ -0,0 +1,3 @@
|
|||
name = mcl_hud_init
|
||||
author = lazerbeak12345
|
||||
description = Initialize player gameplay things that are HUD-related that can't work elsewhere.
|
|
@ -1,19 +0,0 @@
|
|||
# Show Wielded Item [`show_wielded_item`]
|
||||
This Minetest mod displays the name of the wielded item above the hotbar and
|
||||
statbars.
|
||||
|
||||
This mod is compatible with the HUD Bars [`hudbars`] mod.
|
||||
Compability with other HUD-related mods is possible, but not guaranteed.
|
||||
|
||||
Version: 1.0.0
|
||||
|
||||
## Credits
|
||||
Released by Wuzzy.
|
||||
The original mod code was taken from the file “`item_names.lua`”
|
||||
found in the Unified Inventory mod maintained by VanessaE. This code
|
||||
has been later modified.
|
||||
Original author: 4aiman
|
||||
|
||||
## License
|
||||
This mod is licensed under GNU LGPLv2 or later
|
||||
(see <https://www.gnu.org/licenses/lgpl-2.1.html>).
|
|
@ -1,117 +0,0 @@
|
|||
-- Based on 4itemnames mod by 4aiman
|
||||
|
||||
local wield = {}
|
||||
local wieldindex = {}
|
||||
local huds = {}
|
||||
local dtimes = {}
|
||||
local dlimit = 3 -- HUD element will be hidden after this many seconds
|
||||
|
||||
local math = math
|
||||
local string = string
|
||||
local tonumber = tonumber
|
||||
|
||||
local hudbars_mod = minetest.get_modpath("hudbars")
|
||||
local xp_mod = minetest.get_modpath("mcl_experience")
|
||||
|
||||
local function set_hud(player)
|
||||
if not player:is_player() then return end
|
||||
local player_name = player:get_player_name()
|
||||
-- Fixed offset in config file
|
||||
local fixed = tonumber(minetest.settings:get("show_wielded_item_y_offset"))
|
||||
local off
|
||||
if fixed and fixed ~= -1 then
|
||||
-- Manual offset
|
||||
off = {x=0, y=-fixed}
|
||||
else
|
||||
-- Default offset
|
||||
off = {x=0, y=-101}
|
||||
|
||||
if hudbars_mod then
|
||||
-- Tweak offset if hudbars mod was found
|
||||
|
||||
local rows = math.floor((#hb.get_hudbar_identifiers()-1) / 2) + 1
|
||||
local vmargin = tonumber(minetest.settings:get("hudbars_vmargin")) or 28
|
||||
off.y = -76 - vmargin*rows
|
||||
end
|
||||
if xp_mod then
|
||||
off.y = off.y - 25
|
||||
end
|
||||
|
||||
-- Dirty trick to avoid collision with Minetest's status text (e.g. “Volume changed to 0%”)
|
||||
if off.y >= -167 and off.y <= -156 then
|
||||
off.y = -181
|
||||
end
|
||||
end
|
||||
|
||||
huds[player_name] = player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
position = {x=0.5, y=1},
|
||||
offset = off,
|
||||
alignment = {x=0, y=0},
|
||||
number = 0xFFFFFF ,
|
||||
text = "",
|
||||
z_index = 100,
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
set_hud(player)
|
||||
|
||||
local name = player:get_player_name()
|
||||
wield[name] = player:get_wielded_item():get_name()
|
||||
wieldindex[name] = player:get_wield_index()
|
||||
end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
wield[name] = nil
|
||||
wieldindex[name] = nil
|
||||
end)
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
local player_name = player:get_player_name()
|
||||
local wstack = player:get_wielded_item()
|
||||
local wname = wstack:get_name()
|
||||
local windex = player:get_wield_index()
|
||||
|
||||
if dtimes[player_name] and dtimes[player_name] < dlimit then
|
||||
dtimes[player_name] = dtimes[player_name] + dtime
|
||||
if dtimes[player_name] > dlimit and huds[player_name] then
|
||||
player:hud_change(huds[player_name], "text", "")
|
||||
end
|
||||
end
|
||||
|
||||
-- Update HUD when wielded item or wielded index changed
|
||||
if wname ~= wield[player_name] or windex ~= wieldindex[player_name] then
|
||||
wieldindex[player_name] = windex
|
||||
wield[player_name] = wname
|
||||
dtimes[player_name] = 0
|
||||
|
||||
if huds[player_name] then
|
||||
|
||||
local def = minetest.registered_items[wname]
|
||||
local meta = wstack:get_meta()
|
||||
|
||||
--[[ Get description. Order of preference:
|
||||
* description from metadata
|
||||
* description from item definition
|
||||
* itemstring ]]
|
||||
local desc = meta:get_string("description")
|
||||
if (desc == nil or desc == "") and def then
|
||||
desc = def.description
|
||||
end
|
||||
if desc == nil or desc == "" then
|
||||
desc = wname
|
||||
end
|
||||
-- Cut off item description after first newline
|
||||
local firstnewline = string.find(desc, "\n")
|
||||
if firstnewline then
|
||||
desc = string.sub(desc, 1, firstnewline-1)
|
||||
end
|
||||
player:hud_change(huds[player_name], "text", desc)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
name = show_wielded_item
|
||||
author = 4aiman
|
||||
description = Displays the name of the wielded item.
|
||||
optional_depends = hudbars
|
|
@ -1,5 +0,0 @@
|
|||
#Use this setting to manually set the vertical offset of the label which shows
|
||||
#the name of the wielded item. The offset is in pixels from the bottom of the
|
||||
#screen.
|
||||
#Set this to -1 to let the mod guess the offset automatically (recommended).
|
||||
show_wielded_item_y_offset (Vertical offset of wielded item name display) int -1 -1
|
Loading…
Reference in New Issue