Auto stash before merge of "feature/terminal-game-engine" and "origin/feature/terminal-game-engine"
This commit is contained in:
parent
8fa11c4f00
commit
901f3e5cdc
3 changed files with 24 additions and 6 deletions
|
|
@ -16,6 +16,10 @@ class InputManager {
|
|||
this.keydownHandler = (e) => {
|
||||
if (this.mode !== "options") return;
|
||||
|
||||
// Check if terminal input has text - if so, let user submit commands like "quit"
|
||||
const terminalInput = document.getElementById("input");
|
||||
const hasInputText = terminalInput && terminalInput.value.trim().length > 0;
|
||||
|
||||
if (e.key === "ArrowUp") {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
|
@ -25,10 +29,14 @@ class InputManager {
|
|||
e.stopPropagation();
|
||||
this._selectNext();
|
||||
} else if (e.key === "Enter") {
|
||||
// If user has typed something, let it through to submit the command
|
||||
if (hasInputText) return;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this._confirmSelection();
|
||||
} else if (/^[1-9]$/.test(e.key)) {
|
||||
// Only intercept if input is empty (user isn't typing a command)
|
||||
if (hasInputText) return;
|
||||
const index = parseInt(e.key) - 1;
|
||||
if (index < this.options.length) {
|
||||
e.preventDefault();
|
||||
|
|
|
|||
|
|
@ -75,6 +75,11 @@ class SceneManager {
|
|||
await this._renderContent(scene.content);
|
||||
}
|
||||
|
||||
// Execute onAfterRender actions (after content, before options)
|
||||
if (scene.onAfterRender) {
|
||||
await this._executeActions(scene.onAfterRender);
|
||||
}
|
||||
|
||||
// Handle navigation
|
||||
if (scene.options) {
|
||||
await this._handleOptions(scene);
|
||||
|
|
|
|||
|
|
@ -86,8 +86,8 @@ const END_SCREEN = `
|
|||
`;
|
||||
|
||||
const boxingDayGame = {
|
||||
id: "boxing-day",
|
||||
name: "Boxing Day",
|
||||
id: "system-shutdown-1999-part-1",
|
||||
name: "System Shutdown: 1999 - Part 1",
|
||||
command: "dial",
|
||||
description: "Connect to Dark Tower BBS - December 26, 1999",
|
||||
|
||||
|
|
@ -190,9 +190,14 @@ const boxingDayGame = {
|
|||
className: "game-ansi-art center",
|
||||
},
|
||||
"",
|
||||
{ text: "B B S - E S T . 1 9 9 6", className: "info center" },
|
||||
{ text: "SysOp: NightWatchman", className: "info" },
|
||||
{ text: "Users Online: 3", className: "info" },
|
||||
{
|
||||
text: "---=[ B B S - E S T. 1 9 9 5 ]=---",
|
||||
className: "info center",
|
||||
},
|
||||
{
|
||||
text: "[ Users Online - 3 ] - [ SysOp - NightWatchman ]",
|
||||
className: "info center",
|
||||
},
|
||||
{ text: "Local Time: 11:52 PM", className: "info" },
|
||||
"",
|
||||
// New message notification (only if not read)
|
||||
|
|
@ -212,7 +217,7 @@ const boxingDayGame = {
|
|||
content: { text: "[Returning to main menu]", className: "info" },
|
||||
},
|
||||
],
|
||||
onEnter: [{ set: "visited.dark_tower_main", value: true }],
|
||||
onAfterRender: [{ set: "visited.dark_tower_main", value: true }],
|
||||
prompt: "Select:",
|
||||
options: [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue