Skip to content

Commit

Permalink
restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
lacymorrow committed Oct 8, 2019
1 parent 59501f8 commit 50d87fe
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { is } = require("electron-util");
const unhandled = require("electron-unhandled");
const debug = require("electron-debug");
const contextMenu = require("electron-context-menu");
const config = require("./config");
const config = require("./src/config");
const menu = require("./src/menu");

unhandled();
Expand Down Expand Up @@ -49,7 +49,7 @@ app.setAppUserModelId("com.lacymorrow.CrossOver");
let mainWindow;

// __static path
const __static = process.env.NODE_ENV !== 'development' ? path.join(__dirname, '/static').replace(/\\/g, '\\\\') : 'static'
const __static = process.env.NODE_ENV !== 'development' ? path.join(__dirname, '/src/static').replace(/\\/g, '\\\\') : 'static'

// Crosshair images
const crosshairsPath = path.join(__static, 'crosshairs');
Expand Down Expand Up @@ -80,7 +80,7 @@ const setupCrosshairInput = () => {
const crosshair = config.get("crosshair");
new Promise((resolve, reject) => {
fs.readdir(crosshairsPath, (err, dir) => {
if (err) reject(err);
if (err) reject(`Promise Errored: ${err}`, crosshairsPath);

mainWindow.webContents.executeJavaScript(
`document.querySelector("#crosshairs").options.length = 0;`
Expand All @@ -101,9 +101,9 @@ const setupCrosshairInput = () => {
);
}

// mainWindow.webContents.executeJavaScript(
// `document.querySelector('#crosshairImg').src = 'static/crosshairs/${crosshair}.png'`
// );
mainWindow.webContents.executeJavaScript(
`document.querySelector('#crosshairImg').src = 'static/crosshairs/${crosshair}.png'`
);
mainWindow.webContents.executeJavaScript(
`
for(let i = 0; i < document.querySelector("#crosshairs").options.length; i++) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<div class="crosshair-wrapper">
<div id="crosshair">
<img id="crosshairImg" src="../static/crosshairs/bullseye.png" draggable="false" />
<img id="crosshairImg" src="static/crosshairs/bullseye.png" draggable="false" />
<div class="sight dot">&nbsp;</div>
</div>
<div class="drag-me"></div>
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 50d87fe

Please sign in to comment.