From 3f87ee53fff8716fa4fb1e68123cd73b80d63cb4 Mon Sep 17 00:00:00 2001 From: Jerry Swan Date: Tue, 18 Jan 2022 20:38:58 -0500 Subject: [PATCH 1/3] 4.27 Updates - Updating the header to reflect the new interfaces path, build to point to the right path, and the uplugin to increase the version --- Source/TextAsset/TextAsset.Build.cs | 2 +- Source/TextAssetEditor/Private/Styles/TextAssetEditorStyle.h | 2 +- TextAsset.uplugin | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/TextAsset/TextAsset.Build.cs b/Source/TextAsset/TextAsset.Build.cs index b88c8c9..042e005 100644 --- a/Source/TextAsset/TextAsset.Build.cs +++ b/Source/TextAsset/TextAsset.Build.cs @@ -16,7 +16,7 @@ public TextAsset(ReadOnlyTargetRules Target) : base(Target) PrivateIncludePaths.AddRange( new string[] { - "Runtime/TextAsset/Private", + "TextAsset/Private" }); } } diff --git a/Source/TextAssetEditor/Private/Styles/TextAssetEditorStyle.h b/Source/TextAssetEditor/Private/Styles/TextAssetEditorStyle.h index 0e0fd41..1c01dc7 100644 --- a/Source/TextAssetEditor/Private/Styles/TextAssetEditorStyle.h +++ b/Source/TextAssetEditor/Private/Styles/TextAssetEditorStyle.h @@ -2,7 +2,7 @@ #pragma once -#include "IPluginManager.h" +#include "Interfaces/IPluginManager.h" #include "Brushes/SlateImageBrush.h" #include "Styling/SlateStyle.h" #include "Styling/SlateStyleRegistry.h" diff --git a/TextAsset.uplugin b/TextAsset.uplugin index ea96d56..27df85c 100644 --- a/TextAsset.uplugin +++ b/TextAsset.uplugin @@ -1,8 +1,8 @@ { "FileVersion" : 3, "Version" : 8, - "VersionName" : "8.0", - "EngineVersion" : "4.19.0", + "VersionName" : "8.1", + "EngineVersion" : "4.27", "FriendlyName" : "Text Asset", "Description" : "Adds an editable text content asset for personal notes.", "Category" : "Editor", @@ -27,6 +27,5 @@ "Type" : "Editor", "LoadingPhase" : "Default" } - ] } From 8704b7f6ad410b4af962bdfe890e5cfe28c57396 Mon Sep 17 00:00:00 2001 From: Jerry Swan Date: Wed, 19 Jan 2022 13:52:16 -0500 Subject: [PATCH 2/3] Updating comments to better understand what the purpose of the functions are --- .../Private/AssetTools/TextAssetActions.h | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/Source/TextAssetEditor/Private/AssetTools/TextAssetActions.h b/Source/TextAssetEditor/Private/AssetTools/TextAssetActions.h index 86f95dc..612b41b 100644 --- a/Source/TextAssetEditor/Private/AssetTools/TextAssetActions.h +++ b/Source/TextAssetEditor/Private/AssetTools/TextAssetActions.h @@ -23,16 +23,47 @@ class FTextAssetActions */ FTextAssetActions(const TSharedRef& InStyle); -public: - //~ FAssetTypeActions_Base overrides virtual bool CanFilter() override; + + /** + * Get the actions for the passed in InObjects and display them within the MenuBuilder + * @param InObjects Reference to objects that have actions to display + * @param MenuBuilder Menu that will show the available actions + */ virtual void GetActions(const TArray& InObjects, FMenuBuilder& MenuBuilder) override; + + /** + * Where in the content browser content menu this asset will show up, using the EAssetTypeCategories enum + * @return Category that the asset belongs to + */ virtual uint32 GetCategories() override; + + /** + * Get the name of the asset, will be shown in the thumbnail within the editor + * @return FText for the name of the asset + */ virtual FText GetName() const override; + + /** + * Tells the editor which class the asset is.
+ * This must be implemented so the editor knows which class is to be used + * @return UClass that is supported + */ virtual UClass* GetSupportedClass() const override; + + /** + * Get the color to be used in the thumbnail for the asset + * @return FColor to be used + */ virtual FColor GetTypeColor() const override; + + /** + * Whether or not the passed in InObjects should display any context menu action + * @param InObjects Reference to objects that will be checked for actions + * @return If any of the InObjects have actions available + */ virtual bool HasActions(const TArray& InObjects) const override; virtual void OpenAssetEditor(const TArray& InObjects, TSharedPtr EditWithinLevelEditor = TSharedPtr()) override; From b8160b1b1b74a13cc396658536589364c1e9a315 Mon Sep 17 00:00:00 2001 From: Jerry Swan Date: Wed, 19 Jan 2022 14:44:11 -0500 Subject: [PATCH 3/3] Some more comments --- .../Private/AssetTools/TextAssetActions.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/TextAssetEditor/Private/AssetTools/TextAssetActions.h b/Source/TextAssetEditor/Private/AssetTools/TextAssetActions.h index 612b41b..fc4fe84 100644 --- a/Source/TextAssetEditor/Private/AssetTools/TextAssetActions.h +++ b/Source/TextAssetEditor/Private/AssetTools/TextAssetActions.h @@ -12,10 +12,8 @@ class ISlateStyle; * Implements an action for UTextAsset assets. */ class FTextAssetActions - : public FAssetTypeActions_Base -{ + : public FAssetTypeActions_Base { public: - /** * Creates and initializes a new instance. * @@ -65,10 +63,16 @@ class FTextAssetActions * @return If any of the InObjects have actions available */ virtual bool HasActions(const TArray& InObjects) const override; + + /** + * Called whenever a user wishes to open an asset(or assets) for editing + * @param InObjects Assets that the user is trying to open + * @param EditWithinLevelEditor Pointer to the toolkit host, defaulted to exist. + * Checked within the function to determine which type of asset editor to open + */ virtual void OpenAssetEditor(const TArray& InObjects, TSharedPtr EditWithinLevelEditor = TSharedPtr()) override; private: - /** Pointer to the style set to use for toolkits. */ TSharedRef Style; };