Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Prepare for release #204

Merged
merged 6 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added spritec_gui/build/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions spritec_gui/components/Import/ImportCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ class ImportCanvas extends Component {

requestAnimationFrame(this.renderCanvas);
}

render() {
// Whenever something changes reset the animation
// TODO: implement proper media controls (play/pause) instead of this flag
this.state.step = -1;
}
}

module.exports = ImportCanvas;
9 changes: 6 additions & 3 deletions spritec_gui/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const { app, BrowserWindow } = require('electron')
const { app, Menu, BrowserWindow } = require('electron')

// Remove default menu
Menu.setApplicationMenu(null);

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
Expand All @@ -21,8 +24,8 @@ function createWindow () {
// and load the index.html of the app.
win.loadFile('main.html')

// Open the DevTools.
// win.webContents.openDevTools()
// Open the DevTools for developers
if (!app.isPackaged) win.webContents.openDevTools()

// Emitted when the window is closed.
win.on('closed', () => {
Expand Down
3 changes: 2 additions & 1 deletion spritec_gui/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ <h4>Export options</h4>
<div class="uk-margin">
<label class="uk-form-label" for="export-scale">Scale<b id="export-scale-text" class="uk-margin-small-left">1x</b></label>
<div class="uk-form-controls">
<input id="export-scale" class="uk-range" type="range" value="1" min="1" max="10" step="1">
<!-- TODO: set max based on max file size instead of max scale size -->
<input id="export-scale" class="uk-range" type="range" value="1" min="1" max="20" step="1">
</div>
</div>
<div id="export-switcher" class="uk-switcher uk-margin">
Expand Down
5 changes: 5 additions & 0 deletions spritec_gui/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ store.subscribe(() => {
}
});
});

// TODO: implement proper error handling in the app
// Loudly announce all errors. Reload the app so it's not left in a dead state.
window.onerror = (message) => {alert(message); location.reload();}
window.onunhandledrejection = ({reason}) => {alert(reason); location.reload();}
3 changes: 2 additions & 1 deletion spritec_gui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "spritec_gui",
"version": "0.1.0",
"description": "Electron app that uses spritec to convert 3D models into spritesheets.",
"description": "Convert 3D model into pixel art",
"main": "index.js",
"scripts": {
"build": "electron-build-env neon build -p ../spritec_binding --release",
Expand All @@ -15,6 +15,7 @@
},
"build": {
"appId": "com.protoart.spritec",
"productName": "Spritec",
"linux": {
"target": "AppImage"
}
Expand Down