feat: add game command functionality and update quick commands for Number Match game

This commit is contained in:
2026-03-15 12:39:28 +11:00
parent df10268a83
commit d762f8e67e
3 changed files with 59 additions and 5 deletions

View File

@@ -858,7 +858,7 @@ export function updateQuickCommands(mode) {
const container = document.querySelector('.quick-commands');
const statusLeft = document.querySelector('.status-left');
if (!container) return;
if (mode === 'chat') {
if (statusLeft) statusLeft.textContent = 'Chat Mode';
container.innerHTML = `
@@ -867,6 +867,9 @@ export function updateQuickCommands(mode) {
<button class="quick-cmd" onclick="runChatCommand('/samsay')" title="SAM speech">/samsay</button>
<button class="quick-cmd" onclick="runChatCommand('/quit')" title="Exit chat">/quit</button>
`;
} else if (mode === 'game') {
if (statusLeft) statusLeft.textContent = 'Number Match';
container.innerHTML = '';
} else {
if (statusLeft) statusLeft.textContent = 'Ready';
container.innerHTML = `
@@ -878,6 +881,17 @@ export function updateQuickCommands(mode) {
}
}
/**
* Run a game command from a button click
* @param {string} command - The game command to submit
* @returns {void}
*/
export function runGameCommand(command) {
if (!inlineInput || !submitInlineInput) return;
inlineInput.value = command;
submitInlineInput();
}
/**
* Run a chat command from button click
* @param {string} command - The chat command to run