mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Snow is no longer offered anywhere a style can be chosen: the Visual Presets tray, keyboard shortcut 7, the Cockpit vision carousel, and the set_visual_style voice action. The shader and its labels go with it; weather snowfall and the SNOW weather condition are unaffected. Share links keep working. Snow's enum code (6) stays reserved, so a compact or long-form link that names it opens on Normal and drops the Snow shader parameters without reporting them as unknown. A Scene Director shot saved with Snow plays on Normal too. Snow's frozen share defaults matched Normal's apart from those parameters, so no other setting in an old link changes meaning. The legacy voice-schema pins restore Snow before hashing, so the unchanged pins still prove nothing else moved; the complete Realtime payload digest is re-derived.
48 lines
1.5 KiB
JavaScript
48 lines
1.5 KiB
JavaScript
const STYLE_KEYS = Object.freeze({
|
|
1: 'normal',
|
|
2: 'retro',
|
|
3: 'surveillance',
|
|
4: 'thermal',
|
|
5: 'anime',
|
|
6: 'noir',
|
|
});
|
|
|
|
/**
|
|
* Bind the application's existing bubbling keyboard shortcuts.
|
|
* Capture-phase surfaces keep first refusal. The caller owns each action and
|
|
* persistence; form controls keep native typing except for Escape.
|
|
* @param {object} options
|
|
* @param {Document} options.documentRef Keyboard event target.
|
|
* @param {HTMLElement} options.searchInput Additional editing target.
|
|
* @param {object} options.actions Existing application operations.
|
|
* @returns {{destroy: Function}} Synchronous, idempotent listener cleanup.
|
|
*/
|
|
export function bindApplicationShortcuts({
|
|
documentRef,
|
|
searchInput,
|
|
actions,
|
|
}) {
|
|
const onKeyDown = (event) => {
|
|
const isFormControl =
|
|
event.target?.matches?.('select, input, textarea') ||
|
|
event.target === searchInput;
|
|
if (isFormControl && event.key !== 'Escape') return;
|
|
|
|
if (STYLE_KEYS[event.key]) actions.setStyle(STYLE_KEYS[event.key]);
|
|
if (event.key === 'Escape') actions.dismissSearch();
|
|
const key = event.key.toLowerCase();
|
|
if (key === 'h') actions.toggleHud();
|
|
if (key === 'o') actions.toggleOrbit();
|
|
if (key === 'v') actions.toggleCleanView();
|
|
if (key === 'f') actions.toggleLayers();
|
|
if (key === 'd') actions.cycleDetection();
|
|
if (key === 'c') actions.toggleCctv();
|
|
};
|
|
documentRef.addEventListener('keydown', onKeyDown);
|
|
return {
|
|
destroy() {
|
|
documentRef.removeEventListener('keydown', onKeyDown);
|
|
},
|
|
};
|
|
}
|