Merge branch 'chaos-token-redraw' of https://github.com/dscarpac/SCED into chaos-token-redraw
This commit is contained in:
commit
1ef0c450ac
@ -15,7 +15,7 @@
|
|||||||
"551": {
|
"551": {
|
||||||
"BackIsHidden": true,
|
"BackIsHidden": true,
|
||||||
"BackURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907490/4AAE686A793E66311FF78890309D20670A329D16/",
|
"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,
|
"NumHeight": 2,
|
||||||
"NumWidth": 2,
|
"NumWidth": 2,
|
||||||
"Type": 0,
|
"Type": 0,
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
"551": {
|
"551": {
|
||||||
"BackIsHidden": true,
|
"BackIsHidden": true,
|
||||||
"BackURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907490/4AAE686A793E66311FF78890309D20670A329D16/",
|
"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,
|
"NumHeight": 2,
|
||||||
"NumWidth": 2,
|
"NumWidth": 2,
|
||||||
"Type": 0,
|
"Type": 0,
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
"551": {
|
"551": {
|
||||||
"BackIsHidden": true,
|
"BackIsHidden": true,
|
||||||
"BackURL": "http://cloud-3.steamusercontent.com/ugc/2021607899142907490/4AAE686A793E66311FF78890309D20670A329D16/",
|
"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,
|
"NumHeight": 2,
|
||||||
"NumWidth": 2,
|
"NumWidth": 2,
|
||||||
"Type": 0,
|
"Type": 0,
|
||||||
|
@ -189,7 +189,6 @@ end
|
|||||||
|
|
||||||
-- XML button creation
|
-- XML button creation
|
||||||
function createXmlButtonHelper(ui, params)
|
function createXmlButtonHelper(ui, params)
|
||||||
local color
|
|
||||||
local guid = self.getGUID()
|
local guid = self.getGUID()
|
||||||
local xml = findTagWithId(ui, params.id)
|
local xml = findTagWithId(ui, params.id)
|
||||||
|
|
||||||
@ -338,8 +337,8 @@ function loadCamera(player, camera)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- swap to that color if it isn't claimed by someone else
|
-- swap to that color if it isn't claimed by someone else and it's currently unoccopied
|
||||||
if #getSeatedPlayers() == 1 or not isClaimed then
|
if #getSeatedPlayers() == 1 or (not isClaimed and isPlaymatAvailable(matColor)) then
|
||||||
local newPlayerColor = playmatApi.getPlayerColor(matColor)
|
local newPlayerColor = playmatApi.getPlayerColor(matColor)
|
||||||
copyVisibility({ startColor = player.color, targetColor = newPlayerColor })
|
copyVisibility({ startColor = player.color, targetColor = newPlayerColor })
|
||||||
player.changeColor(newPlayerColor)
|
player.changeColor(newPlayerColor)
|
||||||
@ -372,6 +371,17 @@ function loadCamera(player, camera)
|
|||||||
Wait.frames(function() player.lookAt(lookHere) end, 2)
|
Wait.frames(function() player.lookAt(lookHere) end, 2)
|
||||||
end
|
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
|
-- settings related functionality
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
|
@ -887,6 +887,9 @@ function maybeUpdateActiveInvestigator(card)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- set proper scale for the card
|
||||||
|
card.setScale({1.15, 1, 1.15})
|
||||||
|
|
||||||
-- remove old action tokens
|
-- remove old action tokens
|
||||||
for _, obj in ipairs(searchAroundSelf("isUniversalToken")) do
|
for _, obj in ipairs(searchAroundSelf("isUniversalToken")) do
|
||||||
obj.destruct()
|
obj.destruct()
|
||||||
@ -903,10 +906,7 @@ function maybeUpdateActiveInvestigator(card)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- spawn additional token (maybe specific for investigator)
|
-- spawn additional token (maybe specific for investigator)
|
||||||
if extraToken ~= "None" then
|
if extraToken and extraToken ~= "None" then
|
||||||
-- set to current class if nil
|
|
||||||
extraToken = extraToken or activeInvestigatorClass
|
|
||||||
|
|
||||||
-- local positions
|
-- local positions
|
||||||
local tokenSpawnPos = {
|
local tokenSpawnPos = {
|
||||||
action = {
|
action = {
|
||||||
|
Loading…
Reference in New Issue
Block a user