merge corrections
This commit is contained in:
parent
850b57bde2
commit
34a3cbd1d0
@ -3,7 +3,7 @@ require("playercards/PlayerCardSpawner")
|
||||
local allCardsBagApi = require("playercards/AllCardsBagApi")
|
||||
local arkhamDb = require("arkhamdb/ArkhamDb")
|
||||
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||
local playmatApi = require("playermat/PlaymatApi")
|
||||
local playermatApi = require("playermat/PlayermatApi")
|
||||
local zones = require("playermat/Zones")
|
||||
|
||||
local matsWithInvestigator = {}
|
||||
@ -189,7 +189,7 @@ end
|
||||
|
||||
function loadDecks()
|
||||
if not allCardsBagApi.isIndexReady() then return end
|
||||
matsWithInvestigator = playmatApi.getUsedMatColors()
|
||||
matsWithInvestigator = playermatApi.getUsedMatColors()
|
||||
if redDeckId ~= nil and redDeckId ~= "" then
|
||||
buildDeck("Red", redDeckId)
|
||||
end
|
||||
@ -354,7 +354,7 @@ end
|
||||
---@param deck tts__Object Callback-provided spawned deck object
|
||||
---@param playerColor string Color of the player to draw the cards to
|
||||
function deckSpawned(deck, playerColor)
|
||||
local player = Player[playmatApi.getPlayerColor(playerColor)]
|
||||
local player = Player[playermatApi.getPlayerColor(playerColor)]
|
||||
local handPos = player.getHandTransform(1).position -- Only one hand zone per player
|
||||
local deckCards = deck.getData().ContainedObjects
|
||||
|
||||
@ -453,7 +453,7 @@ function removeBusyZones(playerColor, zoneDecks)
|
||||
|
||||
-- check for existing deck
|
||||
local cardsInDeckArea = 0
|
||||
for _, obj in pairs(playmatApi.getDeckAreaObjects(playerColor)) do
|
||||
for _, obj in pairs(playermatApi.getDeckAreaObjects(playerColor)) do
|
||||
cardsInDeckArea = cardsInDeckArea + #obj.getObjects()
|
||||
end
|
||||
|
||||
@ -732,7 +732,7 @@ end
|
||||
---@param resourceModifier number Modifier for the starting resources
|
||||
function updateStartingResources(playerColor, resourceModifier)
|
||||
if resourceModifier ~= 0 then
|
||||
playmatApi.updateCounter(playerColor, "ResourceCounter", _, resourceModifier)
|
||||
playermatApi.updateCounter(playerColor, "ResourceCounter", _, resourceModifier)
|
||||
printToAll("Modified starting resources", playerColor)
|
||||
end
|
||||
end
|
||||
|
@ -72,8 +72,14 @@ do
|
||||
---@param tokenType? string Name of token (e.g. "Bless") to be drawn from the bag
|
||||
---@param guidToBeResolved? string GUID of the sealed token to be resolved instead of drawing a token from the bag
|
||||
---@param takeParameters? table Position and rotation of the location where the new token should be drawn to, usually to replace a returned token
|
||||
ChaosBagApi.drawChaosToken = function(mat, drawAdditional, tokenType, guidToBeResolved)
|
||||
return Global.call("drawChaosToken", {mat = mat, drawAdditional = drawAdditional, tokenType = tokenType, guidToBeResolved = guidToBeResolved, takeParameters = takeParameters})
|
||||
ChaosBagApi.drawChaosToken = function(mat, drawAdditional, tokenType, guidToBeResolved, takeParameters)
|
||||
return Global.call("drawChaosToken", {
|
||||
mat = mat,
|
||||
drawAdditional = drawAdditional,
|
||||
tokenType = tokenType,
|
||||
guidToBeResolved = guidToBeResolved,
|
||||
takeParameters = takeParameters
|
||||
})
|
||||
end
|
||||
|
||||
-- returns a Table List of chaos token ids in the current chaos bag
|
||||
|
@ -310,7 +310,6 @@ function makeButtonsToRedraw()
|
||||
for _, token in ipairs(chaosTokens) do
|
||||
local tokenName = getReadableTokenName(token.getName())
|
||||
|
||||
|
||||
-- allow valid tokens or not invalid tokens, also allow any token if both lists empty
|
||||
if (redrawData.VALID_TOKENS[tokenName] ~= nil and isTableEmpty(redrawData.INVALID_TOKENS)) or (isTableEmpty(redrawData.VALID_TOKENS) and not redrawData.INVALID_TOKENS[tokenName]) or
|
||||
(isTableEmpty(redrawData.VALID_TOKENS) and isTableEmpty(redrawData.INVALID_TOKENS)) then
|
||||
@ -374,7 +373,7 @@ end
|
||||
function returnAndRedraw(_, tokenGUID)
|
||||
local takeParameters = {}
|
||||
local returnedToken = getObjectFromGUID(tokenGUID)
|
||||
local matColor = playmatApi.getMatColorByPosition(returnedToken.getPosition())
|
||||
local matColor = playermatApi.getMatColorByPosition(returnedToken.getPosition())
|
||||
local mat = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat")
|
||||
|
||||
isTokenXMLActive = false
|
||||
@ -1340,7 +1339,8 @@ function contentDownloadCallback(request, params)
|
||||
if pos then
|
||||
spawnTable.position = pos
|
||||
else
|
||||
broadcastToAll("Please make space in the area below the tentacle stand in the upper middle of the table and try again.", "Red")
|
||||
broadcastToAll(
|
||||
"Please make space in the area below the tentacle stand in the upper middle of the table and try again.", "Red")
|
||||
return
|
||||
end
|
||||
end
|
||||
@ -1491,7 +1491,9 @@ function playermatRemovalSelected(player, selectedIndex, id)
|
||||
if mat then
|
||||
-- confirmation dialog about deletion
|
||||
player.pingTable(mat.getPosition())
|
||||
player.showConfirmDialog("Do you really want to remove " .. matColor .. "'s playermat and related objects? This can't be reversed.", function() removePlayermat(matColor) end)
|
||||
player.showConfirmDialog(
|
||||
"Do you really want to remove " .. matColor .. "'s playermat and related objects? This can't be reversed.",
|
||||
function() removePlayermat(matColor) end)
|
||||
else
|
||||
-- info dialog that it is already deleted
|
||||
player.showInfoDialog(matColor .. "'s playermat has already been removed.")
|
||||
|
Loading…
Reference in New Issue
Block a user