add default file extension to save dialog to allow for native duplicate file warning
This commit is contained in:
parent
f7f7fb2aea
commit
4a7c704587
@ -140,7 +140,10 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y)
|
||||
|
||||
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; }
|
||||
fileName = fileName.substr(-5,5) != ".grid" ? fileName+".grid" : fileName;
|
||||
fs.writeFileSync(fileName, content);
|
||||
|
Loading…
Reference in New Issue
Block a user