mirror of
https://github.com/litruv/lit.ruv.wtf.git
synced 2026-07-25 03:06:02 +10:00
feat: add game command functionality and update quick commands for Number Match game
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user