added new function for hand visibility
This commit is contained in:
parent
6334707115
commit
3f9770a61a
@ -106,7 +106,7 @@ function takeCardIntoThreatArea(playerColor, hoveredObject)
|
||||
-- contruct feedback message
|
||||
local cardName = hoveredObject.getName()
|
||||
if cardName == "" then cardName = "a card" end
|
||||
local playerName = Global.call("getColoredName", playerColor)
|
||||
local playerName = GlobalApi.getColoredName(playerColor)
|
||||
broadcastToAll("Moved " .. cardName .. " to " .. playerName .. "'s threat area.", "White")
|
||||
|
||||
-- get new rotation (rounded)
|
||||
@ -379,7 +379,7 @@ function removeOneUse(playerColor, hoveredObject)
|
||||
end
|
||||
|
||||
-- construct feedback message
|
||||
local playerName = Global.call("getColoredName", playerColor)
|
||||
local playerName = GlobalApi.getColoredName(playerColor)
|
||||
local cardInfo = ""
|
||||
if cardName and cardName ~= "" then
|
||||
cardInfo = " from " .. cardName
|
||||
@ -530,7 +530,7 @@ function takeClueFromLocation(playerColor, hoveredObject)
|
||||
end
|
||||
|
||||
-- construct feedback message
|
||||
local playerName = Global.call("getColoredName", playerColor)
|
||||
local playerName = GlobalApi.getColoredName(playerColor)
|
||||
local cardInfo = ""
|
||||
if cardName and cardName ~= "" then
|
||||
cardInfo = " from " .. cardName
|
||||
|
@ -2503,6 +2503,7 @@ function isTableEmpty(tbl)
|
||||
end
|
||||
|
||||
-- returns the colored steam name or color
|
||||
---@param playerColor string Color of the player
|
||||
function getColoredName(playerColor)
|
||||
local displayName = playerColor
|
||||
if Player[playerColor].steam_name then
|
||||
|
@ -40,6 +40,19 @@ do
|
||||
Global.call("updateGlobalXml", newXml)
|
||||
end
|
||||
|
||||
-- returns the colored steam name or color
|
||||
---@param playerColor string Color of the player
|
||||
function GlobalApi.getColoredName(playerColor)
|
||||
return Global.call("getColoredName", playerColor)
|
||||
end
|
||||
|
||||
-- toggles the hand visibility of a hand for a specific player
|
||||
---@param playerColor string Color of the player that needs the visibility toggled
|
||||
---@param handColor string Color of the hand to toggle the visibility for
|
||||
function GlobalApi.handVisibilityToggle(playerColor, handColor)
|
||||
Global.call("handVisibilityToggle", { playerColor = playerColor, handColor = handColor})
|
||||
end
|
||||
|
||||
-- loads saved options
|
||||
---@param options table Set a new state for the option table
|
||||
function GlobalApi.loadOptionPanelSettings(options)
|
||||
|
@ -624,7 +624,7 @@ function doDiscardOne()
|
||||
local cardId = choices[num] .. "/" .. #hand
|
||||
|
||||
deckLib.placeOrMergeIntoDeck(card, returnGlobalDiscardPosition(), self.getRotation())
|
||||
local playerName = Global.call("getColoredName", playerColor)
|
||||
local playerName = GlobalApi.getColoredName(playerColor)
|
||||
broadcastToAll(playerName .. " randomly discarded " .. cardName " (" .. cardId .. ").", "White")
|
||||
end
|
||||
end
|
||||
@ -979,7 +979,7 @@ function onClick_visibilitySelect(player)
|
||||
return
|
||||
end
|
||||
|
||||
Global.call("handVisibilityToggle", { playerColor = player.color, handColor = playerColor })
|
||||
GlobalApi.handVisibilityToggle(player.color, playerColor)
|
||||
end
|
||||
|
||||
-- changes the UI state and the internal variable for the togglebuttons
|
||||
|
Loading…
Reference in New Issue
Block a user