Add image grid to inventory command #277

Merged
Vylpes merged 3 commits from feature/79-inventory-cards into develop 2024-06-28 18:37:58 +01:00
Showing only changes of commit 8ccd967cbe - Show all commits

View file

@ -127,12 +127,12 @@ export default class InventoryHelper {
const canvasHeight = imageHeight * Math.floor((gridSize ** 2) / gridSize);
const canvas = createCanvas(canvasWidth, canvasHeight);
const ctx = canvas.getContext('2d');
const ctx = canvas.getContext("2d");
for (let i = 0; i < page.cards.length; i++) {
const card = page.cards[i];
let image = await loadImage(path.join(process.env.DATA_DIR!, "cards", card.path));
const image = await loadImage(path.join(process.env.DATA_DIR!, "cards", card.path));
if (!image) {
AppLogger.LogError("InventoryHelper/GenerateInventoryImage", `Failed to load image for card ${card.id}`);