From 1b58fc774dbc7f51fa53a1882034707390a99108 Mon Sep 17 00:00:00 2001 From: Wickedness Date: Sun, 5 Jul 2026 15:21:45 +0900 Subject: [PATCH] Guard battle UI icon frame readability --- scripts/verify-visual-asset-data.mjs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/verify-visual-asset-data.mjs b/scripts/verify-visual-asset-data.mjs index c93f19f..626d6ef 100644 --- a/scripts/verify-visual-asset-data.mjs +++ b/scripts/verify-visual-asset-data.mjs @@ -7,6 +7,8 @@ const server = await createServer({ appType: 'custom' }); +const minimumReadableIconFrameSize = 96; + try { const { battleUiIconManifest } = await server.ssrLoadModule('/src/game/data/battleUiIcons.ts'); const { itemCatalog, equipmentSlots } = await server.ssrLoadModule('/src/game/data/battleItems.ts'); @@ -38,6 +40,18 @@ function validateBattleUiIconAtlas(errors, manifest) { assertNonEmptyString(errors, manifest.textureKey, 'battleUiIconManifest.textureKey'); assertPositiveInteger(errors, manifest.frameWidth, 'battleUiIconManifest.frameWidth'); assertPositiveInteger(errors, manifest.frameHeight, 'battleUiIconManifest.frameHeight'); + assertIntegerAtLeast( + errors, + manifest.frameWidth, + minimumReadableIconFrameSize, + 'battleUiIconManifest.frameWidth for desktop readability' + ); + assertIntegerAtLeast( + errors, + manifest.frameHeight, + minimumReadableIconFrameSize, + 'battleUiIconManifest.frameHeight for desktop readability' + ); assertPositiveInteger(errors, manifest.columns, 'battleUiIconManifest.columns'); assertPositiveInteger(errors, manifest.rows, 'battleUiIconManifest.rows'); @@ -144,6 +158,12 @@ function assertPositiveInteger(errors, value, context) { } } +function assertIntegerAtLeast(errors, value, minimum, context) { + if (!Number.isInteger(value) || value < minimum) { + errors.push(`${context} must be at least ${minimum}`); + } +} + function assertNonEmptyString(errors, value, context) { if (typeof value !== 'string' || value.trim().length === 0) { errors.push(`${context} must be a non-empty string`);