handle minicard / missing name
This commit is contained in:
parent
79bdeff129
commit
3a78375989
@ -76,7 +76,6 @@ function generate(_, playerColor)
|
|||||||
-- create the main part of the instructions
|
-- create the main part of the instructions
|
||||||
local createGallery = false
|
local createGallery = false
|
||||||
for _, entry in ipairs(idList) do
|
for _, entry in ipairs(idList) do
|
||||||
-- start a new line and add first part of instruction
|
|
||||||
table.insert(descriptionParts, "\n- add: " .. entry.id .. " (")
|
table.insert(descriptionParts, "\n- add: " .. entry.id .. " (")
|
||||||
|
|
||||||
-- maybe add hyperlink to card face
|
-- maybe add hyperlink to card face
|
||||||
@ -85,7 +84,6 @@ function generate(_, playerColor)
|
|||||||
table.insert(descriptionParts, '<a href="' .. entry.face .. '">')
|
table.insert(descriptionParts, '<a href="' .. entry.face .. '">')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- name of the card
|
|
||||||
table.insert(descriptionParts, "**" .. entry.name .. "**")
|
table.insert(descriptionParts, "**" .. entry.name .. "**")
|
||||||
|
|
||||||
-- maybe close hyperlink
|
-- maybe close hyperlink
|
||||||
@ -93,7 +91,6 @@ function generate(_, playerColor)
|
|||||||
table.insert(descriptionParts, "</a>")
|
table.insert(descriptionParts, "</a>")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- closing bracket
|
|
||||||
table.insert(descriptionParts, ")")
|
table.insert(descriptionParts, ")")
|
||||||
|
|
||||||
-- maybe add hyperlink for back
|
-- maybe add hyperlink for back
|
||||||
@ -145,9 +142,10 @@ function getIdFromData(metadata)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function addGallery(t)
|
function addGallery(t)
|
||||||
|
addedImages = {}
|
||||||
|
|
||||||
table.insert(t, "\n\n" .. galleryTemplateStart .. "\n")
|
table.insert(t, "\n\n" .. galleryTemplateStart .. "\n")
|
||||||
|
|
||||||
addedImages = {}
|
|
||||||
for _, entry in ipairs(idList) do
|
for _, entry in ipairs(idList) do
|
||||||
maybeAddImageToGallery(t, entry)
|
maybeAddImageToGallery(t, entry)
|
||||||
end
|
end
|
||||||
@ -208,12 +206,19 @@ function processCard(cardData, playerColor)
|
|||||||
if id then
|
if id then
|
||||||
local cardDetails = {
|
local cardDetails = {
|
||||||
id = id,
|
id = id,
|
||||||
name = cardData.Nickname,
|
|
||||||
metadata = md,
|
metadata = md,
|
||||||
cardId = math.floor(cardData.CardID % 100),
|
cardId = math.floor(cardData.CardID % 100),
|
||||||
sideways = cardData["SidewaysCard"]
|
sideways = cardData["SidewaysCard"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cardData.Nickname ~= "" then
|
||||||
|
cardDetails.name = cardData.Nickname
|
||||||
|
elseif md.type == "Minicard" then
|
||||||
|
cardDetails.name = "Minicard"
|
||||||
|
else
|
||||||
|
cardDetails.name = "-"
|
||||||
|
end
|
||||||
|
|
||||||
-- add images unless minicard
|
-- add images unless minicard
|
||||||
if md.type ~= "Minicard" then
|
if md.type ~= "Minicard" then
|
||||||
local _, customDeckData = next(cardData["CustomDeck"])
|
local _, customDeckData = next(cardData["CustomDeck"])
|
||||||
|
Loading…
Reference in New Issue
Block a user