Show cooldown seconds, expand grid to 0-40, and announce capitals

This commit is contained in:
Jage9
2026-02-21 03:20:10 -05:00
parent dd48c01601
commit 2dd3815634
4 changed files with 5 additions and 3 deletions

View File

@@ -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.21 R87";
window.CHGRID_WEB_VERSION = "2026.02.21 R88";
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
window.CHGRID_TIME_ZONE = "America/Detroit";

View File

@@ -596,6 +596,7 @@ function applyTextInputEdit(code: string, key: string, maxLength: number, allowR
}
function describeCharacter(ch: string): string {
if (ch.length === 1 && /[A-Z]/.test(ch)) return `capital ${ch}`;
if (ch === ' ') return 'space';
if (ch === '\t') return 'tab';
if (ch === '.') return 'period';

View File

@@ -1,4 +1,4 @@
export const GRID_SIZE = 40;
export const GRID_SIZE = 41;
export const HEARING_RADIUS = 15;
export const MOVE_COOLDOWN_MS = 200;

View File

@@ -440,11 +440,12 @@ class SignalingServer:
last_use_ms = self.item_last_use_ms.get(item.id)
if last_use_ms is not None and now_ms - last_use_ms < cooldown_ms:
remaining_ms = cooldown_ms - (now_ms - last_use_ms)
remaining_seconds = max(0.1, round(remaining_ms / 1000, 1))
await self._send_item_result(
client,
False,
"use",
f"{item.title} is on cooldown for {max(1, remaining_ms)} ms.",
f"{item.title} is on cooldown for {remaining_seconds:.1f} s.",
item.id,
)
return