mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-20 12:11:28 -07:00
Add overlay gamepad support for keyboard-only mode (#17)
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
import type { OverlayContentMeasurement, RuntimeOptionId, RuntimeOptionValue } from '../../types';
|
||||
|
||||
export const OVERLAY_HOSTED_MODALS = ['runtime-options', 'subsync', 'jimaku', 'kiku'] as const;
|
||||
export const OVERLAY_HOSTED_MODALS = [
|
||||
'runtime-options',
|
||||
'subsync',
|
||||
'jimaku',
|
||||
'kiku',
|
||||
'controller-select',
|
||||
'controller-debug',
|
||||
] as const;
|
||||
export type OverlayHostedModal = (typeof OVERLAY_HOSTED_MODALS)[number];
|
||||
|
||||
export const IPC_CHANNELS = {
|
||||
@@ -12,6 +19,7 @@ export const IPC_CHANNELS = {
|
||||
toggleDevTools: 'toggle-dev-tools',
|
||||
toggleOverlay: 'toggle-overlay',
|
||||
saveSubtitlePosition: 'save-subtitle-position',
|
||||
saveControllerPreference: 'save-controller-preference',
|
||||
setMecabEnabled: 'set-mecab-enabled',
|
||||
mpvCommand: 'mpv-command',
|
||||
setAnkiConnectEnabled: 'set-anki-connect-enabled',
|
||||
@@ -32,6 +40,7 @@ export const IPC_CHANNELS = {
|
||||
getMecabStatus: 'get-mecab-status',
|
||||
getKeybindings: 'get-keybindings',
|
||||
getConfigShortcuts: 'get-config-shortcuts',
|
||||
getControllerConfig: 'get-controller-config',
|
||||
getSecondarySubMode: 'get-secondary-sub-mode',
|
||||
getCurrentSecondarySub: 'get-current-secondary-sub',
|
||||
focusMainWindow: 'focus-main-window',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type {
|
||||
ControllerPreferenceUpdate,
|
||||
JimakuDownloadQuery,
|
||||
JimakuFilesQuery,
|
||||
JimakuSearchQuery,
|
||||
@@ -48,6 +49,16 @@ export function parseSubtitlePosition(value: unknown): SubtitlePosition | null {
|
||||
};
|
||||
}
|
||||
|
||||
export function parseControllerPreferenceUpdate(value: unknown): ControllerPreferenceUpdate | null {
|
||||
if (!isObject(value)) return null;
|
||||
if (typeof value.preferredGamepadId !== 'string') return null;
|
||||
if (typeof value.preferredGamepadLabel !== 'string') return null;
|
||||
return {
|
||||
preferredGamepadId: value.preferredGamepadId,
|
||||
preferredGamepadLabel: value.preferredGamepadLabel,
|
||||
};
|
||||
}
|
||||
|
||||
export function parseSubsyncManualRunRequest(value: unknown): SubsyncManualRunRequest | null {
|
||||
if (!isObject(value)) return null;
|
||||
const { engine, sourceTrackId } = value;
|
||||
|
||||
Reference in New Issue
Block a user