updated code

This commit is contained in:
Chr1Z93 2024-10-31 13:09:53 +01:00
parent 8cf2906561
commit 0daf24192a

View File

@ -205,7 +205,7 @@ function loadDecksCoroutine()
local deckId = _G[string.lower(matColor) .. "DeckId"]
if deckId ~= nil and deckId ~= "" then
buildDeck(matColor, deckId)
coWaitFrames(3)
coroutine.yield()
end
end
end
@ -289,13 +289,13 @@ function loadCards(slots, investigatorId, bondedList, customizations, playerColo
local slotsCopy = deepCopy(slots)
local cardsToSpawn = {}
local resourceModifier = 0
local zoneWithAttachments = {}
cardsWithAttachments = {
["03264"] = true,
["07303"] = true,
["09077"] = true,
["10079"] = true
}
local zoneWithAttachments = {}
-- reset the startsInPlayCount
startsInPlayCount = 0
@ -421,7 +421,6 @@ function loadCards(slots, investigatorId, bondedList, customizations, playerColo
resumeLoadDecks()
return 1
end
startLuaCoroutine(self, "coinside")
end
@ -450,8 +449,7 @@ end
-- Converts the Raven Quill's selections from card IDs to card names. This could be more elegant
-- but the inputs are very static so we're using some brute force.
---@param selectionString string provided by ArkhamDB, indicates the customization selections
-- Should be either a single card ID or two separated by a ^ (e.g. XXXXX^YYYYY)
---@param selectionString string customization selections (either a single card ID or two separated by a ^: XXXXX^YYYYY)
function convertRavenQuillSelections(selectionString)
if string.len(selectionString) == 5 then
return getCardName(selectionString)
@ -461,8 +459,7 @@ function convertRavenQuillSelections(selectionString)
end
-- Converts Grizzled's selections from a single string with "^".
---@param selectionString string provided by ArkhamDB, indicates the customization selections
-- Should be two traits separated by a ^ (e.g. XXXXX^YYYYY)
---@param selectionString string customization selections (two traits separated by a ^: XXXXX^YYYYY)
function convertGrizzledSelections(selectionString)
return selectionString:gsub("%^", ", ")
end
@ -866,6 +863,6 @@ end
-- pauses the current coroutine for 'frameCount' frames
function coWaitFrames(frameCount)
for k = 1, frameCount do
coroutine.yield(0)
coroutine.yield()
end
end