Add z item management menu with transfer and yes/no confirmation
This commit is contained in:
@@ -23,7 +23,8 @@ export type MainModeCommand =
|
||||
| 'speakUsers'
|
||||
| 'addItem'
|
||||
| 'locateOrListItems'
|
||||
| 'pickupDropOrDelete'
|
||||
| 'pickupDropItem'
|
||||
| 'openItemManagement'
|
||||
| 'editOrInspectItem'
|
||||
| 'pingServer'
|
||||
| 'locateOrListUsers'
|
||||
@@ -57,12 +58,12 @@ export function resolveMainModeCommand(code: string, shiftKey: boolean): MainMod
|
||||
if (code === 'KeyU') return shiftKey ? null : 'speakUsers';
|
||||
if (code === 'KeyA') return shiftKey ? null : 'addItem';
|
||||
if (code === 'KeyI') return 'locateOrListItems';
|
||||
if (code === 'KeyD') return 'pickupDropOrDelete';
|
||||
if (code === 'KeyD') return shiftKey ? null : 'pickupDropItem';
|
||||
if (code === 'KeyO') return 'editOrInspectItem';
|
||||
if (code === 'KeyP') return shiftKey ? null : 'pingServer';
|
||||
if (code === 'KeyL') return 'locateOrListUsers';
|
||||
if (code === 'Slash') return shiftKey ? 'openHelp' : 'openChat';
|
||||
if (code === 'KeyZ') return shiftKey ? 'openAdminMenu' : null;
|
||||
if (code === 'KeyZ') return shiftKey ? 'openAdminMenu' : 'openItemManagement';
|
||||
if (code === 'Comma') return shiftKey ? 'chatFirst' : 'chatPrev';
|
||||
if (code === 'Period') return shiftKey ? 'chatLast' : 'chatNext';
|
||||
if (code === 'Escape') return 'escape';
|
||||
|
||||
18
client/src/input/yesNoMenu.ts
Normal file
18
client/src/input/yesNoMenu.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { handleListControlKey, type ListControlResult } from './listController';
|
||||
|
||||
export type YesNoOption = {
|
||||
id: 'no' | 'yes';
|
||||
label: 'No' | 'Yes';
|
||||
};
|
||||
|
||||
export const YES_NO_OPTIONS: readonly YesNoOption[] = [
|
||||
{ id: 'no', label: 'No' },
|
||||
{ id: 'yes', label: 'Yes' },
|
||||
];
|
||||
|
||||
/**
|
||||
* Handles standardized yes/no menu key input using shared list controls.
|
||||
*/
|
||||
export function handleYesNoMenuInput(code: string, key: string, currentIndex: number): ListControlResult {
|
||||
return handleListControlKey(code, key, YES_NO_OPTIONS, currentIndex, (entry) => entry.label);
|
||||
}
|
||||
Reference in New Issue
Block a user