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:
@@ -2,7 +2,7 @@
|
||||
import { worldState, advanceDialog, startDialog } from './worldState.js';
|
||||
import { getMap, getInteraction, getNPC, getExit, isWalkable } from './maps.js';
|
||||
import { toggleDebug } from './worldRenderer.js';
|
||||
import { isBackpackOpen, openBackpack, handleBackpackInput } from './inventory.js';
|
||||
import { isBackpackOpen, openBackpack, handleBackpackInput, isNamingActive, handleNamingInput } from './inventory.js';
|
||||
|
||||
const keysDown = new Set();
|
||||
let interactionHandler = null;
|
||||
@@ -26,6 +26,13 @@ function onKeyDown(e) {
|
||||
const key = e.key;
|
||||
keysDown.add(key);
|
||||
|
||||
// Naming screen — route all input there
|
||||
if (isNamingActive()) {
|
||||
e.preventDefault();
|
||||
handleNamingInput(key);
|
||||
return;
|
||||
}
|
||||
|
||||
// Backpack open — route all input there
|
||||
if (isBackpackOpen()) {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user