Merge pull request #37 from pacocoursey/master

Add default file extension to allow for native duplicate warnings
This commit is contained in:
Лu Лinveгa 2018-07-08 12:21:58 +12:00 committed by GitHub
commit 2b30b92324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,7 +140,10 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y)
this.save = function(content = this.tool.export()) this.save = function(content = this.tool.export())
{ {
dialog.showSaveDialog({title:"Save to .grid"},(fileName) => { dialog.showSaveDialog({
title:"Save to .grid",
filters: [{name: "Dotgrid", extensions: ["grid", "dot"]}]
},(fileName) => {
if (fileName === undefined){ return; } if (fileName === undefined){ return; }
fileName = fileName.substr(-5,5) != ".grid" ? fileName+".grid" : fileName; fileName = fileName.substr(-5,5) != ".grid" ? fileName+".grid" : fileName;
fs.writeFileSync(fileName, content); fs.writeFileSync(fileName, content);