feat: replace browser dialogs with in-game naming screen + notifications

Remove prompt() and alert() calls that broke game immersion. Add:
- Pokemon-style naming screen with character grid + direct typing
- Canvas-rendered notification toasts (with fade-out animation)
- Both render on top of workshop AND world mode canvases
- Workshop keyboard handler yields to naming screen when active

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jose Luis
2026-03-20 17:36:31 +01:00
parent c6f5e19af5
commit 816a02aeb9
6 changed files with 267 additions and 36 deletions

View File

@@ -6,7 +6,7 @@ import {
import { worldState } from './worldState.js';
import { getMap, getInteraction, getNPC, getExit, isWall } from './maps.js';
import { updateMovement } from './worldInput.js';
import { drawBackpack, getGadgets } from './inventory.js';
import { drawBackpack, getGadgets, drawNamingScreen, drawNotification } from './inventory.js';
let canvas = null;
let ctx = null;
@@ -144,6 +144,12 @@ export function renderWorld(timestamp) {
if (worldState.mode === 'inventory') {
drawBackpack(ctx, canvas.width, canvas.height);
}
// === Layer 7: Naming screen (on top of everything including backpack) ===
drawNamingScreen(ctx, canvas.width, canvas.height);
// === Layer 8: Notification toast ===
drawNotification(ctx, canvas.width);
}
function drawHUD(map) {