update color change handling
This commit is contained in:
parent
bad6cf8f95
commit
7ac947e737
@ -1566,6 +1566,12 @@ end
|
||||
-- removes a playermat and all related objects from play
|
||||
---@param matColor string Color of the playermat to remove
|
||||
function removePlayermat(matColor)
|
||||
-- if there's a seated player, move them to grey
|
||||
local handColor = playermatApi.getPlayerColor(matColor)
|
||||
if Player[handColor].seated then
|
||||
Player[handColor].changeColor("Grey")
|
||||
end
|
||||
|
||||
local matObjects = guidReferenceApi.getObjectsByOwner(matColor)
|
||||
if not matObjects.Playermat then return end
|
||||
|
||||
|
@ -944,15 +944,10 @@ function onClick_handColorSelect(player)
|
||||
end
|
||||
|
||||
-- show the option dialog for color selection to the player that triggered this
|
||||
player.showOptionsDialog("Select a new color:", colorList, _, function(color)
|
||||
player.showOptionsDialog("Select a new color:", colorList, _, function(newColor)
|
||||
-- update the color of the hand zone
|
||||
local handZone = ownedObjects.HandZone
|
||||
handZone.setValue(color)
|
||||
|
||||
-- if the seated player clicked this, reseat him to the new color
|
||||
if player.color == playerColor then
|
||||
navigationOverlayApi.copyVisibility(playerColor, color)
|
||||
Player[playerColor].changeColor(color)
|
||||
handZone.setValue(newColor)
|
||||
|
||||
-- update visibility for old and new color
|
||||
Global.call("changeWindowVisibilityForColorWrapper", {
|
||||
@ -961,16 +956,21 @@ function onClick_handColorSelect(player)
|
||||
owner = self
|
||||
})
|
||||
Global.call("changeWindowVisibilityForColorWrapper", {
|
||||
color = color,
|
||||
color = newColor,
|
||||
windowId = "optionPanelMain",
|
||||
owner = self
|
||||
})
|
||||
navigationOverlayApi.copyVisibility(playerColor, newColor)
|
||||
|
||||
-- if there was a seated player, reseat to the new color
|
||||
if Player[playerColor].seated then
|
||||
Player[playerColor].changeColor(newColor)
|
||||
else
|
||||
printToColor("Updated handcolor for this playermat to " .. color .. ".", player.color)
|
||||
printToColor("Updated handcolor for this playermat to " .. newColor .. ".", player.color)
|
||||
end
|
||||
|
||||
-- update the internal variable
|
||||
playerColor = color
|
||||
playerColor = newColor
|
||||
updateSave()
|
||||
end)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user