From 3ca0b615aa655fad5e611039a43890c07eb191c0 Mon Sep 17 00:00:00 2001 From: codeimp Date: Wed, 19 Aug 2009 13:14:55 +0000 Subject: [PATCH] - Things browser no longer closes when double-clicked on a category - Find & Replace mode now changes render presentation to show Things on-top when a Things search is performed --- Source/Core/Controls/ThingBrowserControl.cs | 9 +++++++-- .../Plugins/BuilderModes/FindReplace/FindReplaceType.cs | 1 + .../Plugins/BuilderModes/FindReplace/FindThingAction.cs | 2 ++ .../Plugins/BuilderModes/FindReplace/FindThingNumber.cs | 2 ++ .../BuilderModes/FindReplace/FindThingSectorRef.cs | 2 ++ Source/Plugins/BuilderModes/FindReplace/FindThingTag.cs | 2 ++ .../BuilderModes/FindReplace/FindThingThingRef.cs | 2 ++ Source/Plugins/BuilderModes/FindReplace/FindThingType.cs | 2 ++ Source/Plugins/BuilderModes/Interface/FindReplaceForm.cs | 3 +++ 9 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Source/Core/Controls/ThingBrowserControl.cs b/Source/Core/Controls/ThingBrowserControl.cs index f545f4d1..fea8b830 100644 --- a/Source/Core/Controls/ThingBrowserControl.cs +++ b/Source/Core/Controls/ThingBrowserControl.cs @@ -148,9 +148,14 @@ namespace CodeImp.DoomBuilder.Controls // List double-clicked private void typelist_DoubleClick(object sender, EventArgs e) { - if((typelist.SelectedNode != null) && (typeid.Text.Length > 0)) + if(typelist.SelectedNode != null) { - if(OnTypeDoubleClicked != null) OnTypeDoubleClicked(); + // Node is a child node? + TreeNode n = typelist.SelectedNode; + if((n.Nodes.Count == 0) && (n.Tag != null) && (n.Tag is ThingTypeInfo)) + { + if((OnTypeDoubleClicked != null) && (typeid.Text.Length > 0)) OnTypeDoubleClicked(); + } } } diff --git a/Source/Plugins/BuilderModes/FindReplace/FindReplaceType.cs b/Source/Plugins/BuilderModes/FindReplace/FindReplaceType.cs index f7360ca3..3b0e89cf 100644 --- a/Source/Plugins/BuilderModes/FindReplace/FindReplaceType.cs +++ b/Source/Plugins/BuilderModes/FindReplace/FindReplaceType.cs @@ -52,6 +52,7 @@ namespace CodeImp.DoomBuilder.BuilderModes public FindReplaceAttribute Attributes { get { return attribs; } } public bool AllowDelete { get { return false; } } + public virtual Presentation RenderPresentation { get { return Presentation.Standard; } } #endregion diff --git a/Source/Plugins/BuilderModes/FindReplace/FindThingAction.cs b/Source/Plugins/BuilderModes/FindReplace/FindThingAction.cs index e7369b8e..fcc6f1ec 100644 --- a/Source/Plugins/BuilderModes/FindReplace/FindThingAction.cs +++ b/Source/Plugins/BuilderModes/FindReplace/FindThingAction.cs @@ -50,6 +50,8 @@ namespace CodeImp.DoomBuilder.BuilderModes #region ================== Properties + public override Presentation RenderPresentation { get { return Presentation.Things; } } + #endregion #region ================== Constructor / Destructor diff --git a/Source/Plugins/BuilderModes/FindReplace/FindThingNumber.cs b/Source/Plugins/BuilderModes/FindReplace/FindThingNumber.cs index d1e12e98..1e000a97 100644 --- a/Source/Plugins/BuilderModes/FindReplace/FindThingNumber.cs +++ b/Source/Plugins/BuilderModes/FindReplace/FindThingNumber.cs @@ -50,6 +50,8 @@ namespace CodeImp.DoomBuilder.BuilderModes #region ================== Properties + public override Presentation RenderPresentation { get { return Presentation.Things; } } + #endregion #region ================== Constructor / Destructor diff --git a/Source/Plugins/BuilderModes/FindReplace/FindThingSectorRef.cs b/Source/Plugins/BuilderModes/FindReplace/FindThingSectorRef.cs index 3380fed1..d350d8f7 100644 --- a/Source/Plugins/BuilderModes/FindReplace/FindThingSectorRef.cs +++ b/Source/Plugins/BuilderModes/FindReplace/FindThingSectorRef.cs @@ -51,6 +51,8 @@ namespace CodeImp.DoomBuilder.BuilderModes #region ================== Properties + public override Presentation RenderPresentation { get { return Presentation.Things; } } + #endregion #region ================== Constructor / Destructor diff --git a/Source/Plugins/BuilderModes/FindReplace/FindThingTag.cs b/Source/Plugins/BuilderModes/FindReplace/FindThingTag.cs index b57410e0..97b10a2c 100644 --- a/Source/Plugins/BuilderModes/FindReplace/FindThingTag.cs +++ b/Source/Plugins/BuilderModes/FindReplace/FindThingTag.cs @@ -50,6 +50,8 @@ namespace CodeImp.DoomBuilder.BuilderModes #region ================== Properties + public override Presentation RenderPresentation { get { return Presentation.Things; } } + #endregion #region ================== Constructor / Destructor diff --git a/Source/Plugins/BuilderModes/FindReplace/FindThingThingRef.cs b/Source/Plugins/BuilderModes/FindReplace/FindThingThingRef.cs index 63f9e8ff..0e5f69a3 100644 --- a/Source/Plugins/BuilderModes/FindReplace/FindThingThingRef.cs +++ b/Source/Plugins/BuilderModes/FindReplace/FindThingThingRef.cs @@ -51,6 +51,8 @@ namespace CodeImp.DoomBuilder.BuilderModes #region ================== Properties + public override Presentation RenderPresentation { get { return Presentation.Things; } } + #endregion #region ================== Constructor / Destructor diff --git a/Source/Plugins/BuilderModes/FindReplace/FindThingType.cs b/Source/Plugins/BuilderModes/FindReplace/FindThingType.cs index 48a0b3bc..3902634a 100644 --- a/Source/Plugins/BuilderModes/FindReplace/FindThingType.cs +++ b/Source/Plugins/BuilderModes/FindReplace/FindThingType.cs @@ -50,6 +50,8 @@ namespace CodeImp.DoomBuilder.BuilderModes #region ================== Properties + public override Presentation RenderPresentation { get { return Presentation.Things; } } + #endregion #region ================== Constructor / Destructor diff --git a/Source/Plugins/BuilderModes/Interface/FindReplaceForm.cs b/Source/Plugins/BuilderModes/Interface/FindReplaceForm.cs index 5cad2443..2a76d53e 100644 --- a/Source/Plugins/BuilderModes/Interface/FindReplaceForm.cs +++ b/Source/Plugins/BuilderModes/Interface/FindReplaceForm.cs @@ -203,6 +203,9 @@ namespace CodeImp.DoomBuilder.BuilderModes editbutton.Enabled = (resultslist.SelectedIndex > -1); deletebutton.Enabled = (resultslist.SelectedIndex > -1); + // Set correct presentation mode + General.Map.Renderer2D.SetPresentation(finder.RenderPresentation); + // Redraw the screen, this will show the selection General.Interface.RedrawDisplay(); }