Skip to content
Draft
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
13 changes: 13 additions & 0 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const path = require('path');
const argv = require('optimist').argv;
const windowStateKeeper = require('electron-window-state');
const {app, BrowserWindow, ipcMain, Menu, shell} = require('electron');
const localShortcut = require('electron-localshortcut');
const {autoUpdater} = require("electron-updater");

let mainWindow;
Expand Down Expand Up @@ -40,6 +41,7 @@ function createWindow() {
});

mainWindowState.manage(mainWindow);
buildShortcuts();

mainWindow.on('page-title-updated', function(e) {
e.preventDefault();
Expand Down Expand Up @@ -275,6 +277,17 @@ function buildMenu() {
Menu.setApplicationMenu(menu);
}

function buildShortcuts() {
const shortcuts = {
'F12': () => mainWindow.webContents.toggleDevTools(),
'Ctrl+F11': () => mainWindow.webContents.reload()
};

Object.keys(shortcuts).forEach(key => {
localShortcut.register(mainWindow, key, shortcuts[key]);
});
}

function installCLI() {
shell.openExternal('https://github.com/odrick/free-tex-packer-cli');
}
Expand Down
1 change: 1 addition & 0 deletions electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"electron-log": "^2.2.17",
"electron-updater": "^4.0.6",
"electron-window-state": "^5.0.3",
"electron-localshortcut": "^3.2.1",
"optimist": "^0.6.1",
"tinify": "^1.3.0"
}
Expand Down
1 change: 1 addition & 0 deletions src/client/APP.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ class APP {

Downloader.run(files, this.packOptions.fileName, this.packOptions.savePath);
Observer.emit(GLOBAL_EVENT.HIDE_SHADER);
Observer.emit(GLOBAL_EVENT.SHOW_MESSAGE, I18.f("EXPORTER_SUCCESS"));
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/client/exporters/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import list from './list.json';
import appInfo from '../../../package.json';
import {GET} from '../utils/ajax';
import {strNumPairCompare} from '../utils/common';
import mustache from 'mustache';
import wax from '@jvitela/mustache-wax';
import { smartSortImages, removeFromArray } from '../utils/common';
Expand Down Expand Up @@ -123,8 +124,9 @@ function prepareData(data, options) {
rotated: item.rotated,
trimmed: trimmed
});

}

ret.sort((a, b) => strNumPairCompare(a.name, b.name));

return {rects: ret, config: opt};
}
Expand Down
4 changes: 4 additions & 0 deletions src/client/resources/static/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1031,3 +1031,7 @@ html, body {
margin: auto;
margin-right: 300px;
}

