Skip to content

Commit

Permalink
Fix Electron Build
Browse files Browse the repository at this point in the history
  • Loading branch information
UstymUkhman committed Feb 18, 2024
1 parent 68d49d6 commit 0719105
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
51 changes: 25 additions & 26 deletions YAZH.code-workspace
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
{
"settings": {
"js-import.plainFileSuffix": "bin,css,fbx,frag,fs,glb,glsl,gltf,less,sass,scss,svg,vert,vs,wasm,wat,wgsl",
"settings": {
"js-import.plainFileSuffix": "bin,css,fbx,frag,fs,glb,glsl,gltf,less,sass,scss,svg,vert,vs,wasm,wat,wgsl",
"js-import.filesToScan": "**/*.{ts,tsx,js,jsx,vs,fs,vert,frag,glsl,wgsl}",
"svelte.language-server.runtime": "C:/Program Files/nodejs/node.exe",
"svelte.language-server.runtime": "C:/Program Files/nodejs/node.exe",

"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},

"editor.bracketPairColorization.enabled": false,
"svelte.plugin.typescript.enable": true,
"svelte.plugin.svelte.enable": true,
"editor.bracketPairColorization.enabled": false,
"svelte.plugin.typescript.enable": true,
"svelte.plugin.svelte.enable": true,

"editor.codeActionsOnSave": {
"source.fixAll.eslint": false
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "never"
},

"git.ignoreLimitWarning": true,
"js-import.semicolon": true,
"git.ignoreLimitWarning": true,
"js-import.semicolon": true,

"js-import.alias": {
"@": "./src"
},
"js-import.alias": {
"@": "./src"
},

"eslint.validate": [
"typescript",
"javascript"
]
},
"eslint.validate": ["typescript", "javascript"]
},

"folders": [{
"name": "Yet Another Zombie Horror",
"path": "."
}]
"folders": [
{
"name": "Yet Another Zombie Horror",
"path": "."
}
]
}
9 changes: 7 additions & 2 deletions app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,23 @@ delete process.env.ELECTRON_ENABLE_SECURITY_WARNINGS;
const SCREEN_RATIO = 0.9 + +PRODUCTION * 0.1;
let game: BrowserWindow | null = null;

import { join } from 'path';

function createWindow(): void {
if (game !== null) return;

game = new BrowserWindow({
webPreferences: { preload: './preloader.js' },
webPreferences: {
preload: join(__dirname, './preloader.js')
},

backgroundColor: '#000000',
fullscreen: PRODUCTION,
frame: false
});

game.loadFile(join(__dirname, '../../dist/index.html'));
!PRODUCTION && game.webContents.openDevTools();
game.loadFile('../../dist/index.html');
game.on('closed', () => game = null);
}

Expand Down

0 comments on commit 0719105

Please sign in to comment.