Update calls to ctf_colors.get_color (#396)
MT-CTF/ctf_pvp_engine#35. Also update ctf_pvp_engine submodule.
This commit is contained in:
parent
fd1103390e
commit
8f78cd7644
4 changed files with 11 additions and 13 deletions
|
@ -2,11 +2,10 @@ local bountied_player = nil
|
||||||
local bounty_score = 0
|
local bounty_score = 0
|
||||||
|
|
||||||
local function announce(name)
|
local function announce(name)
|
||||||
local _, tcolor = ctf_colors.get_color(ctf.player(bountied_player))
|
local tcolor = ctf_colors.get_color(ctf.player(bountied_player))
|
||||||
tcolor = tcolor:gsub("0x", "#")
|
|
||||||
minetest.chat_send_player(name,
|
minetest.chat_send_player(name,
|
||||||
minetest.colorize("#fff326", "The next person to kill ") ..
|
minetest.colorize("#fff326", "The next person to kill ") ..
|
||||||
minetest.colorize(tcolor, bountied_player) ..
|
minetest.colorize(tcolor.css, bountied_player) ..
|
||||||
minetest.colorize("#fff326", " will receive " .. bounty_score .. " points!"))
|
minetest.colorize("#fff326", " will receive " .. bounty_score .. " points!"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -38,17 +38,17 @@ function ctf_events.update_row(i, player, name, tplayer, evt)
|
||||||
|
|
||||||
-- One
|
-- One
|
||||||
if evt.one then
|
if evt.one then
|
||||||
local _, tone_hex = ctf_colors.get_color(ctf.player(evt.one))
|
local tcolor = ctf_colors.get_color(ctf.player(evt.one))
|
||||||
if hud:exists(player, idx) then
|
if hud:exists(player, idx) then
|
||||||
hud:change(player, idx, "text", evt.one)
|
hud:change(player, idx, "text", evt.one)
|
||||||
hud:change(player, idx, "number", tone_hex)
|
hud:change(player, idx, "number", tcolor.hex)
|
||||||
else
|
else
|
||||||
local tmp = {
|
local tmp = {
|
||||||
hud_elem_type = "text",
|
hud_elem_type = "text",
|
||||||
position = {x = 0, y = 0.8},
|
position = {x = 0, y = 0.8},
|
||||||
scale = {x = 200, y = 100},
|
scale = {x = 200, y = 100},
|
||||||
text = evt.one,
|
text = evt.one,
|
||||||
number = tone_hex,
|
number = tcolor.hex,
|
||||||
offset = {x = 145, y = -y_pos},
|
offset = {x = 145, y = -y_pos},
|
||||||
alignment = {x = -1, y = 0}
|
alignment = {x = -1, y = 0}
|
||||||
}
|
}
|
||||||
|
@ -60,17 +60,17 @@ function ctf_events.update_row(i, player, name, tplayer, evt)
|
||||||
|
|
||||||
-- Two
|
-- Two
|
||||||
if evt.two then
|
if evt.two then
|
||||||
local _, ttwo_hex = ctf_colors.get_color(ctf.player(evt.two))
|
local tcolor = ctf_colors.get_color(ctf.player(evt.two))
|
||||||
if hud:exists(player, idx2) then
|
if hud:exists(player, idx2) then
|
||||||
hud:change(player, idx2, "text", evt.two)
|
hud:change(player, idx2, "text", evt.two)
|
||||||
hud:change(player, idx2, "number", ttwo_hex)
|
hud:change(player, idx2, "number", tcolor.hex)
|
||||||
else
|
else
|
||||||
local tmp = {
|
local tmp = {
|
||||||
hud_elem_type = "text",
|
hud_elem_type = "text",
|
||||||
position = {x = 0, y = 0.8},
|
position = {x = 0, y = 0.8},
|
||||||
scale = {x = 200, y = 100},
|
scale = {x = 200, y = 100},
|
||||||
text = evt.two,
|
text = evt.two,
|
||||||
number = ttwo_hex,
|
number = tcolor.hex,
|
||||||
offset = {x = 175, y = -y_pos},
|
offset = {x = 175, y = -y_pos},
|
||||||
alignment = {x = 1, y = 0}
|
alignment = {x = 1, y = 0}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
dofile(minetest.get_modpath("ctf_playertag") .. "/api.lua")
|
dofile(minetest.get_modpath("ctf_playertag") .. "/api.lua")
|
||||||
|
|
||||||
ctf_flag.register_on_pick_up(function(attname, flag)
|
ctf_flag.register_on_pick_up(function(attname, flag)
|
||||||
local _, color = ctf_colors.get_color(ctf.player(attname))
|
local tcolor = ctf_colors.get_color(ctf.player(attname))
|
||||||
color = color:gsub("0x", "#")
|
|
||||||
playertag.set(minetest.get_player_by_name(attname), playertag.TYPE_BUILTIN,
|
playertag.set(minetest.get_player_by_name(attname), playertag.TYPE_BUILTIN,
|
||||||
color)
|
tcolor.css)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
ctf_flag.register_on_drop(function(attname, flag)
|
ctf_flag.register_on_drop(function(attname, flag)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 48f309ee1da5d84df3c4c3da0d219de2f4a3c450
|
Subproject commit 3d5421ae7ca4fd27a1712cba0a4c9c351183c12c
|
Loading…
Reference in a new issue