Fix item property display to prefer item overrides

This commit is contained in:
Jage9
2026-02-21 23:21:40 -05:00
parent 9571a3c14d
commit cecb4d97cd
2 changed files with 4 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
// Maintainer-controlled web client version. // Maintainer-controlled web client version.
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
window.CHGRID_WEB_VERSION = "2026.02.22 R131"; window.CHGRID_WEB_VERSION = "2026.02.22 R132";
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
window.CHGRID_TIME_ZONE = "America/Detroit"; window.CHGRID_TIME_ZONE = "America/Detroit";

View File

@@ -738,9 +738,11 @@ function getItemPropertyValue(item: WorldItem, key: string): string {
if (!Number.isFinite(parsed)) return '15'; if (!Number.isFinite(parsed)) return '15';
return String(Math.round(parsed)); return String(Math.round(parsed));
} }
const paramValue = item.params[key];
if (paramValue !== undefined) return String(paramValue);
const globalValue = getItemTypeGlobalProperties(item.type)?.[key]; const globalValue = getItemTypeGlobalProperties(item.type)?.[key];
if (globalValue !== undefined) return String(globalValue); if (globalValue !== undefined) return String(globalValue);
return String(item.params[key] ?? ''); return '';
} }
function inferItemPropertyValueType(item: WorldItem, key: string): string | undefined { function inferItemPropertyValueType(item: WorldItem, key: string): string | undefined {