Merge branch 'chaos-token-redraw' of https://github.com/dscarpac/SCED into chaos-token-redraw

This commit is contained in:
dscarpac 2024-06-23 16:34:50 -05:00
commit 1ef0c450ac
5 changed files with 20 additions and 10 deletions

View File

@ -15,7 +15,7 @@
"551": {
"BackIsHidden": true,
"BackURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907490/4AAE686A793E66311FF78890309D20670A329D16/",
"FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907034/013ED775CA50C6FC71731E4FBAEBF1ECA8C68F1E/",
"FaceURL": "http://cloud-3.steamusercontent.com/ugc/2450601300753083072/7500D69C546D9FD62750C45062986AE34060A8B1/",
"NumHeight": 2,
"NumWidth": 2,
"Type": 0,

View File

@ -15,7 +15,7 @@
"551": {
"BackIsHidden": true,
"BackURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907490/4AAE686A793E66311FF78890309D20670A329D16/",
"FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907034/013ED775CA50C6FC71731E4FBAEBF1ECA8C68F1E/",
"FaceURL": "http://cloud-3.steamusercontent.com/ugc/2450601300753083072/7500D69C546D9FD62750C45062986AE34060A8B1/",
"NumHeight": 2,
"NumWidth": 2,
"Type": 0,

View File

@ -15,7 +15,7 @@
"551": {
"BackIsHidden": true,
"BackURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907490/4AAE686A793E66311FF78890309D20670A329D16/",
"FaceURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907034/013ED775CA50C6FC71731E4FBAEBF1ECA8C68F1E/",
"FaceURL": "http://cloud-3.steamusercontent.com/ugc/2450601300753083072/7500D69C546D9FD62750C45062986AE34060A8B1/",
"NumHeight": 2,
"NumWidth": 2,
"Type": 0,

View File

@ -189,7 +189,6 @@ end
-- XML button creation
function createXmlButtonHelper(ui, params)
local color
local guid = self.getGUID()
local xml = findTagWithId(ui, params.id)
@ -338,8 +337,8 @@ function loadCamera(player, camera)
end
end
-- swap to that color if it isn't claimed by someone else
if #getSeatedPlayers() == 1 or not isClaimed then
-- swap to that color if it isn't claimed by someone else and it's currently unoccopied
if #getSeatedPlayers() == 1 or (not isClaimed and isPlaymatAvailable(matColor)) then
local newPlayerColor = playmatApi.getPlayerColor(matColor)
copyVisibility({ startColor = player.color, targetColor = newPlayerColor })
player.changeColor(newPlayerColor)
@ -372,6 +371,17 @@ function loadCamera(player, camera)
Wait.frames(function() player.lookAt(lookHere) end, 2)
end
-- helper function to check if a playmat is available for a color swap
function isPlaymatAvailable(matColor)
local newPlayerColor = playmatApi.getPlayerColor(matColor)
for _, color in ipairs(getSeatedPlayers()) do
if color == newPlayerColor then
return false
end
end
return true
end
---------------------------------------------------------
-- settings related functionality
---------------------------------------------------------

View File

@ -887,6 +887,9 @@ function maybeUpdateActiveInvestigator(card)
return
end
-- set proper scale for the card
card.setScale({1.15, 1, 1.15})
-- remove old action tokens
for _, obj in ipairs(searchAroundSelf("isUniversalToken")) do
obj.destruct()
@ -903,10 +906,7 @@ function maybeUpdateActiveInvestigator(card)
end
-- spawn additional token (maybe specific for investigator)
if extraToken ~= "None" then
-- set to current class if nil
extraToken = extraToken or activeInvestigatorClass
if extraToken and extraToken ~= "None" then
-- local positions
local tokenSpawnPos = {
action = {