updated label and message
This commit is contained in:
parent
4c4bcad32b
commit
e688efe176
@ -1834,27 +1834,27 @@ function handVisibilityToggle(params)
|
||||
local handColor = params.handColor
|
||||
|
||||
-- collect data for message
|
||||
local state
|
||||
local sourceName = getColoredName(handColor)
|
||||
local targetName = getColoredName(playerColor)
|
||||
local state, preposition
|
||||
|
||||
-- modify data table
|
||||
if not handVisibility[handColor] then
|
||||
handVisibility[handColor] = { playerColor, handColor }
|
||||
state = "Disabled"
|
||||
state, preposition = "Showing", "to"
|
||||
elseif removeValueFromTable(handVisibility[handColor], playerColor) then
|
||||
-- something was removed, maybe clear the table
|
||||
if #handVisibility[handColor] == 1 and handVisibility[handColor][1] == handColor then
|
||||
handVisibility[handColor] = nil
|
||||
end
|
||||
state = "Enabled"
|
||||
state, preposition = "Hiding", "from"
|
||||
else
|
||||
-- add the new color as viewer
|
||||
table.insert(handVisibility[handColor], playerColor)
|
||||
state = "Disabled"
|
||||
state, preposition = "Showing", "to"
|
||||
end
|
||||
|
||||
broadcastToAll(state .. " hiding of " .. sourceName .. "'s hand for " .. targetName .. ".")
|
||||
local sourceName = getColoredName(handColor)
|
||||
local targetName = getColoredName(playerColor)
|
||||
broadcastToAll(state .. " " .. sourceName .. "'s hand " .. preposition .. " " .. targetName .. ".")
|
||||
updateHandVisibility()
|
||||
end
|
||||
|
||||
|
@ -28,7 +28,7 @@ local availableOptions = {
|
||||
},
|
||||
{
|
||||
id = "visibilitySelect",
|
||||
title = "Toggle this Hand's hiding",
|
||||
title = "Show/Hide this Hand to me",
|
||||
type = "button"
|
||||
}
|
||||
}
|
||||
@ -985,6 +985,11 @@ end
|
||||
|
||||
-- instruct Global to update this mat's hand visibility
|
||||
function onClick_visibilitySelect(player)
|
||||
if player.color == playerColor then
|
||||
printToColor("This is meant to be clicked by other players to be able to see your hand (primarily for multi-handed gameplay). It won't do anything for you.", playerColor)
|
||||
return
|
||||
end
|
||||
|
||||
Global.call("handVisibilityToggle", { playerColor = player.color, handColor = playerColor })
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user