diff --git a/sources/scripts/core/keyboard.js b/sources/scripts/core/keyboard.js index eb3c1be..3e2c38b 100644 --- a/sources/scripts/core/keyboard.js +++ b/sources/scripts/core/keyboard.js @@ -55,33 +55,6 @@ function Keyboard() return; } - if((e.key == "n" || e.key == "Backspace") && (e.ctrlKey || e.metaKey)){ - e.preventDefault(); - ronin.guide.inspect = false; - ronin.guide.clear(); - ronin.cursor.target.clear(); - } - - if(e.key == "N" && (e.ctrlKey || e.metaKey) && e.shiftKey){ - e.preventDefault(); - ronin.guide.inspect = false; - ronin.guide.clear(); - ronin.layers.above.clear() - ronin.layers.below.clear() - } - - // Open - if(e.key == "o" && (e.ctrlKey || e.metaKey)){ - e.preventDefault(); - ronin.io.methods.load.run(); - } - - // Save - if(e.key == "s" && (e.ctrlKey || e.metaKey)){ - e.preventDefault(); - ronin.io.methods.save.run(); - } - ronin.hint.update(e); } } \ No newline at end of file diff --git a/sources/scripts/modules/frame.js b/sources/scripts/modules/frame.js index c98b60b..c54bf9a 100644 --- a/sources/scripts/modules/frame.js +++ b/sources/scripts/modules/frame.js @@ -9,6 +9,12 @@ function Frame() ronin.el.appendChild(this.el); } + this.methods.new = new Method("new","WxH","New Canvas",function(q){ + ronin.layers.above.clear(); + ronin.layers.below.clear(); + ronin.frame.resize_to({width:930,height:540}); + }); + this.width = 400; this.height = 400; this.zoom = {scale:1,offset:{x:0,y:0}}; diff --git a/sources/scripts/ronin.js b/sources/scripts/ronin.js index 7799c8e..e423a73 100644 --- a/sources/scripts/ronin.js +++ b/sources/scripts/ronin.js @@ -72,11 +72,10 @@ function Ronin() this.controller.add("default","*","Reset",() => { ronin.reset(); },"CmdOrCtrl+Backspace"); this.controller.add("default","*","Quit",() => { app.exit(); },"CmdOrCtrl+Q"); - this.controller.add("default","File","New",() => { ronin.new(); },"CmdOrCtrl+N"); - this.controller.add("default","File","Open",() => { ronin.open(); },"CmdOrCtrl+O"); - this.controller.add("default","File","Save",() => { ronin.save(); },"CmdOrCtrl+S"); - - this.controller.add("default","I/O","Import Image",() => { ronin.io.methods.load.run(); },"CmdOrCtrl+I"); + this.controller.add("default","File","New Image",() => { ronin.frame.methods.new.run(); },"CmdOrCtrl+N"); + this.controller.add("default","File","Open Image",() => { ronin.io.methods.open.run(); },"CmdOrCtrl+O"); + this.controller.add("default","File","Import Image",() => { ronin.io.methods.load.run(); },"CmdOrCtrl+I"); + this.controller.add("default","File","Export Image",() => { ronin.io.methods.save.run(); },"CmdOrCtrl+R"); this.controller.add("default","Layers","Above Layer",() => { ronin.cursor.select_layer(ronin.layers.above); },"c"); this.controller.add("default","Layers","Below Layer",() => { ronin.cursor.select_layer(ronin.layers.below); },"z");