diff --git a/src/arkhamdb/DeckImporterMain.ttslua b/src/arkhamdb/DeckImporterMain.ttslua index b2daa7f1..10810940 100644 --- a/src/arkhamdb/DeckImporterMain.ttslua +++ b/src/arkhamdb/DeckImporterMain.ttslua @@ -2,32 +2,32 @@ require("playermat/Zones") require("arkhamdb/LoaderUi") require("playercards/PlayerCardSpawner") -local bondedList = { } -local customizationRowsWithFields = { } +local bondedList = {} +local customizationRowsWithFields = {} -- inputMap maps from (our 1-indexes) customization row index to inputValue table index -- The Raven Quill -customizationRowsWithFields["09042"] = { } +customizationRowsWithFields["09042"] = {} customizationRowsWithFields["09042"].inputCount = 2 -customizationRowsWithFields["09042"].inputMap = { } +customizationRowsWithFields["09042"].inputMap = {} customizationRowsWithFields["09042"].inputMap[1] = 1 customizationRowsWithFields["09042"].inputMap[5] = 2 -- Friends in Low Places -customizationRowsWithFields["09060"] = { } +customizationRowsWithFields["09060"] = {} customizationRowsWithFields["09060"].inputCount = 2 -customizationRowsWithFields["09060"].inputMap = { } +customizationRowsWithFields["09060"].inputMap = {} customizationRowsWithFields["09060"].inputMap[1] = 1 customizationRowsWithFields["09060"].inputMap[3] = 2 -- Living Ink -customizationRowsWithFields["09079"] = { } +customizationRowsWithFields["09079"] = {} customizationRowsWithFields["09079"].inputCount = 3 -customizationRowsWithFields["09079"].inputMap = { } +customizationRowsWithFields["09079"].inputMap = {} customizationRowsWithFields["09079"].inputMap[1] = 1 customizationRowsWithFields["09079"].inputMap[5] = 2 customizationRowsWithFields["09079"].inputMap[6] = 3 -- Grizzled -customizationRowsWithFields["09101"] = { } +customizationRowsWithFields["09101"] = {} customizationRowsWithFields["09101"].inputCount = 3 -customizationRowsWithFields["09101"].inputMap = { } +customizationRowsWithFields["09101"].inputMap = {} customizationRowsWithFields["09101"].inputMap[1] = 1 customizationRowsWithFields["09101"].inputMap[2] = 2 customizationRowsWithFields["09101"].inputMap[3] = 3 @@ -238,7 +238,7 @@ function maybeAddCustomizeUpgradeSheets(slots, configuration) -- upgrade sheets for customizable cards local upgradesheet = allCardsBag.call("getCardById", { id = cardId .. "-c" }) if upgradesheet ~= nil then - slots[cardId.."-c"] = 1 + slots[cardId .. "-c"] = 1 end end end @@ -470,7 +470,7 @@ function convertRavenQuillSelections(selectionString) if (string.len(selectionString) == 5) then return getCardName(selectionString) elseif (string.len(selectionString) == 11) then - return getCardName(string.sub(selectionString, 1, 5))..", "..getCardName(string.sub(selectionString, 7)) + return getCardName(string.sub(selectionString, 1, 5)) .. ", " .. getCardName(string.sub(selectionString, 7)) end end @@ -497,7 +497,7 @@ function buildZoneLists(cards) local zoneList = {} for _, card in ipairs(cards) do if zoneList[card.zone] == nil then - zoneList[card.zone] = { } + zoneList[card.zone] = {} end table.insert(zoneList[card.zone], card) end @@ -689,9 +689,8 @@ function handleCustomizableUpgrades(cardList, customizations) markedBoxes[index] = tonumber(str) elseif counter == 3 and str ~= "" then if (baseId == "09042") then - inputValues[customizationRowsWithFields[baseId].inputMap[index]] = - convertRavenQuillSelections(str) - else + inputValues[customizationRowsWithFields[baseId].inputMap[index]] = convertRavenQuillSelections(str) + elseif customizationRowsWithFields[baseId] ~= nil then inputValues[customizationRowsWithFields[baseId].inputMap[index]] = str end end