Add playable hub travel with durable character transfers
This commit is contained in:
@@ -25,7 +25,7 @@ function openCommand(op: string, worldId = '', target = '', value = '') {
|
||||
const create = op === 'create-world', rename = op === 'rename';
|
||||
$('command-title').textContent = labels[op];
|
||||
$('command-context').textContent = create ? 'Deployment: GitOps / ArgoCD' : `${worldId}${target ? ` / ${target}` : ''}`;
|
||||
$('world-input-label').hidden = !create;
|
||||
$('world-input-label').hidden = !create; $('world-kind-label').hidden=!create;
|
||||
$<HTMLInputElement>('world-input').required = create;
|
||||
$('value-input-label').hidden = !create && !rename;
|
||||
$('value-caption').textContent = create ? 'Seed' : 'Character name';
|
||||
@@ -133,7 +133,7 @@ for (const id of ['close-command','cancel-command']) $(id).onclick = () => comma
|
||||
$('close-character').onclick = () => characterMenu.close();
|
||||
$<HTMLFormElement>('command-form').onsubmit = async event => {
|
||||
event.preventDefault(); const submit = $<HTMLButtonElement>('submit-command'); submit.disabled = true;
|
||||
const body = { ...draft, worldId: draft.op === 'create-world' ? $<HTMLInputElement>('world-input').value : draft.worldId, value: ['rename','create-world'].includes(draft.op) ? $<HTMLInputElement>('value-input').value : '', reason: $<HTMLTextAreaElement>('reason-input').value, confirm: $<HTMLInputElement>('confirm-input').value };
|
||||
const body = { ...draft, op:draft.op==='create-world'&&$<HTMLSelectElement>('world-kind').value==='hub'?'create-hub':draft.op, worldId: draft.op === 'create-world' ? $<HTMLInputElement>('world-input').value : draft.worldId, value: ['rename','create-world'].includes(draft.op) ? $<HTMLInputElement>('value-input').value : '', reason: $<HTMLTextAreaElement>('reason-input').value, confirm: $<HTMLInputElement>('confirm-input').value };
|
||||
try { await api('/api/control/commands', body); $<HTMLDialogElement>('command-dialog').close(); notify('Action queued. Execution status is recorded in the audit log.'); await refresh(); }
|
||||
catch (e) { $('command-error').textContent = (e as Error).message; }
|
||||
finally { submit.disabled = false; }
|
||||
|
||||
Reference in New Issue
Block a user