Skip to content

Commit

Permalink
feat(client-electron): add key binds to solve with focus for sixth an…
Browse files Browse the repository at this point in the history
…d seventh daemon
  • Loading branch information
marcincichocki committed Oct 13, 2022
1 parent f18cd7b commit 94f667b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/electron/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export const KEY_BINDS = [
'keyBindWithPriority3',
'keyBindWithPriority4',
'keyBindWithPriority5',
'keyBindWithPriority6',
'keyBindWithPriority7',
'keyBindAnalyze',
] as const;

Expand All @@ -68,6 +70,8 @@ export const COMMANDS = [
'worker:solve.withPriority3',
'worker:solve.withPriority4',
'worker:solve.withPriority5',
'worker:solve.withPriority6',
'worker:solve.withPriority7',
'worker:analyze',
] as const;

Expand Down
10 changes: 10 additions & 0 deletions src/electron/common/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ export const options: BreachProtocolOption[] = [
description: 'Solve breach protocol(prioritize fifth daemon).',
defaultValue: 'Alt+5',
},
{
id: 'keyBindWithPriority6',
description: 'Solve breach protocol(prioritize sixth daemon).',
defaultValue: 'Alt+6',
},
{
id: 'keyBindWithPriority7',
description: 'Solve breach protocol(prioritize seventh daemon).',
defaultValue: 'Alt+7',
},
{
id: 'keyBindAnalyze',
description: 'Analyze breach protocol and display available sequences.',
Expand Down
2 changes: 2 additions & 0 deletions src/electron/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ export class Main {
.register('worker:solve.withPriority3', () => this.onWorkerSolve(2))
.register('worker:solve.withPriority4', () => this.onWorkerSolve(3))
.register('worker:solve.withPriority5', () => this.onWorkerSolve(4))
.register('worker:solve.withPriority6', () => this.onWorkerSolve(5))
.register('worker:solve.withPriority7', () => this.onWorkerSolve(6))
.register('worker:analyze', () => this.onWorkerAnalyze());
}

Expand Down
18 changes: 18 additions & 0 deletions src/electron/renderer/components/KeyBindsSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,24 @@ export const KeyBindsSettings = ({ status }: { status: WorkerStatus }) => {
onBeforeValueChange={validateKeyBind}
/>
</Field>
<Field name="keyBindWithPriority6" onValueChange={changeKeyBind}>
<Label>Solve with priority 6</Label>
<AcceleratorKeyBind
allowRemove
onFocus={onFocus}
onBlur={onBlur}
onBeforeValueChange={validateKeyBind}
/>
</Field>
<Field name="keyBindWithPriority7" onValueChange={changeKeyBind}>
<Label>Solve with priority 7</Label>
<AcceleratorKeyBind
allowRemove
onFocus={onFocus}
onBlur={onBlur}
onBeforeValueChange={validateKeyBind}
/>
</Field>
<Field name="keyBindAnalyze" onValueChange={changeKeyBind}>
<Label>Analyze</Label>
<AcceleratorKeyBind
Expand Down

0 comments on commit 94f667b

Please sign in to comment.