From 7fef21218e327c94f3d2f1821ca5c9d8cb51eed6 Mon Sep 17 00:00:00 2001 From: z1dev Date: Thu, 21 Mar 2024 14:13:24 +0100 Subject: [PATCH 01/50] Alternative Rectangle function names for naming consistency. --- Source/Engine/Core/Math/Rectangle.cs | 20 ++++++++++++++++++++ Source/Engine/Core/Math/Rectangle.h | 24 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/Source/Engine/Core/Math/Rectangle.cs b/Source/Engine/Core/Math/Rectangle.cs index 024bc9dc8..c0811815c 100644 --- a/Source/Engine/Core/Math/Rectangle.cs +++ b/Source/Engine/Core/Math/Rectangle.cs @@ -79,6 +79,26 @@ namespace FlaxEngine /// public Float2 UpperRight => new Float2(Location.X + Size.X, Location.Y); + /// + /// Gets position of the bottom right corner of the rectangle + /// + public Float2 LowerRight => Location + Size; + + /// + /// Gets position of the bottom left corner of the rectangle + /// + public Float2 LowerLeft => new Float2(Location.X, Location.Y + Size.Y); + + /// + /// Gets position of the upper left corner of the rectangle + /// + public Float2 TopLeft => Location; + + /// + /// Gets position of the upper right corner of the rectangle + /// + public Float2 TopRight => new Float2(Location.X + Size.X, Location.Y); + /// /// Gets position of the bottom right corner of the rectangle /// diff --git a/Source/Engine/Core/Math/Rectangle.h b/Source/Engine/Core/Math/Rectangle.h index 496b8bb8a..823d233dc 100644 --- a/Source/Engine/Core/Math/Rectangle.h +++ b/Source/Engine/Core/Math/Rectangle.h @@ -117,6 +117,30 @@ public: return Location + Float2(Size.X, 0); } + // Gets position of the bottom right corner of the rectangle + Float2 GetLowerRight() const + { + return Location + Size; + } + + // Gets position of the bottom left corner of the rectangle + Float2 GetLowerLeft() const + { + return Location + Float2(0, Size.Y); + } + + // Gets position of the upper left corner of the rectangle + Float2 GetTopLeft() const + { + return Location; + } + + // Gets position of the upper right corner of the rectangle + Float2 GetTopRight() const + { + return Location + Float2(Size.X, 0); + } + // Gets position of the bottom right corner of the rectangle Float2 GetBottomRight() const { From ac36297e27cda4a076d53822cd80dcb6a8d68e16 Mon Sep 17 00:00:00 2001 From: Menotdan <32620310+Menotdan@users.noreply.github.com> Date: Tue, 26 Mar 2024 21:09:18 -0400 Subject: [PATCH 02/50] Add basic support for log contexts. --- Source/Editor/Modules/ContentFindingModule.cs | 19 +++- Source/Engine/Core/Types/LogContexts.cpp | 43 +++++++++ Source/Engine/Core/Types/LogContexts.h | 91 +++++++++++++++++++ Source/Engine/Scripting/Object.cs | 12 ++- Source/Engine/Scripting/Script.cpp | 6 ++ Source/Engine/Scripting/Scripting.cpp | 5 +- Source/Engine/Scripting/ScriptingObject.cpp | 18 ++-- 7 files changed, 180 insertions(+), 14 deletions(-) create mode 100644 Source/Engine/Core/Types/LogContexts.cpp create mode 100644 Source/Engine/Core/Types/LogContexts.h diff --git a/Source/Editor/Modules/ContentFindingModule.cs b/Source/Editor/Modules/ContentFindingModule.cs index 480844ac4..73e22d769 100644 --- a/Source/Editor/Modules/ContentFindingModule.cs +++ b/Source/Editor/Modules/ContentFindingModule.cs @@ -228,7 +228,7 @@ namespace FlaxEditor.Modules new SearchResult { Name = item.ShortName, Type = assetItem.TypeName, Item = item } }; } - var actor = FlaxEngine.Object.Find(ref id); + var actor = FlaxEngine.Object.Find(ref id, true); if (actor != null) { return new List @@ -236,6 +236,16 @@ namespace FlaxEditor.Modules new SearchResult { Name = actor.Name, Type = actor.TypeName, Item = actor } }; } + var script = FlaxEngine.Object.Find