.texture-size {
font-size: 24px;
}
28 changes: 4 additions & 24 deletions src/client/resources/static/exporters/JsonArray.mst
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,11 @@
{{#rects}}
{
"filename": "{{{name}}}",
"frame": {
"x": {{frame.x}},
"y": {{frame.y}},
"w": {{frame.w}},
"h": {{frame.h}}
},
"frame": {"x":{{frame.x}},"y":{{frame.y}},"w":{{frame.w}},"h":{{frame.h}}},
"rotated": {{rotated}},
"trimmed": {{trimmed}},
"spriteSourceSize": {
"x": {{spriteSourceSize.x}},
"y": {{spriteSourceSize.y}},
"w": {{spriteSourceSize.w}},
"h": {{spriteSourceSize.h}}
},
"sourceSize": {
"w": {{sourceSize.w}},
"h": {{sourceSize.h}}
},
"pivot": {
"x": 0.5,
"y": 0.5
}
"spriteSourceSize": {"x":{{spriteSourceSize.x}},"y":{{spriteSourceSize.y}},"w":{{spriteSourceSize.w}},"h":{{spriteSourceSize.h}}},
"sourceSize": {"w":{{sourceSize.w}},"h":{{sourceSize.h}}}
}{{^last}},{{/last}}
{{/rects}}
],
Expand All @@ -33,10 +16,7 @@
"version": "{{appInfo.version}}",
"image": "{{^config.base64Export}}{{config.imageFile}}{{/config.base64Export}}{{#config.base64Export}}{{{config.base64Prefix}}}{{{config.imageData}}}{{/config.base64Export}}",
"format": "{{config.format}}",
"size": {
"w": {{config.imageWidth}},
"h": {{config.imageHeight}}
},
"size": {"w":{{config.imageWidth}},"h":{{config.imageHeight}}},
"scale": {{config.scale}}
}
}
28 changes: 4 additions & 24 deletions src/client/resources/static/exporters/JsonHash.mst
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,11 @@
"frames": {
{{#rects}}
"{{{name}}}": {
"frame": {
"x": {{frame.x}},
"y": {{frame.y}},
"w": {{frame.w}},
"h": {{frame.h}}
},
"frame": {"x":{{frame.x}},"y":{{frame.y}},"w":{{frame.w}},"h":{{frame.h}}},
"rotated": {{rotated}},
"trimmed": {{trimmed}},
"spriteSourceSize": {
"x": {{spriteSourceSize.x}},
"y": {{spriteSourceSize.y}},
"w": {{spriteSourceSize.w}},
"h": {{spriteSourceSize.h}}
},
"sourceSize": {
"w": {{sourceSize.w}},
"h": {{sourceSize.h}}
},
"pivot": {
"x": 0.5,
"y": 0.5
}
"spriteSourceSize": {"x":{{spriteSourceSize.x}},"y":{{spriteSourceSize.y}},"w":{{spriteSourceSize.w}},"h":{{spriteSourceSize.h}}},
"sourceSize": {"w":{{sourceSize.w}},"h":{{sourceSize.h}}}
}{{^last}},{{/last}}
{{/rects}}
},
Expand All @@ -32,10 +15,7 @@
"version": "{{appInfo.version}}",
"image": "{{^config.base64Export}}{{config.imageFile}}{{/config.base64Export}}{{#config.base64Export}}{{{config.base64Prefix}}}{{{config.imageData}}}{{/config.base64Export}}",
"format": "{{config.format}}",
"size": {
"w": {{config.imageWidth}},
"h": {{config.imageHeight}}
},
"size": {"w":{{config.imageWidth}},"h":{{config.imageHeight}}},
"scale": {{config.scale}}
}
}
4 changes: 3 additions & 1 deletion src/client/resources/static/localization/de.csv
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ REPLACE_FILES_PROMPT;Bestehende Dateien ersetzen?
DISPLAY_OUTLINES;Umriss:
DISABLE_SMOOTHING;Glättung deaktivieren
DISABLE_SMOOTHING_TITLE;Deaktivieren Sie die Bildglättung
SCALE;Skalierung:
SHOW_SPRITES;Animationen
SPRITE_NAME;Sprite-Name:
ANIMATION_SPEED;Animationsgeschwindigkeit:
Expand All @@ -38,6 +37,8 @@ TINIFY;Tinify
TINIFY_TITLE;Tinify mithilfe von https://tinypng.com
TINIFY_KEY;TinyPNG Schlüssel
TINIFY_KEY_TITLE;TinyPNG Schlüssel https://tinypng.com/developers
SCALE_NUM;Skalierung
SCALE;Skalierung:
SCALE_TITLE;Basistextur Skalierung
FILTER;Filter:
FILTER_TITLE;Filter für die Ausgabedatei
Expand Down Expand Up @@ -87,6 +88,7 @@ TINIFY_ERROR;Tinify Error: %s
TINIFY_ERROR_COMMON;Tinify Error...
OLD_BROWSER_MESSAGE1;Ihr Browser ist für diese App leider zu alt...
OLD_BROWSER_MESSAGE2;Bitte benutzen Sie einen der folgenden Browser:
EXPORTER_SUCCESS;Erfolgreicher Export
EXPORTER_ERROR;Export Error: %s
CUSTOM_EXPORTER_ERROR;Template Error: %s
ABOUT_HOMEPAGE;Startseite:
Expand Down
Loading