Refresh item tooltip copy and add global property tooltips
This commit is contained in:
@@ -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.21 R121";
|
window.CHGRID_WEB_VERSION = "2026.02.21 R122";
|
||||||
// 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";
|
||||||
|
|||||||
@@ -74,14 +74,23 @@ export type ItemPropertyMetadata = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const DEFAULT_ITEM_TYPE_TOOLTIPS: Record<ItemType, string> = {
|
const DEFAULT_ITEM_TYPE_TOOLTIPS: Record<ItemType, string> = {
|
||||||
radio_station: 'Streams audio from a URL and can emit directional sound on the grid.',
|
radio_station: 'Can play stations from the Internet. Tune multiple to the same station and they will sync up.',
|
||||||
dice: 'Roll one or more dice and report each value plus total.',
|
dice: 'Great for drinking games or boredom.',
|
||||||
wheel: 'Spin a wheel from a comma-delimited list of spaces.',
|
wheel: 'Spin to win fabulous prizes.',
|
||||||
clock: 'Speaks the current time using its configured timezone and format.',
|
clock: 'It tells the time. What did you think it did?',
|
||||||
|
};
|
||||||
|
|
||||||
|
const DEFAULT_GLOBAL_ITEM_PROPERTY_METADATA: Record<string, ItemPropertyMetadata> = {
|
||||||
|
useSound: { valueType: 'sound', tooltip: 'One-shot sound played when this item is used successfully.' },
|
||||||
|
emitSound: { valueType: 'sound', tooltip: 'Looping sound emitted from this item on the grid.' },
|
||||||
|
useCooldownMs: { valueType: 'number', tooltip: 'Global cooldown in milliseconds between uses for this item type.' },
|
||||||
|
emitRange: { valueType: 'number', tooltip: 'Maximum distance in squares where emitted audio can be heard.' },
|
||||||
|
directional: { valueType: 'boolean', tooltip: "Whether emitted audio favors the item's facing direction." },
|
||||||
};
|
};
|
||||||
|
|
||||||
const DEFAULT_ITEM_PROPERTY_METADATA: Record<ItemType, Record<string, ItemPropertyMetadata>> = {
|
const DEFAULT_ITEM_PROPERTY_METADATA: Record<ItemType, Record<string, ItemPropertyMetadata>> = {
|
||||||
radio_station: {
|
radio_station: {
|
||||||
|
...DEFAULT_GLOBAL_ITEM_PROPERTY_METADATA,
|
||||||
title: { valueType: 'text', tooltip: 'Display name spoken and shown for this item.' },
|
title: { valueType: 'text', tooltip: 'Display name spoken and shown for this item.' },
|
||||||
streamUrl: { valueType: 'text', tooltip: 'Audio stream URL used by this radio.' },
|
streamUrl: { valueType: 'text', tooltip: 'Audio stream URL used by this radio.' },
|
||||||
enabled: { valueType: 'boolean', tooltip: 'Turns playback on or off for this radio.' },
|
enabled: { valueType: 'boolean', tooltip: 'Turns playback on or off for this radio.' },
|
||||||
@@ -93,15 +102,18 @@ const DEFAULT_ITEM_PROPERTY_METADATA: Record<ItemType, Record<string, ItemProper
|
|||||||
emitRange: { valueType: 'number', tooltip: "Maximum distance in squares for this radio's emitted audio.", range: { min: 5, max: 20, step: 1 } },
|
emitRange: { valueType: 'number', tooltip: "Maximum distance in squares for this radio's emitted audio.", range: { min: 5, max: 20, step: 1 } },
|
||||||
},
|
},
|
||||||
dice: {
|
dice: {
|
||||||
|
...DEFAULT_GLOBAL_ITEM_PROPERTY_METADATA,
|
||||||
title: { valueType: 'text', tooltip: 'Display name spoken and shown for this item.' },
|
title: { valueType: 'text', tooltip: 'Display name spoken and shown for this item.' },
|
||||||
sides: { valueType: 'number', tooltip: 'Number of sides on each die.', range: { min: 1, max: 100, step: 1 } },
|
sides: { valueType: 'number', tooltip: 'Number of sides on each die.', range: { min: 1, max: 100, step: 1 } },
|
||||||
number: { valueType: 'number', tooltip: 'How many dice to roll per use.', range: { min: 1, max: 100, step: 1 } },
|
number: { valueType: 'number', tooltip: 'How many dice to roll per use.', range: { min: 1, max: 100, step: 1 } },
|
||||||
},
|
},
|
||||||
wheel: {
|
wheel: {
|
||||||
|
...DEFAULT_GLOBAL_ITEM_PROPERTY_METADATA,
|
||||||
title: { valueType: 'text', tooltip: 'Display name spoken and shown for this item.' },
|
title: { valueType: 'text', tooltip: 'Display name spoken and shown for this item.' },
|
||||||
spaces: { valueType: 'text', tooltip: 'Comma-delimited list of wheel spaces. Example: yes, no, maybe.' },
|
spaces: { valueType: 'text', tooltip: 'Comma-delimited list of wheel spaces. Example: yes, no, maybe.' },
|
||||||
},
|
},
|
||||||
clock: {
|
clock: {
|
||||||
|
...DEFAULT_GLOBAL_ITEM_PROPERTY_METADATA,
|
||||||
title: { valueType: 'text', tooltip: 'Display name spoken and shown for this item.' },
|
title: { valueType: 'text', tooltip: 'Display name spoken and shown for this item.' },
|
||||||
timeZone: { valueType: 'list', tooltip: 'Timezone used when the clock speaks time.' },
|
timeZone: { valueType: 'list', tooltip: 'Timezone used when the clock speaks time.' },
|
||||||
use24Hour: { valueType: 'boolean', tooltip: 'Use 24 hour format instead of AM/PM.' },
|
use24Hour: { valueType: 'boolean', tooltip: 'Use 24 hour format instead of AM/PM.' },
|
||||||
|
|||||||
@@ -131,14 +131,23 @@ ITEM_PROPERTY_OPTIONS: dict[str, tuple[str, ...]] = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ITEM_TYPE_TOOLTIPS: dict[ItemType, str] = {
|
ITEM_TYPE_TOOLTIPS: dict[ItemType, str] = {
|
||||||
"radio_station": "Streams audio from a URL and can emit directional sound on the grid.",
|
"radio_station": "Can play stations from the Internet. Tune multiple to the same station and they will sync up.",
|
||||||
"dice": "Roll one or more dice and report each value plus total.",
|
"dice": "Great for drinking games or boredom.",
|
||||||
"wheel": "Spin a wheel from a comma-delimited list of spaces.",
|
"wheel": "Spin to win fabulous prizes.",
|
||||||
"clock": "Speaks the current time using its configured timezone and format.",
|
"clock": "It tells the time. What did you think it did?",
|
||||||
|
}
|
||||||
|
|
||||||
|
GLOBAL_ITEM_PROPERTY_METADATA: dict[str, dict[str, object]] = {
|
||||||
|
"useSound": {"valueType": "sound", "tooltip": "One-shot sound played when this item is used successfully."},
|
||||||
|
"emitSound": {"valueType": "sound", "tooltip": "Looping sound emitted from this item on the grid."},
|
||||||
|
"useCooldownMs": {"valueType": "number", "tooltip": "Global cooldown in milliseconds between uses for this item type."},
|
||||||
|
"emitRange": {"valueType": "number", "tooltip": "Maximum distance in squares where emitted audio can be heard."},
|
||||||
|
"directional": {"valueType": "boolean", "tooltip": "Whether emitted audio favors the item's facing direction."},
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM_TYPE_PROPERTY_METADATA: dict[ItemType, dict[str, dict[str, object]]] = {
|
ITEM_TYPE_PROPERTY_METADATA: dict[ItemType, dict[str, dict[str, object]]] = {
|
||||||
"radio_station": {
|
"radio_station": {
|
||||||
|
**GLOBAL_ITEM_PROPERTY_METADATA,
|
||||||
"title": {"valueType": "text", "tooltip": "Display name spoken and shown for this item."},
|
"title": {"valueType": "text", "tooltip": "Display name spoken and shown for this item."},
|
||||||
"streamUrl": {"valueType": "text", "tooltip": "Audio stream URL used by this radio."},
|
"streamUrl": {"valueType": "text", "tooltip": "Audio stream URL used by this radio."},
|
||||||
"enabled": {"valueType": "boolean", "tooltip": "Turns playback on or off for this radio."},
|
"enabled": {"valueType": "boolean", "tooltip": "Turns playback on or off for this radio."},
|
||||||
@@ -166,6 +175,7 @@ ITEM_TYPE_PROPERTY_METADATA: dict[ItemType, dict[str, dict[str, object]]] = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
"dice": {
|
"dice": {
|
||||||
|
**GLOBAL_ITEM_PROPERTY_METADATA,
|
||||||
"title": {"valueType": "text", "tooltip": "Display name spoken and shown for this item."},
|
"title": {"valueType": "text", "tooltip": "Display name spoken and shown for this item."},
|
||||||
"sides": {
|
"sides": {
|
||||||
"valueType": "number",
|
"valueType": "number",
|
||||||
@@ -179,6 +189,7 @@ ITEM_TYPE_PROPERTY_METADATA: dict[ItemType, dict[str, dict[str, object]]] = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
"wheel": {
|
"wheel": {
|
||||||
|
**GLOBAL_ITEM_PROPERTY_METADATA,
|
||||||
"title": {"valueType": "text", "tooltip": "Display name spoken and shown for this item."},
|
"title": {"valueType": "text", "tooltip": "Display name spoken and shown for this item."},
|
||||||
"spaces": {
|
"spaces": {
|
||||||
"valueType": "text",
|
"valueType": "text",
|
||||||
@@ -186,6 +197,7 @@ ITEM_TYPE_PROPERTY_METADATA: dict[ItemType, dict[str, dict[str, object]]] = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
"clock": {
|
"clock": {
|
||||||
|
**GLOBAL_ITEM_PROPERTY_METADATA,
|
||||||
"title": {"valueType": "text", "tooltip": "Display name spoken and shown for this item."},
|
"title": {"valueType": "text", "tooltip": "Display name spoken and shown for this item."},
|
||||||
"timeZone": {"valueType": "list", "tooltip": "Timezone used when the clock speaks time."},
|
"timeZone": {"valueType": "list", "tooltip": "Timezone used when the clock speaks time."},
|
||||||
"use24Hour": {"valueType": "boolean", "tooltip": "Use 24 hour format instead of AM/PM."},
|
"use24Hour": {"valueType": "boolean", "tooltip": "Use 24 hour format instead of AM/PM."},
|
||||||
|
|||||||
Reference in New Issue
Block a user