Skip to content

Commit

Permalink
default window name
Browse files Browse the repository at this point in the history
  • Loading branch information
aza547 committed Jul 27, 2024
1 parent 1ba2498 commit 440283b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/main/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,11 @@ export default class Manager {
const { obsCaptureMode, obsWindowName } = config;

if (obsCaptureMode === 'window_capture' && !obsWindowName) {
console.warn('[Manager] Must select a window to capture from');
throw new Error('Must select a window to capture from.');
console.warn('[Manager] No window selected.');

throw new Error(
'Must select a window in the scene settings, if none appear, make sure WoW is running.'
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/configSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export const configSchema = {
obsWindowName: {
description: 'The window to capture when using window capture mode.',
type: 'string',
default: '',
default: 'World of Warcraft:waApplication Window:Wow.exe',
},
obsRecEncoder: {
description:
Expand Down
23 changes: 23 additions & 0 deletions src/renderer/VideoSourceControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,29 @@ const VideoSourceControls: React.FC = () => {
);
};

// Always include the base game modes even if they aren't currently running.
const classicOpen = windows.find(
(window) => window.name === '[WowClassic.exe]: World of Warcraft'
);

const retailOpen = windows.find(
(window) => window.name === '[Wow.exe]: World of Warcraft'
);

if (!classicOpen) {
windows.push({
name: '[WowClassic.exe]: World of Warcraft',
value: 'World of Warcraft:GxWindowClass:Window:Wow.exe',
});
}

if (!retailOpen) {
windows.push({
name: '[Wow.exe]: World of Warcraft',
value: 'World of Warcraft:waApplication Window:Wow.exe',
});
}

return (
<FormControl size="small" sx={{ ...formControlStyle, maxWidth: '200px' }}>
<InputLabel sx={selectStyle}>Window</InputLabel>
Expand Down

0 comments on commit 440283b

Please sign in to comment.