瀏覽代碼

Fix crash. Fix when window position hasn't been saved if stop button used

rsredsq 10 年之前
父節點
當前提交
ecf2826418

+ 1 - 1
Script/AtomicEditor/ui/MainToolbar.ts

@@ -36,7 +36,7 @@ class MainToolbar extends Atomic.UIWidget {
         this.subscribeToEvent("GizmoAxisModeChanged", (ev) => this.handleGizmoAxisModeChanged(ev));
         this.subscribeToEvent("GizmoEditModeChanged", (ev) => this.handleGizmoEditModeChanged(ev));
         this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
-        this.subscribeToEvent("IPCPlayerExitRequest", (data) => {
+        this.subscribeToEvent("IPCPlayerQuit", (data) => {
             var skin = <Atomic.UISkinImage> this.playButton.getWidget("skin_image");
             skin.setSkinBg("PlayButton");
         });

+ 3 - 1
Source/AtomicEditor/EditorMode/AEEditorMode.cpp

@@ -11,6 +11,8 @@
 #include <Atomic/IPC/IPCEvents.h>
 #include <Atomic/IPC/IPCBroker.h>
 
+#include <Atomic/Input/InputEvents.h>
+
 #include <ToolCore/ToolEnvironment.h>
 #include <ToolCore/ToolSystem.h>
 #include <ToolCore/License/LicenseSystem.h>
@@ -158,7 +160,7 @@ void EditorMode::HandleIPCPlayerExitRequest(StringHash eventType, VariantMap& ev
 {
     if (!playerBroker_) return;
     VariantMap noEventData;
-    playerBroker_->PostMessage(E_IPCPLAYERQUIT, noEventData);
+    playerBroker_->PostMessage(E_EXITREQUESTED, noEventData);
 }
 
 bool EditorMode::IsPlayerEnabled()

+ 2 - 1
Source/AtomicEditor/PlayerMode/AEPlayerMode.cpp

@@ -249,7 +249,8 @@ void PlayerMode::HandleExitRequest(StringHash eventType, VariantMap& eventData)
     data[P_WIDTH] = graphics->GetWidth();
     data[P_HEIGHT] = graphics->GetHeight();
     ipc_->SendEventToBroker(E_IPCPLAYERWINDOW, data);
-    ipc_->SendEventToBroker(E_IPCPLAYEREXITREQUEST);
+    ipc_->SendEventToBroker(E_IPCPLAYERQUIT);
+    SendEvent(E_IPCPLAYERQUIT);
 }
 
 }