diff --git a/package.json b/package.json index 9778a1d1..68b28827 100644 --- a/package.json +++ b/package.json @@ -25,13 +25,14 @@ "@types/bootstrap": "^5.1.1", "@types/jquery": "^3.5.6", "@types/pngjs": "^6.0.1", - "bootstrap": "^5.1.0", "electron": "^13.1.4", "electron-packager": "^15.2.0", "ts-node": "^10.1.0", "typescript": "^4.3.5" }, "dependencies": { + "@popperjs/core": "^2.9.3", + "bootstrap": "^5.1.0", "expand-vertex-data": "^1.1.2", "jpeg-js": "^0.4.3", "pngjs": "^6.0.0", diff --git a/src/block_atlas.ts b/src/block_atlas.ts index 661091f2..644a969c 100644 --- a/src/block_atlas.ts +++ b/src/block_atlas.ts @@ -3,6 +3,7 @@ import { HashMap } from "./hash_map"; import { UV, RGB } from "./util"; //import blocks from "../resources/blocks.json"; import fs from "fs"; +import path from "path"; interface BlockInfo { name: string; @@ -25,7 +26,9 @@ export class BlockAtlas { constructor() { this._cachedBlocks = new HashMap(1024); - const blocksString = fs.readFileSync("./resources/blocks.json", "utf-8"); + const _path = path.join(__dirname, "../resources/blocks.json"); + console.log(_path); + const blocksString = fs.readFileSync(_path, "utf-8"); if (!blocksString) { throw Error("Could not load blocks.json") } diff --git a/src/main.ts b/src/main.ts index deb04893..3a05d63c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -20,8 +20,7 @@ function createWindow () { nodeIntegration: true, contextIsolation: false, enableRemoteModule: true - }, - icon: "./resources/icon.png" + } }); //mainWindow.removeMenu(); diff --git a/src/renderer.ts b/src/renderer.ts index b8b1bf68..5064f324 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -1,4 +1,5 @@ import * as twgl from "twgl.js"; +import path from "path"; import { Vector3 } from "./vector"; import { ArcballCamera } from "./camera"; @@ -55,7 +56,7 @@ export class Renderer { this._materialBuffers = []; this._atlasTexture = twgl.createTexture(this._gl, { - src: "./resources/blocks.png", + src: path.join(__dirname, "../resources/blocks.png"), mag: this._gl.NEAREST });