Merge pull request #733 from argonui/colored-broadcasts
Added coloring to player names in broadcasts
This commit is contained in:
commit
15db35dc98
@ -282,8 +282,7 @@ function removeOneUse(playerColor, hoveredObject)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local playerName = Player[playerColor].steam_name
|
broadcastToAll(getColoredName(playerColor) .. " removed a token: " .. tokenName, playerColor)
|
||||||
broadcastToAll(playerName .. " removed a token: " .. tokenName, playerColor)
|
|
||||||
|
|
||||||
local discardForMatColor = getColorToDiscardFor(hoveredObject, playerColor)
|
local discardForMatColor = getColorToDiscardFor(hoveredObject, playerColor)
|
||||||
playermatApi.discardListOfObjects(discardForMatColor, { targetObject })
|
playermatApi.discardListOfObjects(discardForMatColor, { targetObject })
|
||||||
@ -404,12 +403,10 @@ function takeClueFromLocation(playerColor, hoveredObject)
|
|||||||
local clickableClues = optionPanelApi.getOptions()["useClueClickers"]
|
local clickableClues = optionPanelApi.getOptions()["useClueClickers"]
|
||||||
|
|
||||||
-- handling for calling this for a specific mat via hotkey
|
-- handling for calling this for a specific mat via hotkey
|
||||||
local playerName, matColor, pos
|
local matColor, pos
|
||||||
if Player[playerColor] and Player[playerColor].seated then
|
if Player[playerColor] and Player[playerColor].seated then
|
||||||
playerName = Player[playerColor].steam_name
|
|
||||||
matColor = playermatApi.getMatColor(playerColor)
|
matColor = playermatApi.getMatColor(playerColor)
|
||||||
else
|
else
|
||||||
playerName = playerColor
|
|
||||||
matColor = playerColor
|
matColor = playerColor
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -431,9 +428,9 @@ function takeClueFromLocation(playerColor, hoveredObject)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if cardName then
|
if cardName then
|
||||||
broadcastToAll(playerName .. " took one clue from " .. cardName .. ".", "White")
|
broadcastToAll(getColoredName(playerColor) .. " took one clue from " .. cardName .. ".", "White")
|
||||||
else
|
else
|
||||||
broadcastToAll(playerName .. " took one clue.", "White")
|
broadcastToAll(getColoredName(playerColor) .. " took one clue.", "White")
|
||||||
end
|
end
|
||||||
|
|
||||||
victoryDisplayApi.update()
|
victoryDisplayApi.update()
|
||||||
@ -472,3 +469,14 @@ function getFirstSeatedPlayer()
|
|||||||
return color
|
return color
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- returns the colored steam name or color
|
||||||
|
function getColoredName(playerColor)
|
||||||
|
local displayName = playerColor
|
||||||
|
if Player[playerColor].steam_name then
|
||||||
|
displayName = Player[playerColor].steam_name
|
||||||
|
end
|
||||||
|
|
||||||
|
-- add bb-code
|
||||||
|
return "[" .. Color.fromString(playerColor):toHex() .. "]" .. displayName .. "[-]"
|
||||||
|
end
|
||||||
|
@ -577,9 +577,7 @@ function doDiscardOne()
|
|||||||
-- get a random non-hidden card (from the "choices" table)
|
-- get a random non-hidden card (from the "choices" table)
|
||||||
local num = math.random(1, #choices)
|
local num = math.random(1, #choices)
|
||||||
deckLib.placeOrMergeIntoDeck(hand[choices[num]], returnGlobalDiscardPosition(), self.getRotation())
|
deckLib.placeOrMergeIntoDeck(hand[choices[num]], returnGlobalDiscardPosition(), self.getRotation())
|
||||||
|
broadcastToAll(getColoredName(playerColor) .. " randomly discarded card " .. choices[num] .. "/" .. #hand .. ".", "White")
|
||||||
local playerName = Player[playerColor].steam_name or playerColor
|
|
||||||
broadcastToAll(playerName .. " randomly discarded card " .. choices[num] .. "/" .. #hand .. ".", "White")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1246,3 +1244,14 @@ function updatePlayerCards(args)
|
|||||||
local playerCardData = customDataHelper.getTable("PLAYER_CARD_DATA")
|
local playerCardData = customDataHelper.getTable("PLAYER_CARD_DATA")
|
||||||
tokenManager.addPlayerCardData(playerCardData)
|
tokenManager.addPlayerCardData(playerCardData)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- returns the colored steam name or color
|
||||||
|
function getColoredName(playerColor)
|
||||||
|
local displayName = playerColor
|
||||||
|
if Player[playerColor].steam_name then
|
||||||
|
displayName = Player[playerColor].steam_name
|
||||||
|
end
|
||||||
|
|
||||||
|
-- add bb-code
|
||||||
|
return "[" .. Color.fromString(playerColor):toHex() .. "]" .. displayName .. "[-]"
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user