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:
ANAND 2019-04-09 14:01:18 +05:30 committed by GitHub
parent fd1103390e
commit 8f78cd7644
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 13 deletions

View file

@ -2,11 +2,10 @@ local bountied_player = nil
local bounty_score = 0
local function announce(name)
local _, tcolor = ctf_colors.get_color(ctf.player(bountied_player))
tcolor = tcolor:gsub("0x", "#")
local tcolor = ctf_colors.get_color(ctf.player(bountied_player))
minetest.chat_send_player(name,
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!"))
end

View file

@ -38,17 +38,17 @@ function ctf_events.update_row(i, player, name, tplayer, evt)
-- One
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
hud:change(player, idx, "text", evt.one)
hud:change(player, idx, "number", tone_hex)
hud:change(player, idx, "number", tcolor.hex)
else
local tmp = {
hud_elem_type = "text",
position = {x = 0, y = 0.8},
scale = {x = 200, y = 100},
text = evt.one,
number = tone_hex,
number = tcolor.hex,
offset = {x = 145, y = -y_pos},
alignment = {x = -1, y = 0}
}
@ -60,17 +60,17 @@ function ctf_events.update_row(i, player, name, tplayer, evt)
-- Two
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
hud:change(player, idx2, "text", evt.two)
hud:change(player, idx2, "number", ttwo_hex)
hud:change(player, idx2, "number", tcolor.hex)
else
local tmp = {
hud_elem_type = "text",
position = {x = 0, y = 0.8},
scale = {x = 200, y = 100},
text = evt.two,
number = ttwo_hex,
number = tcolor.hex,
offset = {x = 175, y = -y_pos},
alignment = {x = 1, y = 0}
}

View file

@ -1,10 +1,9 @@
dofile(minetest.get_modpath("ctf_playertag") .. "/api.lua")
ctf_flag.register_on_pick_up(function(attname, flag)
local _, color = ctf_colors.get_color(ctf.player(attname))
color = color:gsub("0x", "#")
local tcolor = ctf_colors.get_color(ctf.player(attname))
playertag.set(minetest.get_player_by_name(attname), playertag.TYPE_BUILTIN,
color)
tcolor.css)
end)
ctf_flag.register_on_drop(function(attname, flag)

@ -1 +1 @@
Subproject commit 48f309ee1da5d84df3c4c3da0d219de2f4a3c450
Subproject commit 3d5421ae7ca4fd27a1712cba0a4c9c351183c12c