From 8f78cd76449cf96b90e93754df07aff1c24a8b0e Mon Sep 17 00:00:00 2001 From: ANAND Date: Tue, 9 Apr 2019 14:01:18 +0530 Subject: [PATCH] Update calls to ctf_colors.get_color (#396) MT-CTF/ctf_pvp_engine#35. Also update ctf_pvp_engine submodule. --- mods/ctf/ctf_bounties/init.lua | 5 ++--- mods/ctf/ctf_events/init.lua | 12 ++++++------ mods/ctf/ctf_playertag/init.lua | 5 ++--- mods/ctf_pvp_engine | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/mods/ctf/ctf_bounties/init.lua b/mods/ctf/ctf_bounties/init.lua index 7fb7568..236a5fc 100644 --- a/mods/ctf/ctf_bounties/init.lua +++ b/mods/ctf/ctf_bounties/init.lua @@ -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 diff --git a/mods/ctf/ctf_events/init.lua b/mods/ctf/ctf_events/init.lua index 8d30f2d..4b79e82 100644 --- a/mods/ctf/ctf_events/init.lua +++ b/mods/ctf/ctf_events/init.lua @@ -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} } diff --git a/mods/ctf/ctf_playertag/init.lua b/mods/ctf/ctf_playertag/init.lua index d11d046..30393ef 100644 --- a/mods/ctf/ctf_playertag/init.lua +++ b/mods/ctf/ctf_playertag/init.lua @@ -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) diff --git a/mods/ctf_pvp_engine b/mods/ctf_pvp_engine index 48f309e..3d5421a 160000 --- a/mods/ctf_pvp_engine +++ b/mods/ctf_pvp_engine @@ -1 +1 @@ -Subproject commit 48f309ee1da5d84df3c4c3da0d219de2f4a3c450 +Subproject commit 3d5421ae7ca4fd27a1712cba0a4c9c351183c12c