diff --git a/modsettings/TabStates.json b/modsettings/TabStates.json
index 4bc432d2..6e47250b 100644
--- a/modsettings/TabStates.json
+++ b/modsettings/TabStates.json
@@ -11,10 +11,10 @@
}
},
"1": {
- "body": "The server host can enable or disable cards in hands being hidden from other players by going to the menu at the top of the TTS screen, clicking options, and choosing Hands. The \"Disable\" setting reveals all player hands to all players, while the \"Default\" setting means that each player can only see the cards in their own hand.",
+ "body": "You can instruct the mod to import custom cards with your ArkhamDB deck by putting 'instructions' in the deck description.\nThere's a tool to generate them left of the deck importer. Simply place your cards on it and press 'Generate!'. Then make sure to copy the generated section from the Notebook beginning with '++SCED import instructions++' to your ArkhamDB / arkham.build deck description.\nAfter doing so, the Deck Importer will be able to spawn these cards IF they are added to the mod's card index (for example by throwing them into the 'Additional Cards Box' next to the Player Cards Panel in the upper left corner of the table.\nIt also supports '- remove:' instructions to automatically remove placeholder cards.\nIf you are using a custom investigator, make sure to use a 'remove' instruction to remove the original one.",
"color": "Grey",
"id": 1,
- "title": "How to Hide Hands",
+ "title": "FAQ: Use custom cards with ArkhamDB",
"visibleColor": {
"b": 0.5,
"g": 0.5,
diff --git a/src/arkhamdb/DeckInstructionGenerator.ttslua b/src/arkhamdb/DeckInstructionGenerator.ttslua
index 7a333a34..b8aa572c 100644
--- a/src/arkhamdb/DeckInstructionGenerator.ttslua
+++ b/src/arkhamdb/DeckInstructionGenerator.ttslua
@@ -3,14 +3,14 @@ local searchLib = require("util/SearchLib")
local idList = {}
-local cardWidth = 250
+local cardWidth = 235
local cardHeight = cardWidth * 1.4
local galleryTemplateStart = [[
]]
-local templateCardRegular = [[
]]
-local templateCardSlice = [[
]]
+local templateCard = [[
]]
+local templateSlice = [[
]]
local galleryTemplateEnd = [[
]] .. "\n" .. [[]]
function onLoad()
@@ -36,7 +37,7 @@ function onLoad()
buttonParameters.width = 800
buttonParameters.click_function = "generate"
buttonParameters.color = { 0, 0, 0, 0 }
- buttonParameters.position = { 0, 0.11, 0.74 }
+ buttonParameters.position = Vector(0, 0.11, 0.74)
buttonParameters.scale = { 0.5, 1, 0.5 }
self.createButton(buttonParameters)
end
@@ -124,7 +125,7 @@ function generate(_, playerColor)
-- edit the existing tab
Notes.editNotebookTab({
index = nb.index,
- body = nb.body .. "\n\n" .. timestamp .. "\n" .. description,
+ body = timestamp .. "\n\n" .. description,
})
return
end
@@ -133,12 +134,7 @@ function generate(_, playerColor)
-- add a new notebook tab for it (since there was no existing tab)
Notes.addNotebookTab({
title = "Deck Instructions",
- body =
- "Make sure to copy the section beginning with '++SCED import instructions++' to your ArkhamDB / arkham.build deck description." ..
- "\nAfter doing so, the Deck Importer will be able to spawn these cards IF they are added to the mod's card index (for example by " ..
- "throwing them into the 'Additional Cards Box' next to the Player Cards Panel in the upper left corner of the table." ..
- "\nIt also supports '- remove:' instructions to automatically remove placeholder cards.\nIf you are using a custom " ..
- "investigator, make sure to use a 'remove' instruction to remove the original one.\n\n" .. timestamp .. "\n" .. description
+ body = timestamp .. "\n\n" .. description
})
end
@@ -154,34 +150,33 @@ end
function maybeAddImageToGallery(t, data)
if data.sheetH and data.sheetW then
-- add cards from decksheets
- local element = templateCardSlice
- element = element:gsub("{{SHEET_SIZE_1}}", data.sheetW * cardWidth):gsub("{{SHEET_SIZE_2}}", data.sheetH * cardHeight)
- element = element:gsub("{{OFFSET_1}}", data.col * cardWidth):gsub("{{OFFSET_2}}", data.row * cardHeight)
-
- maybeAddCardSlice(t, element, data.face, data.cardId)
+ local element = templateSlice
+ element = element:gsub("{{SHEET_SIZE_1}}", data.sheetW * cardWidth)
+ element = element:gsub("{{SHEET_SIZE_2}}", data.sheetH * cardHeight)
+ element = element:gsub("{{OFFSET_1}}", (data.col - 1) * cardWidth)
+ element = element:gsub("{{OFFSET_2}}", (data.row - 1) * cardHeight)
+ maybeAddSlice(t, element, data.face, data.cardId)
if data.uniqueBack then
- maybeAddCardSlice(t, element, data.back, data.cardId)
+ maybeAddSlice(t, element, data.back, data.cardId)
else
- maybeAddCardRegular(t, data.back)
+ maybeAddCard(t, data.back)
end
else
-- add regular cards
- maybeAddCardRegular(t, data.face)
- maybeAddCardRegular(t, data.back)
+ maybeAddCard(t, data.face)
+ maybeAddCard(t, data.back)
end
end
-function maybeAddCardRegular(t, url)
- if not url then return end
-
- if not addedImages[url] then
+function maybeAddCard(t, url)
+ if url and not addedImages[url] then
addedImages[url] = true
- table.insert(t, templateCardRegular:gsub("{{IMAGE_URL}}", url) .. "\n")
+ table.insert(t, templateCard:gsub("{{IMAGE_URL}}", url) .. "\n")
end
end
-function maybeAddCardSlice(t, element, url, cardId)
+function maybeAddSlice(t, element, url, cardId)
if not url then return end
-- initialize table
@@ -237,7 +232,7 @@ function sortByMetadata(a, b)
if isInvestigatorA and not isInvestigatorB then
return true
- elseif isInvestigatorB and not isInvestigatorA then
+ elseif not isInvestigatorA and isInvestigatorB then
return false
elseif numA and numB then
return numA < numB