Browse Source

Capitalization fix, added AddButtonLeft function, prevent opening new dialog.

rsredsq 10 years ago
parent
commit
a0f417454b

+ 1 - 1
Resources/EditorData/AtomicEditor/resources/language/lng_en.tb.txt

@@ -14,4 +14,4 @@ new New
 save Save
 save Save
 close Close
 close Close
 search Search
 search Search
-dont_save Don't save
+dont_save Don't Save

+ 1 - 0
Script/AtomicEditor/editor/Editor.ts

@@ -160,6 +160,7 @@ class Editor extends Atomic.ScriptObject {
 
 
     // event handling
     // event handling
     handleExitRequested(data) {
     handleExitRequested(data) {
+        if (this.exitRequested) return;
         this.sendEvent("IPCPlayerExitRequest");
         this.sendEvent("IPCPlayerExitRequest");
         this.exitRequested = true;
         this.exitRequested = true;
         this.closeAllResourceEditors();
         this.closeAllResourceEditors();

+ 1 - 2
Source/AtomicEditor/Editors/ResourceEditor.cpp

@@ -47,8 +47,7 @@ public:
             settings.styling = true;
             settings.styling = true;
             String windowString = Atomic::ToString("%s has unsaved modifications.\nDo you wish to discard them and close?", GetFileNameAndExtension(editor_->GetFullPath()).CString());
             String windowString = Atomic::ToString("%s has unsaved modifications.\nDo you wish to discard them and close?", GetFileNameAndExtension(editor_->GetFullPath()).CString());
             msg_win->Show("Unsaved Modifications",  windowString.CString(), &settings, 640, 360);
             msg_win->Show("Unsaved Modifications",  windowString.CString(), &settings, 640, 360);
-            TBButton *btn = new TBButton();
-            msg_win->AddButton("dont_save", false, msg_win->GetWidgetByIDAndType<TBLayout>(5));
+            msg_win->AddButtonLeft("dont_save", false);
             msg_win->AddButton("TBMessageWindow.cancel", false);
             msg_win->AddButton("TBMessageWindow.cancel", false);
             msg_win->AddButton("save", true);
             msg_win->AddButton("save", true);
             return false;
             return false;

+ 5 - 0
Source/ThirdParty/TurboBadger/tb_message_window.cpp

@@ -116,6 +116,11 @@ bool TBMessageWindow::Show(const char *title, const char *message, TBMessageWind
 	return true;
 	return true;
 }
 }
 
 
+void TBMessageWindow::AddButtonLeft(TBID id, bool focused)
+{
+    AddButton(id, focused, GetWidgetByIDAndType<TBLayout>(5));
+}
+
 void TBMessageWindow::AddButton(TBID id, bool focused, TBLayout *layout)
 void TBMessageWindow::AddButton(TBID id, bool focused, TBLayout *layout)
 {
 {
     if (!layout) 
     if (!layout) 

+ 3 - 1
Source/ThirdParty/TurboBadger/tb_message_window.h

@@ -56,7 +56,9 @@ public:
 	virtual bool OnEvent(const TBWidgetEvent &ev);
 	virtual bool OnEvent(const TBWidgetEvent &ev);
 	virtual void OnDie();
 	virtual void OnDie();
 
 
-    void AddButton(TBID id, bool focused, TBLayout *layout = NULL);
+    void AddButton(TBID id, bool focused, TBLayout *layout = nullptr);
+    void AddButtonLeft(TBID id, bool focused);
+
 private:
 private:
 	// TBWidgetListener
 	// TBWidgetListener
 	virtual void OnWidgetDelete(TBWidget *widget);
 	virtual void OnWidgetDelete(TBWidget *widget);