|
|
@@ -23,34 +23,21 @@ class Shortcuts extends Atomic.ScriptObject {
|
|
|
}
|
|
|
|
|
|
//this should be moved somewhere else...
|
|
|
- invokePlay() {
|
|
|
-
|
|
|
- this.sendEvent(EditorEvents.SaveAllResources);
|
|
|
-
|
|
|
- var playerWindow = Preferences.getInstance().playerWindow;
|
|
|
- if (playerWindow) {
|
|
|
- var args = "--windowposx " + playerWindow.x + " --windowposy " + playerWindow.y + " --windowwidth " + playerWindow.width + " --windowheight " + playerWindow.height + " --resizable";
|
|
|
- Atomic.editorMode.playProject(args, false);
|
|
|
- } else {
|
|
|
- Atomic.editorMode.playProject("", false);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- invokePlayDebug() {
|
|
|
-
|
|
|
+ invokePlayOrStopPlayer(debug:boolean = false) {
|
|
|
this.sendEvent(EditorEvents.SaveAllResources);
|
|
|
-
|
|
|
- var playerWindow = Preferences.getInstance().playerWindow;
|
|
|
- if (playerWindow) {
|
|
|
- var args = "--windowposx " + playerWindow.x + " --windowposy " + playerWindow.y + " --windowwidth " + playerWindow.width + " --windowheight " + playerWindow.height + " --resizable";
|
|
|
- Atomic.editorMode.playProject(args, true);
|
|
|
+ if (Atomic.editorMode.isPlayerEnabled()) {
|
|
|
+ this.sendEvent("IPCPlayerExitRequest");
|
|
|
} else {
|
|
|
- Atomic.editorMode.playProject("", true);
|
|
|
+ var playerWindow = Preferences.getInstance().playerWindow;
|
|
|
+ if (playerWindow) {
|
|
|
+ var args = "--windowposx " + playerWindow.x + " --windowposy " + playerWindow.y + " --windowwidth " + playerWindow.width + " --windowheight " + playerWindow.height + " --resizable";
|
|
|
+ Atomic.editorMode.playProject(args, debug);
|
|
|
+ } else {
|
|
|
+ Atomic.editorMode.playProject("", debug);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-
|
|
|
invokeFormatCode() {
|
|
|
|
|
|
var editor = EditorUI.getMainFrame().resourceframe.currentResourceEditor;
|
|
|
@@ -158,7 +145,7 @@ class Shortcuts extends Atomic.ScriptObject {
|
|
|
this.invokeFormatCode();
|
|
|
}
|
|
|
else if (ev.key == Atomic.KEY_P) {
|
|
|
- this.invokePlay();
|
|
|
+ this.invokePlayOrStopPlayer();
|
|
|
//if shift is pressed
|
|
|
} else if (ev.qualifiers & Atomic.QUAL_SHIFT) {
|
|
|
if (ev.key == Atomic.KEY_B) {
|