diff --git a/client/public/version.js b/client/public/version.js index 5546dec..8a637b4 100644 --- a/client/public/version.js +++ b/client/public/version.js @@ -1,5 +1,5 @@ // Maintainer-controlled web client version. // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) -window.CHGRID_WEB_VERSION = "2026.02.22 R146"; +window.CHGRID_WEB_VERSION = "2026.02.22 R147"; // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. window.CHGRID_TIME_ZONE = "America/Detroit"; diff --git a/client/src/main.ts b/client/src/main.ts index 9fc2bc5..91e2c2f 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -42,7 +42,6 @@ import { } from './state/gameState'; import { applyServerItemUiDefinitions, - EDITABLE_ITEM_PROPERTY_KEYS, getDefaultClockTimeZone, getItemTypeGlobalProperties, getItemTypeSequence, @@ -794,6 +793,10 @@ function getFallbackInspectPropertyTooltip(key: string): string | undefined { return undefined; } +function isItemPropertyEditable(item: WorldItem, key: string): boolean { + return getEditableItemPropertyKeys(item).includes(key); +} + function describeItemPropertyHelp(item: WorldItem, key: string): string { const metadata = getItemPropertyMetadata(item.type, key); const parts: string[] = []; @@ -823,7 +826,7 @@ function describeItemPropertyHelp(item: WorldItem, key: string): string { parts.push(`Max length: ${metadata.maxLength} characters.`); } - parts.push(EDITABLE_ITEM_PROPERTY_KEYS.has(key) ? 'Editable.' : 'Read only.'); + parts.push(isItemPropertyEditable(item, key) ? 'Editable.' : 'Read only.'); return parts.join(' '); } @@ -2056,7 +2059,7 @@ function handleItemPropertiesModeInput(code: string, key: string): void { } if (code === 'Enter') { const key = state.itemPropertyKeys[state.itemPropertyIndex]; - if (!EDITABLE_ITEM_PROPERTY_KEYS.has(key)) { + if (!isItemPropertyEditable(item, key)) { updateStatus(`${itemPropertyLabel(key)} is not editable.`); audio.sfxUiCancel(); return;