diff --git a/Content/Shaders/AtmospherePreCompute.flax b/Content/Shaders/AtmospherePreCompute.flax
index 527275f61..20491857f 100644
--- a/Content/Shaders/AtmospherePreCompute.flax
+++ b/Content/Shaders/AtmospherePreCompute.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f06c5ac062366b3ef86c355c6cc8b3a984b8eb9bc027ffc0874bc51dbaef4b3e
-size 11720
+oid sha256:68e1592216496fd6749ac4538dd2d549c39813d17ec3114514889100782007a6
+size 11418
diff --git a/Content/Shaders/BakeLightmap.flax b/Content/Shaders/BakeLightmap.flax
index ef3e02163..03af565fc 100644
--- a/Content/Shaders/BakeLightmap.flax
+++ b/Content/Shaders/BakeLightmap.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:18eb0ec2642a8f87ee3d4dbe7af8771b0f79f983637aee1a9e5baebce435976b
-size 16284
+oid sha256:0cf36b83e0bdbbf47b2d88b39d18ae3e1ac85246d46a05f1e6c58f89f4abc105
+size 15794
diff --git a/Content/Shaders/BitonicSort.flax b/Content/Shaders/BitonicSort.flax
index 980b664f3..c49c2b73f 100644
--- a/Content/Shaders/BitonicSort.flax
+++ b/Content/Shaders/BitonicSort.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e8d1a797f813d3af8a98bcb8110981ea8c033324e94fb6413615c811b5c5bfd7
-size 6808
+oid sha256:fbecce17a3a0dba01aa1e8d537041c27339a5f171c04cdeb83c68765fd6ac652
+size 6548
diff --git a/Content/Shaders/ColorGrading.flax b/Content/Shaders/ColorGrading.flax
index a7a466d5e..d36626d2c 100644
--- a/Content/Shaders/ColorGrading.flax
+++ b/Content/Shaders/ColorGrading.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:2bda196600fbc9d6f362e85471399331941272cdd92f9888bdcf7a1b8b04ada7
-size 10925
+oid sha256:1841743cd96e3efba196cba05678658463c1c1fcd6b06ac7703e87bb2850d641
+size 10618
diff --git a/Content/Shaders/DebugDraw.flax b/Content/Shaders/DebugDraw.flax
index ea3807153..4e824c30c 100644
--- a/Content/Shaders/DebugDraw.flax
+++ b/Content/Shaders/DebugDraw.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:b25f3b058f2bca838a661e46e90931f347b7e9984626e2b0112270e0f3e4fa47
-size 2115
+oid sha256:9fc85c05a9203d53f03db74f4d04a39e651e34d310de119f06279a1ce0299bcc
+size 2053
diff --git a/Content/Shaders/Editor/LightmapUVsDensity.flax b/Content/Shaders/Editor/LightmapUVsDensity.flax
index c817058f7..145040bbe 100644
--- a/Content/Shaders/Editor/LightmapUVsDensity.flax
+++ b/Content/Shaders/Editor/LightmapUVsDensity.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f23c12db6332866a9ac91d576575448af02e1a4e0fff20529f32911970de72e5
-size 4509
+oid sha256:7df3b4a9464524bb0354ab9f4e7dc6256af56d3f13f3b347a946742ecbf4c1d1
+size 4391
diff --git a/Content/Shaders/Editor/MaterialComplexity.flax b/Content/Shaders/Editor/MaterialComplexity.flax
index 3c8770e50..490f72a38 100644
--- a/Content/Shaders/Editor/MaterialComplexity.flax
+++ b/Content/Shaders/Editor/MaterialComplexity.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a891d1a83c1c99f17f43f75fbe09ffe5df99bd52f150875771f70ee67f2f52e0
-size 1336
+oid sha256:446446a3e8e3e72793cfdf3cf76d705917a61814fd1f40cb60827ad3c002b21d
+size 1303
diff --git a/Content/Shaders/Editor/QuadOverdraw.flax b/Content/Shaders/Editor/QuadOverdraw.flax
index 7eba0013e..7e6bdfb9a 100644
--- a/Content/Shaders/Editor/QuadOverdraw.flax
+++ b/Content/Shaders/Editor/QuadOverdraw.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:6a25d8d4db381507c4c2a33d794b7eec8994ae8d281478e057232adf788224db
-size 1448
+oid sha256:50ab3a3734b0cd349aadd61c404739b48146cc1f326412dc5e4604da3fe03dc6
+size 1414
diff --git a/Content/Shaders/Editor/VertexColors.flax b/Content/Shaders/Editor/VertexColors.flax
index 2d862a36d..92b00ddac 100644
--- a/Content/Shaders/Editor/VertexColors.flax
+++ b/Content/Shaders/Editor/VertexColors.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:bf47e691ee17a3bf17948cc365a327685e5298568a993fec47a920934d1a86fb
-size 2102
+oid sha256:66e418d872f95996806ff866e4786d8d22e504c5209f4b7b8e140c29a77ce93f
+size 2053
diff --git a/Content/Shaders/EyeAdaptation.flax b/Content/Shaders/EyeAdaptation.flax
index a81177004..1f52e67da 100644
--- a/Content/Shaders/EyeAdaptation.flax
+++ b/Content/Shaders/EyeAdaptation.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:00e1a4e4fc4153cb83b090169b9d600686e9bf6a6565914de46d55b1b945025e
-size 4610
+oid sha256:0f1a19e5a918049d093d4536e540d4ffb779c2b0b4524a277b1503afbecea79b
+size 4453
diff --git a/Content/Shaders/FXAA.flax b/Content/Shaders/FXAA.flax
index 7f8e18d8a..4b6bdfe25 100644
--- a/Content/Shaders/FXAA.flax
+++ b/Content/Shaders/FXAA.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a8a6d89039e93acb1ac658b4b63ab9baa21c7777d948f14732571529a8cfe519
-size 25139
+oid sha256:142d7ede22ed99b095dd07fcce722b7668554911e57a1b41e17842e0383a8d24
+size 24484
diff --git a/Content/Shaders/Fog.flax b/Content/Shaders/Fog.flax
index 37410e1af..f19396bd8 100644
--- a/Content/Shaders/Fog.flax
+++ b/Content/Shaders/Fog.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:58dab7514164b3cf941636dbead945da12b13dc485dbec997227711c2e67e58f
-size 2878
+oid sha256:4703c3f843dec8248938344d04778d4705eb61247610906af9ec22b4d42f1eae
+size 2795
diff --git a/Content/Shaders/Forward.flax b/Content/Shaders/Forward.flax
index b922a3b16..393603913 100644
--- a/Content/Shaders/Forward.flax
+++ b/Content/Shaders/Forward.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:8d18f21b456efe8c9f5c38c35aa0ce6e13552966aa48445cb33826837bea2819
-size 1221
+oid sha256:0c76097d4a231be004658cdbbeae05058ff5408cb003d38ac5ef6ca927c04484
+size 1197
diff --git a/Content/Shaders/GBuffer.flax b/Content/Shaders/GBuffer.flax
index 78308a4bb..a22a76fb1 100644
--- a/Content/Shaders/GBuffer.flax
+++ b/Content/Shaders/GBuffer.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:180768a9304d7bc12c8fb487a39a9991575d55cfaf5fe3135a4985098340d042
-size 2845
+oid sha256:255a153284978cff6e0285f40355ba8695679f97215c2efe39082ae7422f7d8f
+size 2774
diff --git a/Content/Shaders/GPUParticlesSorting.flax b/Content/Shaders/GPUParticlesSorting.flax
index 6b2a31931..08b6a4d78 100644
--- a/Content/Shaders/GPUParticlesSorting.flax
+++ b/Content/Shaders/GPUParticlesSorting.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f5d131298c4f138278a5339e7d1a2dd8263c4afa4e27f3fa345ebda21989ea15
-size 2726
+oid sha256:fcfaa7567daaeac0ba0e3d135db52c674b7f17f8bace31b8a4f75ef8a24b21a7
+size 2639
diff --git a/Content/Shaders/GUI.flax b/Content/Shaders/GUI.flax
index a6e231bd4..18f16aa34 100644
--- a/Content/Shaders/GUI.flax
+++ b/Content/Shaders/GUI.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:5512b7584d43b571a9a30cec4b5c160cebd8924f4305c8de0ae439a664d143a7
-size 5111
+oid sha256:b4b204acc4b60f93a490e3178a853a7ae059ac5e6e1e4ee4dc7ebc0b8771413c
+size 4943
diff --git a/Content/Shaders/GlobalSignDistanceField.flax b/Content/Shaders/GlobalSignDistanceField.flax
index ec1d39d8f..50ca8c78d 100644
--- a/Content/Shaders/GlobalSignDistanceField.flax
+++ b/Content/Shaders/GlobalSignDistanceField.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e14a67948d93abb8ef6124b39fdb7b1bc682e1fdf5341ce6255eefe2606a2dfc
-size 11787
+oid sha256:dd3a18c7831eba6b531d82528733e2f7ab58a02b076441a974e2b999b26da616
+size 11498
diff --git a/Content/Shaders/Histogram.flax b/Content/Shaders/Histogram.flax
index 4c5967874..9df23aad7 100644
--- a/Content/Shaders/Histogram.flax
+++ b/Content/Shaders/Histogram.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:92a990f5286c449d3274bd90766d022d03aeaa43ecb93c0589d391828842b16b
-size 2609
+oid sha256:761d2f9eea984a5cb46ba7a83f3f49c9cb7452a05420faecc70c55c3b56cfa45
+size 2532
diff --git a/Content/Shaders/Lights.flax b/Content/Shaders/Lights.flax
index 612a634ab..c76a501fe 100644
--- a/Content/Shaders/Lights.flax
+++ b/Content/Shaders/Lights.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:86919e780799e02ebae7ce13f876925219e5b03234c7fdae3b610623d8bc81b8
-size 5299
+oid sha256:37b0d62eff4ed0ea2cd48c351e0f8e0ed98f1aac3b272fd0849227eda6cb6856
+size 5122
diff --git a/Content/Shaders/MotionBlur.flax b/Content/Shaders/MotionBlur.flax
index 5dac7c3eb..a2c201bc6 100644
--- a/Content/Shaders/MotionBlur.flax
+++ b/Content/Shaders/MotionBlur.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:82109c08b00acfcd46818e35b05732ccdfd7f453bf6b3cea5b450603b2d1baa8
-size 9685
+oid sha256:7b468b522e29e3464a2e310334e011d793a10ebc20092e5bedd76d33ed608054
+size 9428
diff --git a/Content/Shaders/MultiScaler.flax b/Content/Shaders/MultiScaler.flax
index 3b71c27aa..8e5790610 100644
--- a/Content/Shaders/MultiScaler.flax
+++ b/Content/Shaders/MultiScaler.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:737c91950c010adb13cee6669f77d95737aa671f17d71fb6bee8ca5c3c627e27
-size 7206
+oid sha256:a0412a83a79884e77e09f5debfedf45b5856756b2e2298edef196c9434d4bf19
+size 7006
diff --git a/Content/Shaders/PostProcessing.flax b/Content/Shaders/PostProcessing.flax
index a771d9882..bba56658c 100644
--- a/Content/Shaders/PostProcessing.flax
+++ b/Content/Shaders/PostProcessing.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f72955c7285fb135c80ba73ac0a1e62463394c86979bdad1e0a789158ad7728c
+oid sha256:5f3c7923418f5872dc4bbfb08c39327f46d357c62827711da5e4e50332f26bc0
size 16522
diff --git a/Content/Shaders/ProbesFilter.flax b/Content/Shaders/ProbesFilter.flax
index 760a91040..59ec47ef3 100644
--- a/Content/Shaders/ProbesFilter.flax
+++ b/Content/Shaders/ProbesFilter.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:3765117ee658c768184f9af0c7aa7799c575cfc68f5ce0d824e211570d887135
-size 2108
+oid sha256:bfc735d6646e35594c1441298a4718ea8cffe4517762f65982dabed50af8215e
+size 2030
diff --git a/Content/Shaders/Quad.flax b/Content/Shaders/Quad.flax
index 485a11fbf..6a6897dfb 100644
--- a/Content/Shaders/Quad.flax
+++ b/Content/Shaders/Quad.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:04c502c31eaceba9738444cd3a9419474ebfbfd42e7efa39b7cc5778a19e267c
-size 2310
+oid sha256:f9225e31ac76e66a2f4c09f70af326229c563155dc0c34eccb9f243f80c07908
+size 2242
diff --git a/Content/Shaders/Reflections.flax b/Content/Shaders/Reflections.flax
index 9cf210fec..e594c5727 100644
--- a/Content/Shaders/Reflections.flax
+++ b/Content/Shaders/Reflections.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:b651d798d3e2a36d3afe960e087f061cf53cac826ac48fff17eebba7293ed46f
-size 3288
+oid sha256:772f6b54b8ab6f6f054935bd9593616896c9e7b56249f0b084d85858a50f4f00
+size 3193
diff --git a/Content/Shaders/SMAA.flax b/Content/Shaders/SMAA.flax
index e315c9ef5..605524a5d 100644
--- a/Content/Shaders/SMAA.flax
+++ b/Content/Shaders/SMAA.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:c53b7a4929736b7f603f47475e2d668100e52f53c6ba176397b06b2ebc0f050d
-size 47673
+oid sha256:8071432958f2e295bc22f7058970c18135c001a4f705f20c4c99385d8acf1daa
+size 46449
diff --git a/Content/Shaders/SSAO.flax b/Content/Shaders/SSAO.flax
index e4a48b1f8..232e72a8c 100644
--- a/Content/Shaders/SSAO.flax
+++ b/Content/Shaders/SSAO.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:b8ed05e81b6c7822c725976551f75960e770f3a32fdb23ab49f60e32e366ae15
-size 37614
+oid sha256:b6747405d3ef0698c9b84ceebfc1ba2fb3d255ffcec10bd5e5fb86b1ff632187
+size 36841
diff --git a/Content/Shaders/Shadows.flax b/Content/Shaders/Shadows.flax
index 8c45d669a..9c5e5b142 100644
--- a/Content/Shaders/Shadows.flax
+++ b/Content/Shaders/Shadows.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:61ea612b8ee409c1de4bb4ff4455f31bf32ed756a6612d9c5a9a152ff6b034d0
-size 7847
+oid sha256:b823730a83d35980f63d3adb7d23c8ee4585826c6e6dd09555dd97aa77dad269
+size 7654
diff --git a/Content/Shaders/Sky.flax b/Content/Shaders/Sky.flax
index 2ff583cfc..e7bc71130 100644
--- a/Content/Shaders/Sky.flax
+++ b/Content/Shaders/Sky.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:0ad54e191498e2c0067b32b041cfb351fa18f928d36372ae259a8b64a9dfb311
-size 3572
+oid sha256:0791b4d9504a0284ecb7f45b8339abab12a00396c2b4063ee4320ac15d92bc9b
+size 3473
diff --git a/Source/Editor/Content/Tree/ContentTreeNode.cs b/Source/Editor/Content/Tree/ContentTreeNode.cs
index 1d70a8252..27e7cf76c 100644
--- a/Source/Editor/Content/Tree/ContentTreeNode.cs
+++ b/Source/Editor/Content/Tree/ContentTreeNode.cs
@@ -95,19 +95,17 @@ namespace FlaxEditor.Content
{
if (!_folder.CanRename)
return;
- Editor.Instance.Windows.ContentWin.ScrollingOnTreeView(false);
+
// Start renaming the folder
- var dialog = RenamePopup.Show(this, HeaderRect, _folder.ShortName, false);
+ Editor.Instance.Windows.ContentWin.ScrollingOnTreeView(false);
+ var dialog = RenamePopup.Show(this, TextRect, _folder.ShortName, false);
dialog.Tag = _folder;
dialog.Renamed += popup =>
{
Editor.Instance.Windows.ContentWin.Rename((ContentFolder)popup.Tag, popup.Text);
Editor.Instance.Windows.ContentWin.ScrollingOnTreeView(true);
};
- dialog.Closed += popup =>
- {
- Editor.Instance.Windows.ContentWin.ScrollingOnTreeView(true);
- };
+ dialog.Closed += popup => { Editor.Instance.Windows.ContentWin.ScrollingOnTreeView(true); };
}
///
diff --git a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs
index 47147381e..68dca9883 100644
--- a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs
@@ -72,7 +72,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
}
cm.ItemClicked += item => AddScript((ScriptType)item.Tag);
cm.SortItems();
- cm.Show(this, button.BottomLeft);
+ cm.Show(this, button.BottomLeft - new Float2((cm.Width - button.Width) / 2, 0));
}
///
diff --git a/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs b/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs
index 602c6d0ee..1050139be 100644
--- a/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs
@@ -407,6 +407,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
public class UIControlControlEditor : GenericEditor
{
private Type _cachedType;
+ private bool _anchorDropDownClosed = true;
///
public override void Initialize(LayoutElementsContainer layout)
@@ -498,7 +499,8 @@ namespace FlaxEditor.CustomEditors.Dedicated
ItemInfo maxItem = new ItemInfo(maxInfo);
GroupElement ng = main.Group("Anchors", true);
- ng.Panel.Close(false);
+ ng.Panel.IsClosed = _anchorDropDownClosed;
+ ng.Panel.IsClosedChanged += panel => _anchorDropDownClosed = panel.IsClosed;
ng.Property("Min", minItem.GetValues(Values));
ng.Property("Max", maxItem.GetValues(Values));
}
diff --git a/Source/Editor/GUI/Input/SearchBox.cs b/Source/Editor/GUI/Input/SearchBox.cs
new file mode 100644
index 000000000..8ffd0874a
--- /dev/null
+++ b/Source/Editor/GUI/Input/SearchBox.cs
@@ -0,0 +1,56 @@
+using FlaxEngine;
+using FlaxEngine.GUI;
+
+namespace FlaxEditor.GUI.Input
+{
+ ///
+ /// Search box control which can gather text search input from the user.
+ ///
+ public class SearchBox : TextBox
+ {
+ ///
+ /// A button that clears the search bar.
+ ///
+ public Button ClearSearchButton { get; }
+
+ ///
+ /// Init search box
+ ///
+ public SearchBox()
+ : this(false, 0, 0)
+ {
+ }
+
+ ///
+ /// Init search box
+ ///
+ public SearchBox(bool isMultiline, float x, float y, float width = 120)
+ : base(isMultiline, x, y, width)
+ {
+ WatermarkText = "Search...";
+
+ ClearSearchButton = new Button
+ {
+ Parent = this,
+ Width = 14.0f,
+ Height = 14.0f,
+ AnchorPreset = AnchorPresets.TopRight,
+ Text = "",
+ TooltipText = "Cancel Search.",
+ BackgroundColor = TextColor,
+ BorderColor = Color.Transparent,
+ BackgroundColorHighlighted = Style.Current.ForegroundGrey,
+ BorderColorHighlighted = Color.Transparent,
+ BackgroundColorSelected = Style.Current.ForegroundGrey,
+ BorderColorSelected = Color.Transparent,
+ BackgroundBrush = new SpriteBrush(Editor.Instance.Icons.Cross12),
+ Visible = false,
+ };
+ ClearSearchButton.LocalY += 2;
+ ClearSearchButton.LocalX -= 2;
+ ClearSearchButton.Clicked += Clear;
+
+ TextChanged += () => ClearSearchButton.Visible = !string.IsNullOrEmpty(Text);
+ }
+ }
+}
diff --git a/Source/Editor/GUI/Input/ValueBox.cs b/Source/Editor/GUI/Input/ValueBox.cs
index 7f4fb51e0..ac253b79d 100644
--- a/Source/Editor/GUI/Input/ValueBox.cs
+++ b/Source/Editor/GUI/Input/ValueBox.cs
@@ -173,6 +173,7 @@ namespace FlaxEditor.GUI.Input
private void EndSliding()
{
_isSliding = false;
+ EndEditOnClick = true;
EndMouseCapture();
if (_cursorChanged)
{
@@ -245,6 +246,7 @@ namespace FlaxEditor.GUI.Input
_startSlideLocation = location;
_startSlideValue = _value;
StartMouseCapture(true);
+ EndEditOnClick = false;
// Hide cursor and cache location
Cursor = CursorType.Hidden;
diff --git a/Source/Editor/GUI/ItemsListContextMenu.cs b/Source/Editor/GUI/ItemsListContextMenu.cs
index 77ee9af76..b761fa989 100644
--- a/Source/Editor/GUI/ItemsListContextMenu.cs
+++ b/Source/Editor/GUI/ItemsListContextMenu.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using FlaxEditor.GUI.ContextMenu;
+using FlaxEditor.GUI.Input;
using FlaxEditor.Utilities;
using FlaxEngine;
using FlaxEngine.GUI;
@@ -204,11 +205,10 @@ namespace FlaxEditor.GUI
Size = new Float2(width, height);
// Search box
- _searchBox = new TextBox(false, 1, 1)
+ _searchBox = new SearchBox(false, 1, 1)
{
Parent = this,
Width = Width - 3,
- WatermarkText = "Search...",
};
_searchBox.TextChanged += OnSearchFilterChanged;
diff --git a/Source/Editor/Modules/UIModule.cs b/Source/Editor/Modules/UIModule.cs
index 829ad5e00..ff1179ae0 100644
--- a/Source/Editor/Modules/UIModule.cs
+++ b/Source/Editor/Modules/UIModule.cs
@@ -741,7 +741,9 @@ namespace FlaxEditor.Modules
return;
// Find layout to use
- var searchFolder = Globals.ProjectCacheFolder;
+ var searchFolder = StringUtils.CombinePaths(Editor.LocalCachePath, "LayoutsCache");
+ if (!Directory.Exists(searchFolder))
+ Directory.CreateDirectory(searchFolder);
var files = Directory.GetFiles(searchFolder, "Layout_*.xml", SearchOption.TopDirectoryOnly);
var layouts = _menuWindowApplyWindowLayout.ContextMenu;
layouts.DisposeAllItems();
@@ -749,8 +751,11 @@ namespace FlaxEditor.Modules
{
var file = files[i];
var name = file.Substring(searchFolder.Length + 8, file.Length - searchFolder.Length - 12);
- var button = layouts.AddButton(name, OnApplyLayoutButtonClicked);
- button.Tag = file;
+ var nameCM = layouts.AddChildMenu(name);
+ var applyButton = nameCM.ContextMenu.AddButton("Apply", OnApplyLayoutButtonClicked);
+ applyButton.TooltipText = "Applies the selected layout.";
+ nameCM.ContextMenu.AddButton("Delete", () => File.Delete(file)).TooltipText = "Permanently deletes the selected layout.";
+ applyButton.Tag = file;
}
_menuWindowApplyWindowLayout.Enabled = files.Length > 0;
}
diff --git a/Source/Editor/Modules/WindowsModule.cs b/Source/Editor/Modules/WindowsModule.cs
index 2fa93a994..5a07356a7 100644
--- a/Source/Editor/Modules/WindowsModule.cs
+++ b/Source/Editor/Modules/WindowsModule.cs
@@ -558,7 +558,7 @@ namespace FlaxEditor.Modules
base.OnSubmit();
- var path = StringUtils.CombinePaths(Globals.ProjectCacheFolder, "Layout_" + name + ".xml");
+ var path = StringUtils.CombinePaths(Editor.LocalCachePath, "LayoutsCache", "Layout_" + name + ".xml");
Editor.Instance.Windows.SaveLayout(path);
}
}
diff --git a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs
index 1d10ef687..3ecd5d903 100644
--- a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs
+++ b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs
@@ -283,7 +283,7 @@ namespace FlaxEditor.SceneGraph.GUI
(window as PrefabWindow).ScrollingOnTreeView(false);
// Start renaming the actor
- var dialog = RenamePopup.Show(this, HeaderRect, _actorNode.Name, false);
+ var dialog = RenamePopup.Show(this, TextRect, _actorNode.Name, false);
dialog.Renamed += OnRenamed;
dialog.Closed += popup =>
{
diff --git a/Source/Editor/Surface/ContextMenu/VisjectCM.cs b/Source/Editor/Surface/ContextMenu/VisjectCM.cs
index 984e3e520..5057e4445 100644
--- a/Source/Editor/Surface/ContextMenu/VisjectCM.cs
+++ b/Source/Editor/Surface/ContextMenu/VisjectCM.cs
@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using FlaxEditor.GUI.ContextMenu;
+using FlaxEditor.GUI.Input;
using FlaxEditor.Scripting;
using FlaxEngine;
using FlaxEngine.GUI;
@@ -128,10 +129,9 @@ namespace FlaxEditor.Surface.ContextMenu
Size = new Float2(320, 220);
// Search box
- _searchBox = new TextBox(false, 1, 1)
+ _searchBox = new SearchBox(false, 1, 1)
{
Width = Width - 3,
- WatermarkText = "Search...",
Parent = this
};
_searchBox.TextChanged += OnSearchFilterChanged;
diff --git a/Source/Editor/Utilities/Utils.cs b/Source/Editor/Utilities/Utils.cs
index c37d4c113..1b6983ec6 100644
--- a/Source/Editor/Utilities/Utils.cs
+++ b/Source/Editor/Utilities/Utils.cs
@@ -14,6 +14,7 @@ using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using FlaxEditor.GUI.ContextMenu;
+using FlaxEditor.GUI.Input;
using FlaxEditor.GUI.Tree;
using FlaxEditor.SceneGraph;
using FlaxEditor.Scripting;
@@ -957,10 +958,9 @@ namespace FlaxEditor.Utilities
{
Size = new Float2(320, 220 + headerHeight),
};
- searchBox = new TextBox(false, 1, headerHeight + 1)
+ searchBox = new SearchBox(false, 1, headerHeight + 1)
{
Width = menu.Width - 3,
- WatermarkText = "Search...",
Parent = menu,
};
var panel1 = new Panel(ScrollBars.Vertical)
diff --git a/Source/Editor/Windows/AboutDialog.cs b/Source/Editor/Windows/AboutDialog.cs
index 6c02c4efe..ff41b81ea 100644
--- a/Source/Editor/Windows/AboutDialog.cs
+++ b/Source/Editor/Windows/AboutDialog.cs
@@ -93,6 +93,7 @@ namespace FlaxEditor.Windows
"Stefan Brandmair",
"Lukáš Jech",
"Jean-Baptiste Perrier",
+ "Chandler Cox",
});
authors.Sort();
var authorsLabel = new Label(4, topParentControl.Bottom + 20, Width - 8, 70)
diff --git a/Source/Editor/Windows/Assets/PrefabWindow.cs b/Source/Editor/Windows/Assets/PrefabWindow.cs
index 78d210592..73f6aee21 100644
--- a/Source/Editor/Windows/Assets/PrefabWindow.cs
+++ b/Source/Editor/Windows/Assets/PrefabWindow.cs
@@ -6,6 +6,7 @@ using FlaxEditor.Content;
using FlaxEditor.CustomEditors;
using FlaxEditor.Gizmo;
using FlaxEditor.GUI;
+using FlaxEditor.GUI.Input;
using FlaxEditor.SceneGraph;
using FlaxEditor.Viewport;
using FlaxEngine;
@@ -124,10 +125,9 @@ namespace FlaxEditor.Windows.Assets
IsScrollable = false,
Offsets = new Margin(0, 0, 0, 18 + 6),
};
- _searchBox = new TextBox
+ _searchBox = new SearchBox()
{
AnchorPreset = AnchorPresets.HorizontalStretchMiddle,
- WatermarkText = "Search...",
Parent = headerPanel,
Bounds = new Rectangle(4, 4, headerPanel.Width - 8, 18),
};
diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs
index 22808a1f1..5ae63dbce 100644
--- a/Source/Editor/Windows/ContentWindow.cs
+++ b/Source/Editor/Windows/ContentWindow.cs
@@ -113,10 +113,9 @@ namespace FlaxEditor.Windows
IsScrollable = false,
Offsets = new Margin(0, 0, 0, 18 + 6),
};
- _foldersSearchBox = new TextBox
+ _foldersSearchBox = new SearchBox
{
AnchorPreset = AnchorPresets.HorizontalStretchMiddle,
- WatermarkText = "Search...",
Parent = headerPanel,
Bounds = new Rectangle(4, 4, headerPanel.Width - 8, 18),
};
@@ -149,10 +148,9 @@ namespace FlaxEditor.Windows
Parent = _split.Panel2,
};
const float viewDropdownWidth = 50.0f;
- _itemsSearchBox = new TextBox
+ _itemsSearchBox = new SearchBox
{
AnchorPreset = AnchorPresets.HorizontalStretchMiddle,
- WatermarkText = "Search...",
Parent = contentItemsSearchPanel,
Bounds = new Rectangle(viewDropdownWidth + 8, 4, contentItemsSearchPanel.Width - 12 - viewDropdownWidth, 18),
};
@@ -837,13 +835,20 @@ namespace FlaxEditor.Windows
};
_root.Expand(true);
+ // Add game project on top, plugins in the middle and engine at bottom
+ _root.AddChild(Editor.ContentDatabase.Game);
foreach (var project in Editor.ContentDatabase.Projects)
+ {
+ project.SortChildrenRecursive();
+ if (project == Editor.ContentDatabase.Game || project == Editor.ContentDatabase.Engine)
+ continue;
_root.AddChild(project);
+ }
+ _root.AddChild(Editor.ContentDatabase.Engine);
Editor.ContentDatabase.Game?.Expand(true);
_tree.Margin = new Margin(0.0f, 0.0f, -16.0f, 2.0f); // Hide root node
_tree.AddChild(_root);
- _root.SortChildrenRecursive();
// Setup navigation
_navigationUnlocked = true;
diff --git a/Source/Editor/Windows/OutputLogWindow.cs b/Source/Editor/Windows/OutputLogWindow.cs
index c9f3ac6e2..22989124f 100644
--- a/Source/Editor/Windows/OutputLogWindow.cs
+++ b/Source/Editor/Windows/OutputLogWindow.cs
@@ -7,6 +7,7 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using FlaxEditor.GUI.ContextMenu;
+using FlaxEditor.GUI.Input;
using FlaxEditor.Options;
using FlaxEngine;
using FlaxEngine.GUI;
@@ -157,9 +158,8 @@ namespace FlaxEditor.Windows
Parent = this,
};
_viewDropdown.Clicked += OnViewButtonClicked;
- _searchBox = new TextBox(false, _viewDropdown.Right + 2, 2, Width - _viewDropdown.Right - 2 - _scrollSize)
+ _searchBox = new SearchBox(false, _viewDropdown.Right + 2, 2, Width - _viewDropdown.Right - 2 - _scrollSize)
{
- WatermarkText = "Search...",
Parent = this,
};
_searchBox.TextChanged += Refresh;
diff --git a/Source/Editor/Windows/SceneTreeWindow.cs b/Source/Editor/Windows/SceneTreeWindow.cs
index 8fd6e33ee..28ab83ff5 100644
--- a/Source/Editor/Windows/SceneTreeWindow.cs
+++ b/Source/Editor/Windows/SceneTreeWindow.cs
@@ -6,6 +6,7 @@ using FlaxEditor.Gizmo;
using FlaxEditor.Content;
using FlaxEditor.GUI.Tree;
using FlaxEditor.GUI.Drag;
+using FlaxEditor.GUI.Input;
using FlaxEditor.SceneGraph;
using FlaxEditor.SceneGraph.GUI;
using FlaxEditor.Scripting;
@@ -49,10 +50,9 @@ namespace FlaxEditor.Windows
IsScrollable = false,
Offsets = new Margin(0, 0, 0, 18 + 6),
};
- _searchBox = new TextBox
+ _searchBox = new SearchBox
{
AnchorPreset = AnchorPresets.HorizontalStretchMiddle,
- WatermarkText = "Search...",
Parent = headerPanel,
Bounds = new Rectangle(4, 4, headerPanel.Width - 8, 18),
};
diff --git a/Source/Editor/Windows/Search/ContentSearchWindow.cs b/Source/Editor/Windows/Search/ContentSearchWindow.cs
index cb539bf47..7128b7db9 100644
--- a/Source/Editor/Windows/Search/ContentSearchWindow.cs
+++ b/Source/Editor/Windows/Search/ContentSearchWindow.cs
@@ -10,6 +10,7 @@ using FlaxEditor;
using FlaxEditor.GUI;
using FlaxEditor.GUI.ContextMenu;
using FlaxEditor.GUI.Docking;
+using FlaxEditor.GUI.Input;
using FlaxEditor.GUI.Tree;
using FlaxEditor.Scripting;
using FlaxEditor.Surface;
@@ -224,10 +225,9 @@ namespace FlaxEngine.Windows.Search
Parent = topPanel,
};
optionsButton.ButtonClicked += OnOptionsDropdownClicked;
- _searchBox = new TextBox
+ _searchBox = new SearchBox
{
AnchorPreset = AnchorPresets.HorizontalStretchMiddle,
- WatermarkText = "Search...",
Parent = topPanel,
Bounds = new Rectangle(optionsButton.Right + 2.0f, 2, topPanel.Width - 4.0f - optionsButton.Width, 18.0f),
};
diff --git a/Source/Editor/Windows/ToolboxWindow.cs b/Source/Editor/Windows/ToolboxWindow.cs
index 99490ec07..0bd01f293 100644
--- a/Source/Editor/Windows/ToolboxWindow.cs
+++ b/Source/Editor/Windows/ToolboxWindow.cs
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
+using FlaxEditor.GUI.Input;
using FlaxEditor.GUI.Tabs;
using FlaxEditor.GUI.Tree;
using FlaxEditor.Scripting;
@@ -130,10 +131,9 @@ namespace FlaxEditor.Windows
};
_groupSearch = CreateGroupWithList(_actorGroups, "Search", 26);
- _searchBox = new TextBox
+ _searchBox = new SearchBox
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
- WatermarkText = "Search...",
Parent = _groupSearch.Parent.Parent,
Bounds = new Rectangle(4, 4, _actorGroups.Width - 8, 18),
};
diff --git a/Source/Engine/ContentImporters/ImportShader.cpp b/Source/Engine/ContentImporters/ImportShader.cpp
index fe1253644..c6394c91b 100644
--- a/Source/Engine/ContentImporters/ImportShader.cpp
+++ b/Source/Engine/ContentImporters/ImportShader.cpp
@@ -32,12 +32,14 @@ CreateAssetResult ImportShader::Import(CreateAssetContext& context)
LOG(Warning, "Empty shader source file.");
return CreateAssetResult::Error;
}
- context.Data.Header.Chunks[SourceCodeChunk]->Data.Allocate(sourceCodeSize + 1);
- const auto sourceCode = context.Data.Header.Chunks[SourceCodeChunk]->Get();
+ const auto& sourceCodeChunk = context.Data.Header.Chunks[SourceCodeChunk];
+ sourceCodeChunk->Data.Allocate(sourceCodeSize + 1);
+ const auto sourceCode = sourceCodeChunk->Get();
Platform::MemoryCopy(sourceCode, sourceCodeText.Get(), sourceCodeSize);
// Encrypt source code
Encryption::EncryptBytes(sourceCode, sourceCodeSize);
+ sourceCode[sourceCodeSize] = 0;
// Set Custom Data with Header
ShaderStorage::Header20 shaderHeader;
diff --git a/Source/Engine/Input/Input.cpp b/Source/Engine/Input/Input.cpp
index 91bde0625..51f1831f0 100644
--- a/Source/Engine/Input/Input.cpp
+++ b/Source/Engine/Input/Input.cpp
@@ -55,8 +55,8 @@ struct AxisData
namespace InputImpl
{
- Dictionary Actions;
- Dictionary Axes;
+ Dictionary Actions;
+ Dictionary Axes;
bool GamepadsChanged = true;
Array AxesValues;
InputDevice::EventQueue InputEvents;
diff --git a/Source/Engine/Level/Actor.cs b/Source/Engine/Level/Actor.cs
index 936d38565..cd774fca6 100644
--- a/Source/Engine/Level/Actor.cs
+++ b/Source/Engine/Level/Actor.cs
@@ -123,6 +123,9 @@ namespace FlaxEngine
/// The child actor.
public Actor AddChild(Type type)
{
+ if (type.IsAbstract)
+ return null;
+
var result = (Actor)New(type);
result.SetParent(this, false, false);
return result;
@@ -135,6 +138,9 @@ namespace FlaxEngine
/// The child actor.
public T AddChild() where T : Actor
{
+ if (typeof(T).IsAbstract)
+ return null;
+
var result = New();
result.SetParent(this, false, false);
return result;
@@ -172,6 +178,9 @@ namespace FlaxEngine
var result = GetChild();
if (result == null)
{
+ if (typeof(T).IsAbstract)
+ return null;
+
result = New();
result.SetParent(this, false, false);
}
@@ -185,6 +194,9 @@ namespace FlaxEngine
/// The created script instance, null otherwise.
public Script AddScript(Type type)
{
+ if (type.IsAbstract)
+ return null;
+
var script = (Script)New(type);
script.Parent = this;
return script;
@@ -197,6 +209,9 @@ namespace FlaxEngine
/// The created script instance, null otherwise.
public T AddScript() where T : Script
{
+ if (typeof(T).IsAbstract)
+ return null;
+
var script = New();
script.Parent = this;
return script;
diff --git a/Source/Engine/Level/Actor.h b/Source/Engine/Level/Actor.h
index 5281f5c83..00b88072a 100644
--- a/Source/Engine/Level/Actor.h
+++ b/Source/Engine/Level/Actor.h
@@ -207,6 +207,9 @@ public:
T* result = (T*)GetChild(T::GetStaticClass());
if (!result)
{
+ if (T::GetStaticClass()->IsAbstract())
+ return nullptr;
+
result = New();
result->SetParent(this, false, false);
}
diff --git a/Source/Engine/Level/Level.cpp b/Source/Engine/Level/Level.cpp
index 6c53adf1c..2bf094d86 100644
--- a/Source/Engine/Level/Level.cpp
+++ b/Source/Engine/Level/Level.cpp
@@ -176,6 +176,12 @@ bool LevelImpl::spawnActor(Actor* actor, Actor* parent)
return true;
}
+ if (actor->GetType().ManagedClass->IsAbstract())
+ {
+ Log::Exception(TEXT("Cannot spawn abstract actor type."));
+ return true;
+ }
+
if (actor->Is())
{
// Spawn scene
diff --git a/Source/Engine/UI/GUI/Common/Button.cs b/Source/Engine/UI/GUI/Common/Button.cs
index f9bc54655..30ff25aa1 100644
--- a/Source/Engine/UI/GUI/Common/Button.cs
+++ b/Source/Engine/UI/GUI/Common/Button.cs
@@ -71,6 +71,16 @@ namespace FlaxEngine.GUI
///
public event Action