Messaggio uccisione a schermo e non più in chat
parent
557622caa5
commit
c96d7ede5e
|
@ -0,0 +1,49 @@
|
|||
local saved_huds = {} -- p_name = {indexes}
|
||||
|
||||
|
||||
|
||||
function quake.HUD_broadcast_create(p_name)
|
||||
|
||||
local HUD = {
|
||||
hud_elem_type = "text",
|
||||
position = {x = 0.5, y = 0.35},
|
||||
text = "",
|
||||
size = { x = 2 },
|
||||
number = "0xFFFFFF"
|
||||
}
|
||||
|
||||
local player = minetest.get_player_by_name(p_name)
|
||||
local HUD_ID = player:hud_add(HUD)
|
||||
|
||||
minetest.chat_send_player(p_name, "HUD ID = " .. HUD_ID)
|
||||
|
||||
saved_huds[p_name] = HUD_ID
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
function quake.HUD_broadcast_remove(p_name)
|
||||
|
||||
minetest.get_player_by_name(p_name):hud_remove(saved_huds[p_name])
|
||||
saved_huds[p_name] = nil
|
||||
end
|
||||
|
||||
|
||||
|
||||
function quake.HUD_broadcast_player(p_name, msg, duration)
|
||||
|
||||
local HUD_ID = saved_huds[p_name]
|
||||
local player = minetest.get_player_by_name(p_name)
|
||||
|
||||
minetest.chat_send_player(p_name, "HUD ID = " .. HUD_ID)
|
||||
|
||||
player:hud_change(HUD_ID, "text", msg)
|
||||
|
||||
minetest.after(duration, function()
|
||||
local current_message = player:hud_get(HUD_ID).text
|
||||
if msg == current_message then
|
||||
player:hud_change(HUD_ID, "text", "")
|
||||
end
|
||||
end)
|
||||
end
|
|
@ -3,6 +3,7 @@ arena_lib.on_load("quake", function(arena)
|
|||
for pl_name, stats in pairs(arena.players) do
|
||||
|
||||
quake.HUD_stats_create(pl_name)
|
||||
quake.HUD_broadcast_create(pl_name)
|
||||
quake.scoreboard_create(arena, pl_name)
|
||||
|
||||
panel_lib.get_panel(pl_name, "quake_stats"):show()
|
||||
|
@ -123,6 +124,7 @@ arena_lib.on_end("quake", function(arena, players)
|
|||
|
||||
stats:remove()
|
||||
scoreboard:remove()
|
||||
quake.HUD_broadcast_remove(pl_name)
|
||||
|
||||
if arena.teams_enabled then
|
||||
local team_score = panel_lib.get_panel(pl_name, "quake_teams_score")
|
||||
|
@ -180,6 +182,7 @@ arena_lib.on_quit("quake", function(arena, p_name)
|
|||
|
||||
stats:remove()
|
||||
scoreboard:remove()
|
||||
quake.HUD_broadcast_remove(p_name)
|
||||
|
||||
if arena.teams_enabled then
|
||||
local team_score = panel_lib.get_panel(p_name, "quake_teams_score")
|
||||
|
|
|
@ -239,7 +239,7 @@ function kill(arena, p_name, target)
|
|||
if t_name ~= p_name then
|
||||
|
||||
-- informo dell'uccisione
|
||||
minetest.chat_send_player(p_name, minetest.colorize("#d7ded7", S("You've killed @1", minetest.colorize("#eea160", t_name))))
|
||||
quake.HUD_broadcast_player(p_name, S("YOU'VE KILLED @1", minetest.colorize("#eea160", t_name)), 2.5)
|
||||
minetest.chat_send_player(t_name, minetest.colorize("#d7ded7", S("You've been killed by @1", minetest.colorize("#eea160", p_name))))
|
||||
|
||||
local p_stats = arena.players[p_name]
|
||||
|
|
1
init.lua
1
init.lua
|
@ -47,6 +47,7 @@ dofile(minetest.get_modpath("quake") .. "/utils.lua")
|
|||
dofile(minetest.get_modpath("quake") .. "/_arena_lib/arena_manager.lua")
|
||||
dofile(minetest.get_modpath("quake") .. "/_arena_lib/arena_properties.lua")
|
||||
dofile(minetest.get_modpath("quake") .. "/_HUD/hud_achievements.lua")
|
||||
dofile(minetest.get_modpath("quake") .. "/_HUD/hud_broadcast.lua")
|
||||
dofile(minetest.get_modpath("quake") .. "/_HUD/hud_scoreboard.lua")
|
||||
dofile(minetest.get_modpath("quake") .. "/_HUD/hud_stats.lua")
|
||||
dofile(minetest.get_modpath("quake") .. "/_HUD/hud_teams_score.lua")
|
||||
|
|
|
@ -41,7 +41,7 @@ Rocket Launcher=Lanciarazzi
|
|||
You can't hit @1 due to immunity=Non puoi colpire @1, è immune
|
||||
has been stopped by @1=è stato fermato da @1
|
||||
has killed @1 players in a row!=ha ucciso @1 giocatori in un colpo!
|
||||
You've killed @1=Hai ucciso @1
|
||||
YOU'VE KILLED @1=HAI UCCISO @1
|
||||
You've been killed by @1=Sei stato ucciso da @1
|
||||
drew first blood=ha versato il primo sangue
|
||||
is on a @1=è in una @1
|
||||
|
|
|
@ -3,6 +3,13 @@
|
|||
# reviewer(s):
|
||||
# textdomain: quake
|
||||
|
||||
# init.lua
|
||||
red=
|
||||
blue=
|
||||
|
||||
# scoreboard.lua
|
||||
Team=
|
||||
|
||||
# achievements.lua
|
||||
killing spree=
|
||||
unstoppable=
|
||||
|
@ -34,7 +41,7 @@ Rocket Launcher=
|
|||
You can't hit @1 due to immunity=
|
||||
has been stopped by @1=
|
||||
has killed @1 players in a row!=
|
||||
You've killed @1=
|
||||
YOU'VE KILLED @1=
|
||||
You've been killed by @1=
|
||||
drew first blood=
|
||||
is on a @1=
|
||||
|
|
Loading…
Reference in New Issue