Skip to content

Commit

Permalink
new version test
Browse files Browse the repository at this point in the history
  • Loading branch information
xharris committed Apr 15, 2020
1 parent a457522 commit aa5adcb
Show file tree
Hide file tree
Showing 9 changed files with 629 additions and 536 deletions.
20 changes: 13 additions & 7 deletions entry.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
const elec = require("electron");
require("update-electron-app")();

const { app: eApp, BrowserWindow, ipcMain } = require("electron");
const path = require("path");

const WIN_WIDTH = 1000;
const WIN_HEIGHT = 700;

let main_window;
elec.app.on("open-file", (e, path) => {
eApp.on("open-file", (e, path) => {
if (main_window); //main_window.webContents.send('open-file', path);
});
elec.app.commandLine.appendSwitch("enable-gpu-rasterization", "true");
elec.app.on("ready", function () {
let display = elec.screen.getPrimaryDisplay();
eApp.commandLine.appendSwitch("enable-gpu-rasterization", "true");
eApp.on("ready", function () {
const { screen } = require("electron");
let display = screen.getPrimaryDisplay();

main_window = new elec.BrowserWindow({
main_window = new BrowserWindow({
x: display.bounds.x + (display.bounds.width - WIN_WIDTH) / 2,
y: display.bounds.y + (display.bounds.height - WIN_HEIGHT) / 2,
width: WIN_WIDTH,
Expand Down Expand Up @@ -43,9 +46,12 @@ elec.app.on("ready", function () {
e.preventDefault();
if (url.length > 1) require("electron").shell.openExternal(url);
});

ipcMain.on("openDevTools", e => main_window.webContents.openDevTools());
ipcMain.on("showWindow", e => main_window.show());
});

elec.app.commandLine.appendSwitch("ignore-gpu-blacklist");
eApp.commandLine.appendSwitch("ignore-gpu-blacklist");

process.on("uncaughtException", err => {
console.log(err);
Expand Down
32 changes: 30 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"name": "BlankE",
"description": "BlankE game dev",
"version": "0.1.0",
"description": "BlankE game dev environment",
"version": "0.11.1",
"main": "entry.js",
"single-instance": false,
"chromium-args": "--enable-webgl --ignore-gpu-blacklist --allow-file-access-from-files",
"repository": {
"type": "git",
"url": "https://github.com/xharris/blankejs.git"
},
"scripts": {
"electron": "electron .",
"build": "electron-builder",
Expand Down Expand Up @@ -32,6 +36,7 @@
"node-watch": "^0.6.0",
"request": "^2.88.0",
"uglify-es": "^3.3.9",
"update-electron-app": "^1.5.0",
"walk": "^2.3.13"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions projects/test_zone/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"game_size": 2,
"window_size": 3,
"quick_access": [
[
"platformer.lua=script+?",
"platformer.lua"
],
[
"main.lua=script+?",
"main.lua"
],
[
"platformer.lua=script+?",
"platformer.lua"
],
[
"conf.lua=script+?",
"conf.lua"
Expand Down
6 changes: 4 additions & 2 deletions src/blanke-kit/blanke.js
Original file line number Diff line number Diff line change
Expand Up @@ -997,8 +997,10 @@ var blanke = {

chooseFile: function (options, cb) {
//type, onChange, filename='', multiple=false) {
if (!blanke.elec_ref) return;
blanke.elec_ref.remote.dialog.showOpenDialog(options, files => {
//const elec_ref = require('electron');
//if (!blanke.elec_ref) return;
// blanke.elec_ref.
remote.dialog.showOpenDialog(options, files => {
if (!files) return "";
if (files.length == 1) cb(files[0]);
else cb(files);
Expand Down
2 changes: 1 addition & 1 deletion src/js/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ class Code extends Editor {
// this line is closing someting
if (curr_line_offset < 0) indentation--;

// console.log({prev_line, prev_line_offset, indentation})
// console.log({ prev_line, prev_line_offset, indentation });
}

/*
Expand Down
Loading

0 comments on commit aa5adcb

Please sign in to comment.