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,10 +310,9 @@ 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
|
||||
(isTableEmpty(redrawData.VALID_TOKENS) and isTableEmpty(redrawData.INVALID_TOKENS)) then
|
||||
table.insert(matchingTokensInPlay, token)
|
||||
end
|
||||
end
|
||||
@ -364,7 +363,7 @@ function makeButtonsToRedraw()
|
||||
})
|
||||
end
|
||||
isTokenXMLActive = true
|
||||
-- no need to make buttons if there is only one eligible token to return and redraw
|
||||
-- no need to make buttons if there is only one eligible token to return and redraw
|
||||
else
|
||||
returnAndRedraw(_, matchingTokensInPlay[1].getGUID())
|
||||
end
|
||||
@ -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
|
||||
@ -389,7 +388,7 @@ function returnAndRedraw(_, tokenGUID)
|
||||
end
|
||||
|
||||
returnChaosTokenToBag(returnedToken)
|
||||
local params = { mat = mat, drawAdditional = true, takeParameters = takeParameters }
|
||||
local params = { mat = mat, drawAdditional = true, takeParameters = takeParameters }
|
||||
if redrawData.redrawnTokenType ~= "random" then
|
||||
params.tokenType = redrawData.redrawnTokenType
|
||||
end
|
||||
@ -400,7 +399,7 @@ function returnAndRedraw(_, tokenGUID)
|
||||
end
|
||||
-- remove XML from tokens in play
|
||||
for _, token in ipairs(getChaosTokensinPlay()) do
|
||||
token.UI.setXml("")
|
||||
token.UI.setXml("")
|
||||
end
|
||||
|
||||
redrawData = {}
|
||||
@ -533,9 +532,9 @@ function trackChaosToken(tokenName, matGUID, subtract)
|
||||
if not tokenDrawingStats[matGUID] then tokenDrawingStats[matGUID] = {} end
|
||||
|
||||
-- increase stats by 1 (or decrease if token is returned)
|
||||
local modifier = (subtract and -1 or 1)
|
||||
local modifier = (subtract and -1 or 1)
|
||||
|
||||
local tokenName = getReadableTokenName(tokenName)
|
||||
local tokenName = getReadableTokenName(tokenName)
|
||||
tokenDrawingStats["Overall"][tokenName] = (tokenDrawingStats["Overall"][tokenName] or 0) + modifier
|
||||
tokenDrawingStats[matGUID][tokenName] = (tokenDrawingStats[matGUID][tokenName] or 0) + modifier
|
||||
end
|
||||
@ -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.")
|
||||
@ -1550,15 +1552,15 @@ function applyOptionPanelChange(id, state)
|
||||
if id == "useSnapTags" then
|
||||
playermatApi.setLimitSnapsByType(state, "All")
|
||||
|
||||
-- option: Draw 1 button
|
||||
-- option: Draw 1 button
|
||||
elseif id == "showDrawButton" then
|
||||
playermatApi.showDrawButton(state, "All")
|
||||
|
||||
-- option: Use class texture
|
||||
-- option: Use class texture
|
||||
elseif id == "useClassTexture" then
|
||||
playermatApi.useClassTexture(state, "All")
|
||||
|
||||
-- option: Clickable clue counters
|
||||
-- option: Clickable clue counters
|
||||
elseif id == "useClueClickers" then
|
||||
playermatApi.clickableClues(state, "All")
|
||||
|
||||
@ -1566,40 +1568,40 @@ function applyOptionPanelChange(id, state)
|
||||
local counter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "MasterClueCounter")
|
||||
counter.setVar("useClickableCounters", state)
|
||||
|
||||
-- option: Play area connection drawing
|
||||
-- option: Play area connection drawing
|
||||
elseif id == "playAreaConnections" then
|
||||
playAreaApi.setConnectionDrawState(state)
|
||||
|
||||
-- option: Play area connection color
|
||||
-- option: Play area connection color
|
||||
elseif id == "playAreaConnectionColor" then
|
||||
playAreaApi.setConnectionColor(state)
|
||||
UI.setAttribute(id, "color", "#" .. Color.new(state):toHex())
|
||||
|
||||
-- option: Play area snap tags
|
||||
-- option: Play area snap tags
|
||||
elseif id == "playAreaSnapTags" then
|
||||
playAreaApi.setLimitSnapsByType(state)
|
||||
|
||||
-- option: Show clean up helper
|
||||
-- option: Show clean up helper
|
||||
elseif id == "showCleanUpHelper" then
|
||||
spawnOrRemoveHelper(state, "Clean Up Helper", { -66, 1.53, 46 })
|
||||
spawnOrRemoveHelper(state, "Clean Up Helper", { -66, 1.53, 46 })
|
||||
|
||||
-- option: Show hand helper for each player
|
||||
-- option: Show hand helper for each player
|
||||
elseif id == "showHandHelper" then
|
||||
spawnOrRemoveHelperForPlayermats("Hand Helper", state)
|
||||
|
||||
-- option: Show search assistant for each player
|
||||
-- option: Show search assistant for each player
|
||||
elseif id == "showSearchAssistant" then
|
||||
spawnOrRemoveHelperForPlayermats("Search Assistant", state)
|
||||
|
||||
-- option: Show attachment helper
|
||||
-- option: Show attachment helper
|
||||
elseif id == "showAttachmentHelper" then
|
||||
spawnOrRemoveHelper(state, "Attachment Helper", { -62, 1.4, 0 })
|
||||
|
||||
-- option: Show CYOA campaign guides
|
||||
-- option: Show CYOA campaign guides
|
||||
elseif id == "showCYOA" then
|
||||
spawnOrRemoveHelper(state, "CYOA Campaign Guides", { 39, 1.3, -20 })
|
||||
|
||||
-- option: Show displacement tool
|
||||
-- option: Show displacement tool
|
||||
elseif id == "showDisplacementTool" then
|
||||
spawnOrRemoveHelper(state, "Displacement Tool", { -57, 1.53, 46 })
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user