From 49241e4512f1e31769d8945af83d657cb31098e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Brammer?= Date: Thu, 13 Jan 2011 01:16:30 +0100 Subject: [PATCH] editor/win32: Get id to reload on demand instead of every selection change --- src/editor/C4ConsoleGUICommon.h | 1 - src/editor/C4ConsoleWin32.cpp | 6 +++++- src/editor/C4PropertyDlg.cpp | 3 --- src/editor/C4PropertyDlg.h | 2 -- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/editor/C4ConsoleGUICommon.h b/src/editor/C4ConsoleGUICommon.h index 274020919..7327fb657 100644 --- a/src/editor/C4ConsoleGUICommon.h +++ b/src/editor/C4ConsoleGUICommon.h @@ -75,7 +75,6 @@ void C4PropertyDlg::Default() { state->Default(); Active = false; - //idSelectedDef=C4ID::None; } void C4PropertyDlg::Clear() diff --git a/src/editor/C4ConsoleWin32.cpp b/src/editor/C4ConsoleWin32.cpp index 5e367f9a4..c4f9f646b 100644 --- a/src/editor/C4ConsoleWin32.cpp +++ b/src/editor/C4ConsoleWin32.cpp @@ -579,8 +579,12 @@ INT_PTR CALLBACK PropertyDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lPar return true; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case IDC_BUTTONRELOADDEF: - Game.ReloadDef( Console.PropertyDlg.idSelectedDef ); + { + C4Object * pObj = Console.EditCursor.GetSelection().GetObject(); + if (pObj) + Game.ReloadDef(pObj->id); return true; + } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } return false; diff --git a/src/editor/C4PropertyDlg.cpp b/src/editor/C4PropertyDlg.cpp index b49f86ccd..b792c9165 100644 --- a/src/editor/C4PropertyDlg.cpp +++ b/src/editor/C4PropertyDlg.cpp @@ -52,9 +52,6 @@ void C4PropertyDlg::Update(C4ObjectList &rSelection) // Update info edit control Console.PropertyDlgUpdate(this, rSelection.GetDataString()); - // Store selected def - idSelectedDef=pObj->id; - // Update input control Console.PropertyDlgSetFunctions(this, pObj); } diff --git a/src/editor/C4PropertyDlg.h b/src/editor/C4PropertyDlg.h index 2e53a86de..db6d51a03 100644 --- a/src/editor/C4PropertyDlg.h +++ b/src/editor/C4PropertyDlg.h @@ -44,8 +44,6 @@ public: bool Open(); void Update(C4ObjectList &rSelection); bool Active; -public: // ToolsDlg fields are public as well... - C4ID idSelectedDef; }; #endif