From 720dbabae1d20c6b33b71d4f86e32ed214ed0b33 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Wed, 18 Jan 2023 18:42:21 -0600 Subject: [PATCH 01/10] Fix rename popup from not focusing and selecting text. --- Source/Editor/GUI/Popups/RenamePopup.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Editor/GUI/Popups/RenamePopup.cs b/Source/Editor/GUI/Popups/RenamePopup.cs index db9b2a5f3..dca68f923 100644 --- a/Source/Editor/GUI/Popups/RenamePopup.cs +++ b/Source/Editor/GUI/Popups/RenamePopup.cs @@ -172,6 +172,7 @@ namespace FlaxEditor.GUI /// protected override void OnShow() { + _inputField.EndEditOnClick = false; // Ending edit is handled through popup _inputField.Focus(); _inputField.SelectAll(); From a91990138bafd971479a935dda551bddb0fe5825 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Sat, 21 Jan 2023 10:32:37 -0600 Subject: [PATCH 02/10] Added arrow as default to groups --- Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs | 2 +- .../CustomEditors/Elements/Container/GroupElement.cs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs index c7f62bd57..ab13cf157 100644 --- a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs @@ -642,7 +642,7 @@ namespace FlaxEditor.CustomEditors.Dedicated Checked = script.Enabled, Parent = group.Panel, Size = new Float2(14, 14), - Bounds = new Rectangle(2, 0, 14, 14), + Bounds = new Rectangle(16, 0, 14, 14), BoxSize = 12.0f, Tag = script, }; diff --git a/Source/Editor/CustomEditors/Elements/Container/GroupElement.cs b/Source/Editor/CustomEditors/Elements/Container/GroupElement.cs index 674b41d4f..a26fa3b0d 100644 --- a/Source/Editor/CustomEditors/Elements/Container/GroupElement.cs +++ b/Source/Editor/CustomEditors/Elements/Container/GroupElement.cs @@ -13,7 +13,12 @@ namespace FlaxEditor.CustomEditors.Elements /// /// The drop panel. /// - public readonly DropPanel Panel = new DropPanel(); + public readonly DropPanel Panel = new DropPanel + { + ArrowImageClosed = new SpriteBrush(Style.Current.ArrowRight), + ArrowImageOpened = new SpriteBrush(Style.Current.ArrowDown), + EnableDropDownIcon = true, + }; /// public override ContainerControl ContainerControl => Panel; From 634eb0973b16fb62914da9540c21cc0ecfccf1ab Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Sat, 21 Jan 2023 11:37:31 -0600 Subject: [PATCH 03/10] fix header text position --- Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs index ab13cf157..5e8b44f3c 100644 --- a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs @@ -681,7 +681,7 @@ namespace FlaxEditor.CustomEditors.Dedicated }; settingsButton.Clicked += OnSettingsButtonClicked; - group.Panel.HeaderTextMargin = new Margin(scriptDrag.Right, 15, 2, 2); + group.Panel.HeaderTextMargin = new Margin(scriptDrag.Right - 12, 15, 2, 2); group.Object(values, editor); // Scripts arrange bar From 66fd5e716c2b3408cf54cd62339bf053a523553b Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Sat, 21 Jan 2023 13:35:51 -0600 Subject: [PATCH 04/10] various fixes and improvements. size changes for headers, deactivate containement for collections. --- .../CustomEditors/Dedicated/ActorEditor.cs | 2 +- .../CustomEditors/Dedicated/ScriptsEditor.cs | 10 +++++----- .../Elements/Container/GroupElement.cs | 3 +++ .../CustomEditors/LayoutElementsContainer.cs | 1 + Source/Engine/UI/GUI/Panels/DropPanel.cs | 16 ++++++++++++++++ 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs index 792d3ae4d..7f217917b 100644 --- a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs @@ -94,7 +94,7 @@ namespace FlaxEditor.CustomEditors.Dedicated { if (actor != null) group.Panel.TooltipText = Surface.SurfaceUtils.GetVisualScriptTypeDescription(TypeUtils.GetObjectType(actor)); - const float settingsButtonSize = 14; + const float settingsButtonSize = 20; var settingsButton = new Image { TooltipText = "Settings", diff --git a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs index 5e8b44f3c..a02b84617 100644 --- a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs @@ -641,16 +641,16 @@ namespace FlaxEditor.CustomEditors.Dedicated IsScrollable = false, Checked = script.Enabled, Parent = group.Panel, - Size = new Float2(14, 14), - Bounds = new Rectangle(16, 0, 14, 14), - BoxSize = 12.0f, + Size = new Float2(20, 20), + Bounds = new Rectangle(20, 0, 20, 20), + BoxSize = 16.0f, Tag = script, }; scriptToggle.StateChanged += OnScriptToggleCheckChanged; _scriptToggles[i] = scriptToggle; // Add drag button to the group - const float dragIconSize = 14; + const float dragIconSize = 20; var scriptDrag = new ScriptDragIcon(this, script) { TooltipText = "Script reference", @@ -665,7 +665,7 @@ namespace FlaxEditor.CustomEditors.Dedicated }; // Add settings button to the group - const float settingsButtonSize = 14; + const float settingsButtonSize = 20; var settingsButton = new Image { TooltipText = "Settings", diff --git a/Source/Editor/CustomEditors/Elements/Container/GroupElement.cs b/Source/Editor/CustomEditors/Elements/Container/GroupElement.cs index a26fa3b0d..676dd99ae 100644 --- a/Source/Editor/CustomEditors/Elements/Container/GroupElement.cs +++ b/Source/Editor/CustomEditors/Elements/Container/GroupElement.cs @@ -18,6 +18,9 @@ namespace FlaxEditor.CustomEditors.Elements ArrowImageClosed = new SpriteBrush(Style.Current.ArrowRight), ArrowImageOpened = new SpriteBrush(Style.Current.ArrowDown), EnableDropDownIcon = true, + ItemsMargin = new Margin(7, 7, 3, 3), + HeaderHeight = 20, + EnableContainmentLines = true, }; /// diff --git a/Source/Editor/CustomEditors/LayoutElementsContainer.cs b/Source/Editor/CustomEditors/LayoutElementsContainer.cs index 4829d11fa..936851b15 100644 --- a/Source/Editor/CustomEditors/LayoutElementsContainer.cs +++ b/Source/Editor/CustomEditors/LayoutElementsContainer.cs @@ -96,6 +96,7 @@ namespace FlaxEditor.CustomEditors if (useTransparentHeader) { element.Panel.EnableDropDownIcon = true; + element.Panel.EnableContainmentLines = false; element.Panel.HeaderColor = element.Panel.HeaderColorMouseOver = Color.Transparent; } OnAddElement(element); diff --git a/Source/Engine/UI/GUI/Panels/DropPanel.cs b/Source/Engine/UI/GUI/Panels/DropPanel.cs index 482460d04..409209549 100644 --- a/Source/Engine/UI/GUI/Panels/DropPanel.cs +++ b/Source/Engine/UI/GUI/Panels/DropPanel.cs @@ -131,6 +131,12 @@ namespace FlaxEngine.GUI [EditorDisplay("Style"), EditorOrder(2000)] public bool EnableDropDownIcon { get; set; } + /// + /// Gets or sets a value indicating whether to enable containment line drawing, + /// + [EditorDisplay("Style"), EditorOrder(2000)] + public bool EnableContainmentLines { get; set; } = false; + /// /// Occurs when mouse right-clicks over the header. /// @@ -370,6 +376,16 @@ namespace FlaxEngine.GUI Render2D.DrawText(HeaderTextFont.GetFont(), HeaderTextMaterial, HeaderText, textRect, textColor, TextAlignment.Near, TextAlignment.Center); + + if (!_isClosed && EnableContainmentLines) + { + Color lineColor = Style.Current.ForegroundGrey - new Color(0, 0, 0, 100); + float lineThickness = 0.05f; + Render2D.DrawLine(new Float2(1, HeaderHeight), new Float2(1, Height), lineColor, lineThickness); + Render2D.DrawLine(new Float2(1, Height), new Float2(Width, Height), lineColor, lineThickness); + Render2D.DrawLine(new Float2(Width, HeaderHeight), new Float2(Width, Height), lineColor, lineThickness); + } + // Children DrawChildren(); } From e21c8e5fe9bec33d1737d255c6709d2d12eca2b5 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Sun, 22 Jan 2023 18:52:28 -0600 Subject: [PATCH 05/10] Organize physics actors a little better in CM, added wheeled vehicle to list. minor change in CM to not add actors that have a parent with the attribute (more selective). --- Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs | 4 ++-- Source/Engine/Physics/Actors/WheeledVehicle.h | 2 +- Source/Engine/Physics/Colliders/BoxCollider.h | 2 +- Source/Engine/Physics/Colliders/CapsuleCollider.h | 2 +- Source/Engine/Physics/Colliders/MeshCollider.h | 2 +- Source/Engine/Physics/Colliders/SphereCollider.h | 2 +- Source/Engine/Physics/Joints/D6Joint.h | 2 +- Source/Engine/Physics/Joints/DistanceJoint.h | 2 +- Source/Engine/Physics/Joints/FixedJoint.h | 2 +- Source/Engine/Physics/Joints/HingeJoint.h | 2 +- Source/Engine/Physics/Joints/SliderJoint.h | 2 +- Source/Engine/Physics/Joints/SphericalJoint.h | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs b/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs index 3a7336bbb..75f31bfd6 100644 --- a/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs +++ b/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs @@ -152,11 +152,11 @@ namespace FlaxEditor.Windows // go through each actor and add it to the context menu if it has the ActorContextMenu attribute foreach (var actorType in Editor.CodeEditing.Actors.Get()) { - if (actorType.IsAbstract || !actorType.HasAttribute(typeof(ActorContextMenuAttribute), true)) + if (actorType.IsAbstract || !actorType.HasAttribute(typeof(ActorContextMenuAttribute), false)) continue; ActorContextMenuAttribute attribute = null; - foreach (var actorAttribute in actorType.GetAttributes(true)) + foreach (var actorAttribute in actorType.GetAttributes(false)) { if (actorAttribute is ActorContextMenuAttribute actorContextMenuAttribute) { diff --git a/Source/Engine/Physics/Actors/WheeledVehicle.h b/Source/Engine/Physics/Actors/WheeledVehicle.h index 2cc43bdd7..7e046d1a2 100644 --- a/Source/Engine/Physics/Actors/WheeledVehicle.h +++ b/Source/Engine/Physics/Actors/WheeledVehicle.h @@ -10,7 +10,7 @@ /// Representation of the car vehicle that uses wheels. Built on top of the RigidBody with collider representing its chassis shape and wheels. /// /// -API_CLASS() class FLAXENGINE_API WheeledVehicle : public RigidBody +API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Wheeled Vehicle\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API WheeledVehicle : public RigidBody { friend class PhysicsBackend; DECLARE_SCENE_OBJECT(WheeledVehicle); diff --git a/Source/Engine/Physics/Colliders/BoxCollider.h b/Source/Engine/Physics/Colliders/BoxCollider.h index c69a3ee56..c4ee6c2b5 100644 --- a/Source/Engine/Physics/Colliders/BoxCollider.h +++ b/Source/Engine/Physics/Colliders/BoxCollider.h @@ -9,7 +9,7 @@ /// A box-shaped primitive collider. /// /// -API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Box Collider\"), ActorToolbox(\"Physics\")") +API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Colliders/Box Collider\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API BoxCollider : public Collider { DECLARE_SCENE_OBJECT(BoxCollider); diff --git a/Source/Engine/Physics/Colliders/CapsuleCollider.h b/Source/Engine/Physics/Colliders/CapsuleCollider.h index 2f31e0d3b..5ae53cf53 100644 --- a/Source/Engine/Physics/Colliders/CapsuleCollider.h +++ b/Source/Engine/Physics/Colliders/CapsuleCollider.h @@ -10,7 +10,7 @@ /// /// Capsules are cylinders with a half-sphere at each end centered at the origin and extending along the X axis, and two hemispherical ends. /// -API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Capsule Collider\"), ActorToolbox(\"Physics\")") +API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Colliders/Capsule Collider\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API CapsuleCollider : public Collider { DECLARE_SCENE_OBJECT(CapsuleCollider); diff --git a/Source/Engine/Physics/Colliders/MeshCollider.h b/Source/Engine/Physics/Colliders/MeshCollider.h index f64dd6dd3..a25f4d9c8 100644 --- a/Source/Engine/Physics/Colliders/MeshCollider.h +++ b/Source/Engine/Physics/Colliders/MeshCollider.h @@ -10,7 +10,7 @@ /// A collider represented by an arbitrary mesh. /// /// -API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Mesh Collider\"), ActorToolbox(\"Physics\")") +API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Colliders/Mesh Collider\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API MeshCollider : public Collider { DECLARE_SCENE_OBJECT(MeshCollider); diff --git a/Source/Engine/Physics/Colliders/SphereCollider.h b/Source/Engine/Physics/Colliders/SphereCollider.h index a40d22704..39f6fd63c 100644 --- a/Source/Engine/Physics/Colliders/SphereCollider.h +++ b/Source/Engine/Physics/Colliders/SphereCollider.h @@ -8,7 +8,7 @@ /// A sphere-shaped primitive collider. /// /// -API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Sphere Collider\"), ActorToolbox(\"Physics\")") +API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Colliders/Sphere Collider\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API SphereCollider : public Collider { DECLARE_SCENE_OBJECT(SphereCollider); diff --git a/Source/Engine/Physics/Joints/D6Joint.h b/Source/Engine/Physics/Joints/D6Joint.h index d6f208b33..cd7e194f0 100644 --- a/Source/Engine/Physics/Joints/D6Joint.h +++ b/Source/Engine/Physics/Joints/D6Joint.h @@ -160,7 +160,7 @@ public: /// It also allows you to constrain limits to only specific axes or completely lock specific axes. /// /// -API_CLASS(Attributes="ActorContextMenu(\"New/Physics/D6 Joint\"), ActorToolbox(\"Physics\")") +API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Joints/D6 Joint\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API D6Joint : public Joint { DECLARE_SCENE_OBJECT(D6Joint); diff --git a/Source/Engine/Physics/Joints/DistanceJoint.h b/Source/Engine/Physics/Joints/DistanceJoint.h index 7ff522a03..96ddc9538 100644 --- a/Source/Engine/Physics/Joints/DistanceJoint.h +++ b/Source/Engine/Physics/Joints/DistanceJoint.h @@ -37,7 +37,7 @@ DECLARE_ENUM_OPERATORS(DistanceJointFlag); /// Physics joint that maintains an upper or lower (or both) bound on the distance between two bodies. /// /// -API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Distance Joint\"), ActorToolbox(\"Physics\")") +API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Joints/Distance Joint\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API DistanceJoint : public Joint { DECLARE_SCENE_OBJECT(DistanceJoint); diff --git a/Source/Engine/Physics/Joints/FixedJoint.h b/Source/Engine/Physics/Joints/FixedJoint.h index 8020ea73f..c406b4aa8 100644 --- a/Source/Engine/Physics/Joints/FixedJoint.h +++ b/Source/Engine/Physics/Joints/FixedJoint.h @@ -8,7 +8,7 @@ /// Physics joint that maintains a fixed distance and orientation between its two attached bodies. /// /// -API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Fixed Joint\"), ActorToolbox(\"Physics\")") +API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Joints/Fixed Joint\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API FixedJoint : public Joint { DECLARE_SCENE_OBJECT(FixedJoint); diff --git a/Source/Engine/Physics/Joints/HingeJoint.h b/Source/Engine/Physics/Joints/HingeJoint.h index 6c7af54de..a14230cd9 100644 --- a/Source/Engine/Physics/Joints/HingeJoint.h +++ b/Source/Engine/Physics/Joints/HingeJoint.h @@ -67,7 +67,7 @@ public: /// Physics joint that removes all but a single rotation degree of freedom from its two attached bodies (for example a door hinge). /// /// -API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Hinge Joint\"), ActorToolbox(\"Physics\")") +API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Joints/Hinge Joint\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API HingeJoint : public Joint { DECLARE_SCENE_OBJECT(HingeJoint); diff --git a/Source/Engine/Physics/Joints/SliderJoint.h b/Source/Engine/Physics/Joints/SliderJoint.h index d102c1dd5..51d95f339 100644 --- a/Source/Engine/Physics/Joints/SliderJoint.h +++ b/Source/Engine/Physics/Joints/SliderJoint.h @@ -27,7 +27,7 @@ DECLARE_ENUM_OPERATORS(SliderJointFlag); /// Physics joint that removes all but a single translational degree of freedom. Bodies are allowed to move along a single axis. /// /// -API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Slider Joint\"), ActorToolbox(\"Physics\")") +API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Joints/Slider Joint\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API SliderJoint : public Joint { DECLARE_SCENE_OBJECT(SliderJoint); diff --git a/Source/Engine/Physics/Joints/SphericalJoint.h b/Source/Engine/Physics/Joints/SphericalJoint.h index 96359d4c5..95f0bae10 100644 --- a/Source/Engine/Physics/Joints/SphericalJoint.h +++ b/Source/Engine/Physics/Joints/SphericalJoint.h @@ -29,7 +29,7 @@ DECLARE_ENUM_OPERATORS(SphericalJointFlag); /// rotate around the anchor points, and their rotation can be limited by an elliptical cone. /// /// -API_CLASS(Attributes = "ActorContextMenu(\"New/Physics/Spherical Joint\"), ActorToolbox(\"Physics\")") +API_CLASS(Attributes = "ActorContextMenu(\"New/Physics/Joints/Spherical Joint\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API SphericalJoint : public Joint { DECLARE_SCENE_OBJECT(SphericalJoint); From ff3277edc7d10e88a8cbd9e6a9aacbd90f10c962 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Sun, 22 Jan 2023 21:33:08 -0600 Subject: [PATCH 06/10] Change CM attributes to not check inhereted class. --- Source/Editor/Windows/Assets/PrefabWindow.Hierarchy.cs | 2 +- Source/Editor/Windows/ContentWindow.ContextMenu.cs | 2 +- Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs | 2 +- Source/Editor/Windows/ToolboxWindow.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Editor/Windows/Assets/PrefabWindow.Hierarchy.cs b/Source/Editor/Windows/Assets/PrefabWindow.Hierarchy.cs index 71777dea7..7544100e8 100644 --- a/Source/Editor/Windows/Assets/PrefabWindow.Hierarchy.cs +++ b/Source/Editor/Windows/Assets/PrefabWindow.Hierarchy.cs @@ -253,7 +253,7 @@ namespace FlaxEditor.Windows.Assets if (actorType.IsAbstract) continue; ActorContextMenuAttribute attribute = null; - foreach (var e in actorType.GetAttributes(true)) + foreach (var e in actorType.GetAttributes(false)) { if (e is ActorContextMenuAttribute actorContextMenuAttribute) { diff --git a/Source/Editor/Windows/ContentWindow.ContextMenu.cs b/Source/Editor/Windows/ContentWindow.ContextMenu.cs index b8b289e08..64d9b6d37 100644 --- a/Source/Editor/Windows/ContentWindow.ContextMenu.cs +++ b/Source/Editor/Windows/ContentWindow.ContextMenu.cs @@ -162,7 +162,7 @@ namespace FlaxEditor.Windows // Get attribute ContentContextMenuAttribute attribute = null; - foreach (var typeAttribute in type.GetAttributes(true)) + foreach (var typeAttribute in type.GetAttributes(false)) { if (typeAttribute is ContentContextMenuAttribute contentContextMenuAttribute) { diff --git a/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs b/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs index 75f31bfd6..e48e59f80 100644 --- a/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs +++ b/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs @@ -66,7 +66,7 @@ namespace FlaxEditor.Windows if (actorType.IsAbstract) continue; ActorContextMenuAttribute attribute = null; - foreach (var e in actorType.GetAttributes(true)) + foreach (var e in actorType.GetAttributes(false)) { if (e is ActorContextMenuAttribute actorContextMenuAttribute) { diff --git a/Source/Editor/Windows/ToolboxWindow.cs b/Source/Editor/Windows/ToolboxWindow.cs index 434647280..445a7d778 100644 --- a/Source/Editor/Windows/ToolboxWindow.cs +++ b/Source/Editor/Windows/ToolboxWindow.cs @@ -250,7 +250,7 @@ namespace FlaxEditor.Windows foreach (var actorType in Editor.CodeEditing.Actors.Get()) { ActorToolboxAttribute attribute = null; - foreach (var e in actorType.GetAttributes(true)) + foreach (var e in actorType.GetAttributes(false)) { if (e is ActorToolboxAttribute actorToolboxAttribute) { From bc7f9f7534e4913afca66da45dbee35f0a8739b2 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Mon, 23 Jan 2023 20:05:34 -0600 Subject: [PATCH 07/10] changed min length to 1 to start filtering after first character is entered. --- Source/Editor/Utilities/QueryFilterHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Editor/Utilities/QueryFilterHelper.cs b/Source/Editor/Utilities/QueryFilterHelper.cs index 653149a35..e9e5e9ccb 100644 --- a/Source/Editor/Utilities/QueryFilterHelper.cs +++ b/Source/Editor/Utilities/QueryFilterHelper.cs @@ -15,7 +15,7 @@ namespace FlaxEditor.Utilities /// /// The minimum text match length. /// - public const int MinLength = 2; + public const int MinLength = 1; /// /// Matches the specified text with the filter. From c1e0d70646c3216fec717ef50b749c3cd0c45bca Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 24 Jan 2023 19:14:18 +0100 Subject: [PATCH 08/10] Fix name overlap --- Source/Engine/UI/UICanvas.cpp | 12 ++++++------ Source/Engine/UI/UICanvas.cs | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Engine/UI/UICanvas.cpp b/Source/Engine/UI/UICanvas.cpp index c5384ee5e..22d7ea550 100644 --- a/Source/Engine/UI/UICanvas.cpp +++ b/Source/Engine/UI/UICanvas.cpp @@ -17,8 +17,8 @@ MMethod* UICanvas_Serialize = nullptr; MMethod* UICanvas_SerializeDiff = nullptr; MMethod* UICanvas_Deserialize = nullptr; MMethod* UICanvas_PostDeserialize = nullptr; -MMethod* UICanvas_OnEnable = nullptr; -MMethod* UICanvas_OnDisable = nullptr; +MMethod* UICanvas_Enable = nullptr; +MMethod* UICanvas_Disable = nullptr; #if USE_EDITOR MMethod* UICanvas_OnActiveInTreeChanged = nullptr; #endif @@ -51,8 +51,8 @@ UICanvas::UICanvas(const SpawnParams& params) UICanvas_SerializeDiff = mclass->GetMethod("SerializeDiff", 1); UICanvas_Deserialize = mclass->GetMethod("Deserialize", 1); UICanvas_PostDeserialize = mclass->GetMethod("PostDeserialize"); - UICanvas_OnEnable = mclass->GetMethod("OnEnable"); - UICanvas_OnDisable = mclass->GetMethod("OnDisable"); + UICanvas_Enable = mclass->GetMethod("Enable"); + UICanvas_Disable = mclass->GetMethod("Disable"); #if USE_EDITOR UICanvas_OnActiveInTreeChanged = mclass->GetMethod("OnActiveInTreeChanged"); #endif @@ -163,7 +163,7 @@ void UICanvas::OnParentChanged() void UICanvas::OnEnable() { - UICANVAS_INVOKE(OnEnable); + UICANVAS_INVOKE(Enable); // Base Actor::OnEnable(); @@ -174,7 +174,7 @@ void UICanvas::OnDisable() // Base Actor::OnDisable(); - UICANVAS_INVOKE(OnDisable); + UICANVAS_INVOKE(Disable); } void UICanvas::OnTransformChanged() diff --git a/Source/Engine/UI/UICanvas.cs b/Source/Engine/UI/UICanvas.cs index f200ce3d0..87fc9506f 100644 --- a/Source/Engine/UI/UICanvas.cs +++ b/Source/Engine/UI/UICanvas.cs @@ -763,7 +763,7 @@ namespace FlaxEngine #endif } - internal void OnEnable() + internal void Enable() { #if FLAX_EDITOR if (_editorRoot != null) @@ -792,7 +792,7 @@ namespace FlaxEngine } } - internal void OnDisable() + internal void Disable() { _guiRoot.Parent = null; From 03813259cf51d40e3d80e8ea4598a6891b5065e0 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 24 Jan 2023 19:19:56 +0100 Subject: [PATCH 09/10] Update assets --- Content/Shaders/GI/DDGI.flax | 4 ++-- Content/Shaders/GI/GlobalSurfaceAtlas.flax | 4 ++-- Content/Shaders/TAA.flax | 4 ++-- Content/Shaders/VolumetricFog.flax | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Content/Shaders/GI/DDGI.flax b/Content/Shaders/GI/DDGI.flax index daaac6317..c8f8eee9d 100644 --- a/Content/Shaders/GI/DDGI.flax +++ b/Content/Shaders/GI/DDGI.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:da77e6d9cfc596990d6286fe5b3a7976357cccd95cb0e7ed6a3fdcc23695d212 -size 24284 +oid sha256:6b00a1519c9fe2303a05c10ae4061649c4073a3f65a3bd8c2af848cdc7bf5e53 +size 23702 diff --git a/Content/Shaders/GI/GlobalSurfaceAtlas.flax b/Content/Shaders/GI/GlobalSurfaceAtlas.flax index a90a8c5ab..f74572140 100644 --- a/Content/Shaders/GI/GlobalSurfaceAtlas.flax +++ b/Content/Shaders/GI/GlobalSurfaceAtlas.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:32bf53278f501fbdcb61ba7da32dd1a37e6f87608401be4a256b9cc9bf687d7f -size 12952 +oid sha256:8b69d6b93baa29702789073f911dbe784dc65ccd66a43cef837a217959d24d13 +size 12612 diff --git a/Content/Shaders/TAA.flax b/Content/Shaders/TAA.flax index b57642b07..e9575793e 100644 --- a/Content/Shaders/TAA.flax +++ b/Content/Shaders/TAA.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8d22fd7b1f4008b56a9f95e0c6263f8f66a26244bb40437c724344633a4ea4bc -size 3343 +oid sha256:26cf20668dc0d93fdffa3ea715130b618e9c491e73dc8be779c1d182e73b255b +size 3257 diff --git a/Content/Shaders/VolumetricFog.flax b/Content/Shaders/VolumetricFog.flax index 8de7291ce..18eddae16 100644 --- a/Content/Shaders/VolumetricFog.flax +++ b/Content/Shaders/VolumetricFog.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d25529ed77efff338892f54c103d007e98102328382497a5bb0ca5b047ef6acb -size 14255 +oid sha256:72415ba69a685e9a739d1a08d08c6eb9efd3cab31d8cc0c949cb187a9bad19a5 +size 13841 From e57481de7dfc2f90a9782acb18a381b14c0ebc73 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 24 Jan 2023 23:18:12 +0100 Subject: [PATCH 10/10] Adjustments to the new group panels #903 --- .../Editor/CustomEditors/Dedicated/ActorEditor.cs | 2 +- .../Editor/CustomEditors/Dedicated/ScriptsEditor.cs | 13 ++++++------- .../Elements/Container/GroupElement.cs | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs index 7f217917b..75e3fff23 100644 --- a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs @@ -94,7 +94,7 @@ namespace FlaxEditor.CustomEditors.Dedicated { if (actor != null) group.Panel.TooltipText = Surface.SurfaceUtils.GetVisualScriptTypeDescription(TypeUtils.GetObjectType(actor)); - const float settingsButtonSize = 20; + float settingsButtonSize = group.Panel.HeaderHeight; var settingsButton = new Image { TooltipText = "Settings", diff --git a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs index a02b84617..73a43f1bf 100644 --- a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs @@ -635,22 +635,22 @@ namespace FlaxEditor.CustomEditors.Dedicated group.Panel.HeaderTextColor = FlaxEngine.GUI.Style.Current.ProgressNormal; // Add toggle button to the group + var headerHeight = group.Panel.HeaderHeight; var scriptToggle = new CheckBox { TooltipText = "If checked, script will be enabled.", IsScrollable = false, Checked = script.Enabled, Parent = group.Panel, - Size = new Float2(20, 20), - Bounds = new Rectangle(20, 0, 20, 20), - BoxSize = 16.0f, + Size = new Float2(headerHeight), + Bounds = new Rectangle(headerHeight, 0, headerHeight, headerHeight), + BoxSize = headerHeight - 4.0f, Tag = script, }; scriptToggle.StateChanged += OnScriptToggleCheckChanged; _scriptToggles[i] = scriptToggle; // Add drag button to the group - const float dragIconSize = 20; var scriptDrag = new ScriptDragIcon(this, script) { TooltipText = "Script reference", @@ -658,21 +658,20 @@ namespace FlaxEditor.CustomEditors.Dedicated IsScrollable = false, Color = FlaxEngine.GUI.Style.Current.ForegroundGrey, Parent = group.Panel, - Bounds = new Rectangle(scriptToggle.Right, 0.5f, dragIconSize, dragIconSize), + Bounds = new Rectangle(scriptToggle.Right, 0.5f, headerHeight, headerHeight), Margin = new Margin(1), Brush = new SpriteBrush(Editor.Instance.Icons.DragBar12), Tag = script, }; // Add settings button to the group - const float settingsButtonSize = 20; var settingsButton = new Image { TooltipText = "Settings", AutoFocus = true, AnchorPreset = AnchorPresets.TopRight, Parent = group.Panel, - Bounds = new Rectangle(group.Panel.Width - settingsButtonSize, 0, settingsButtonSize, settingsButtonSize), + Bounds = new Rectangle(group.Panel.Width - headerHeight, 0, headerHeight, headerHeight), IsScrollable = false, Color = FlaxEngine.GUI.Style.Current.ForegroundGrey, Margin = new Margin(1), diff --git a/Source/Editor/CustomEditors/Elements/Container/GroupElement.cs b/Source/Editor/CustomEditors/Elements/Container/GroupElement.cs index 676dd99ae..e0ae259ec 100644 --- a/Source/Editor/CustomEditors/Elements/Container/GroupElement.cs +++ b/Source/Editor/CustomEditors/Elements/Container/GroupElement.cs @@ -19,7 +19,7 @@ namespace FlaxEditor.CustomEditors.Elements ArrowImageOpened = new SpriteBrush(Style.Current.ArrowDown), EnableDropDownIcon = true, ItemsMargin = new Margin(7, 7, 3, 3), - HeaderHeight = 20, + HeaderHeight = 18.0f, EnableContainmentLines = true, };