Add image grid to inventory command #277
1 changed files with 2 additions and 2 deletions
|
@ -127,12 +127,12 @@ export default class InventoryHelper {
|
||||||
const canvasHeight = imageHeight * Math.floor((gridSize ** 2) / gridSize);
|
const canvasHeight = imageHeight * Math.floor((gridSize ** 2) / gridSize);
|
||||||
|
|
||||||
const canvas = createCanvas(canvasWidth, canvasHeight);
|
const canvas = createCanvas(canvasWidth, canvasHeight);
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext("2d");
|
||||||
|
|
||||||
for (let i = 0; i < page.cards.length; i++) {
|
for (let i = 0; i < page.cards.length; i++) {
|
||||||
const card = page.cards[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) {
|
if (!image) {
|
||||||
AppLogger.LogError("InventoryHelper/GenerateInventoryImage", `Failed to load image for card ${card.id}`);
|
AppLogger.LogError("InventoryHelper/GenerateInventoryImage", `Failed to load image for card ${card.id}`);
|
||||||
|
|
Loading…
Reference in a new issue