├── .gitignore ├── Docs └── screenshot.png ├── LICENSE ├── README.md ├── Resources └── Icon128.png ├── Source ├── TextAsset │ ├── Private │ │ └── TextAssetModule.cpp │ ├── Public │ │ └── TextAsset.h │ └── TextAsset.Build.cs └── TextAssetEditor │ ├── Private │ ├── AssetTools │ │ ├── TextAssetActions.cpp │ │ └── TextAssetActions.h │ ├── Factories │ │ ├── TextAssetFactory.cpp │ │ ├── TextAssetFactory.h │ │ ├── TextAssetFactoryNew.cpp │ │ └── TextAssetFactoryNew.h │ ├── Shared │ │ ├── TextAssetEditorSettings.cpp │ │ └── TextAssetEditorSettings.h │ ├── Styles │ │ └── TextAssetEditorStyle.h │ ├── TextAssetEditorModule.cpp │ ├── Toolkits │ │ ├── TextAssetEditorToolkit.cpp │ │ └── TextAssetEditorToolkit.h │ └── Widgets │ │ ├── STextAssetEditor.cpp │ │ └── STextAssetEditor.h │ └── TextAssetEditor.Build.cs └── TextAsset.uplugin /.gitignore: -------------------------------------------------------------------------------- 1 | Binaries/ 2 | Intermediate/ -------------------------------------------------------------------------------- /Docs/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ue4plugins/TextAsset/bb17414c303c801f8eeda7f28b170a1558cfec5f/Docs/screenshot.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015 Epic Games, Inc. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TextAsset 2 | 3 | Unreal Engine 4 plug-in that adds a text asset and editor for personal notes. 4 | 5 | ![Screenshot](Docs/screenshot.png) 6 | 7 | 8 | ## About 9 | 10 | The TextAsset plug-in implements two modules that demonstrate how to add a new 11 | type of content asset to Unreal Engine 4. The asset itself stores a simple text 12 | string that can be used for adding personal notes or other textual information 13 | to your project, or to be consumed within Blueprints. The plug-in also includes 14 | an asset editor, asset factories, and asset actions for the Content Browser. 15 | 16 | Make sure to pull the *Tag* that matches your Unreal Engine version. If you sync 17 | to *Master* the code may not compile, because it may depend on Engine changes 18 | that are not yet available in the UE4 Master branch. 19 | 20 | ## Supported Platforms 21 | 22 | This plug-in was last built against **Unreal Engine 4.19**. It works on all 23 | platforms. 24 | 25 | 26 | ## Dependencies 27 | 28 | This plug-in requires Visual Studio and either a C++ code project or the full 29 | Unreal Engine 4 source code from GitHub. If you are new to programming in UE4, 30 | please see the official [Programming Guide](https://docs.unrealengine.com/latest/INT/Programming/index.html)! 31 | 32 | 33 | ## Usage 34 | 35 | You can use this plug-in as a project plug-in, or an Engine plug-in. 36 | 37 | If you use it as a project plug-in, clone this repository into your project's 38 | */Plugins* directory and compile your game in Visual Studio. A C++ code project 39 | is required for this to work. 40 | 41 | If you use it as an Engine plug-in, clone this repository into the 42 | */Engine/Plugins/Media* directory and compile your game. Full Unreal Engine 4 43 | source code from GitHub (4.9 or higher) is required for this. 44 | 45 | 46 | ## Support 47 | 48 | Please [file an issue](https://github.com/ue4plugins/TextAsset/issues), 49 | submit a [pull request](https://github.com/ue4plugins/TextAsset/pulls?q=is%3Aopen+is%3Apr) 50 | or email us at info@headcrash.industries 51 | 52 | 53 | ## References 54 | 55 | * [Introduction to UE4 Plugins](https://wiki.unrealengine.com/An_Introduction_to_UE4_Plugins) 56 | -------------------------------------------------------------------------------- /Resources/Icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ue4plugins/TextAsset/bb17414c303c801f8eeda7f28b170a1558cfec5f/Resources/Icon128.png -------------------------------------------------------------------------------- /Source/TextAsset/Private/TextAssetModule.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "Modules/ModuleInterface.h" 4 | #include "Modules/ModuleManager.h" 5 | 6 | 7 | /** 8 | * Implements the TextAsset module. 9 | */ 10 | class FTextAssetModule 11 | : public IModuleInterface 12 | { 13 | public: 14 | 15 | //~ IModuleInterface interface 16 | 17 | virtual void StartupModule() override { } 18 | virtual void ShutdownModule() override { } 19 | 20 | virtual bool SupportsDynamicReloading() override 21 | { 22 | return true; 23 | } 24 | }; 25 | 26 | 27 | IMPLEMENT_MODULE(FTextAssetModule, TextAsset); 28 | -------------------------------------------------------------------------------- /Source/TextAsset/Public/TextAsset.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "Internationalization/Text.h" 6 | #include "UObject/Object.h" 7 | #include "UObject/ObjectMacros.h" 8 | 9 | #include "TextAsset.generated.h" 10 | 11 | 12 | /** 13 | * Implements an asset that can be used to store arbitrary text, such as notes 14 | * or documentation. 15 | */ 16 | UCLASS(BlueprintType, hidecategories=(Object)) 17 | class TEXTASSET_API UTextAsset 18 | : public UObject 19 | { 20 | GENERATED_BODY() 21 | 22 | public: 23 | 24 | /** Holds the stored text. */ 25 | UPROPERTY(BlueprintReadOnly, EditAnywhere, Category="TextAsset") 26 | FText Text; 27 | }; 28 | -------------------------------------------------------------------------------- /Source/TextAsset/TextAsset.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | namespace UnrealBuildTool.Rules 4 | { 5 | public class TextAsset : ModuleRules 6 | { 7 | public TextAsset(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | PublicDependencyModuleNames.AddRange( 12 | new string[] { 13 | "Core", 14 | "CoreUObject", 15 | }); 16 | 17 | PrivateIncludePaths.AddRange( 18 | new string[] { 19 | "Runtime/TextAsset/Private", 20 | }); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/AssetTools/TextAssetActions.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "TextAssetActions.h" 4 | 5 | #include "Framework/MultiBox/MultiBoxBuilder.h" 6 | #include "TextAsset.h" 7 | #include "Styling/SlateStyle.h" 8 | 9 | #include "TextAssetEditorToolkit.h" 10 | 11 | 12 | #define LOCTEXT_NAMESPACE "AssetTypeActions" 13 | 14 | 15 | /* FTextAssetActions constructors 16 | *****************************************************************************/ 17 | 18 | FTextAssetActions::FTextAssetActions(const TSharedRef& InStyle) 19 | : Style(InStyle) 20 | { } 21 | 22 | 23 | /* FAssetTypeActions_Base overrides 24 | *****************************************************************************/ 25 | 26 | bool FTextAssetActions::CanFilter() 27 | { 28 | return true; 29 | } 30 | 31 | 32 | void FTextAssetActions::GetActions(const TArray& InObjects, FMenuBuilder& MenuBuilder) 33 | { 34 | FAssetTypeActions_Base::GetActions(InObjects, MenuBuilder); 35 | 36 | auto TextAssets = GetTypedWeakObjectPtrs(InObjects); 37 | 38 | MenuBuilder.AddMenuEntry( 39 | LOCTEXT("TextAsset_ReverseText", "Reverse Text"), 40 | LOCTEXT("TextAsset_ReverseTextToolTip", "Reverse the text stored in the selected text asset(s)."), 41 | FSlateIcon(), 42 | FUIAction( 43 | FExecuteAction::CreateLambda([=]{ 44 | for (auto& TextAsset : TextAssets) 45 | { 46 | if (TextAsset.IsValid() && !TextAsset->Text.IsEmpty()) 47 | { 48 | TextAsset->Text = FText::FromString(TextAsset->Text.ToString().Reverse()); 49 | TextAsset->PostEditChange(); 50 | TextAsset->MarkPackageDirty(); 51 | } 52 | } 53 | }), 54 | FCanExecuteAction::CreateLambda([=] { 55 | for (auto& TextAsset : TextAssets) 56 | { 57 | if (TextAsset.IsValid() && !TextAsset->Text.IsEmpty()) 58 | { 59 | return true; 60 | } 61 | } 62 | return false; 63 | }) 64 | ) 65 | ); 66 | } 67 | 68 | 69 | uint32 FTextAssetActions::GetCategories() 70 | { 71 | return EAssetTypeCategories::Misc; 72 | } 73 | 74 | 75 | FText FTextAssetActions::GetName() const 76 | { 77 | return NSLOCTEXT("AssetTypeActions", "AssetTypeActions_TextAsset", "Text Asset"); 78 | } 79 | 80 | 81 | UClass* FTextAssetActions::GetSupportedClass() const 82 | { 83 | return UTextAsset::StaticClass(); 84 | } 85 | 86 | 87 | FColor FTextAssetActions::GetTypeColor() const 88 | { 89 | return FColor::White; 90 | } 91 | 92 | 93 | bool FTextAssetActions::HasActions(const TArray& InObjects) const 94 | { 95 | return true; 96 | } 97 | 98 | 99 | void FTextAssetActions::OpenAssetEditor(const TArray& InObjects, TSharedPtr EditWithinLevelEditor) 100 | { 101 | EToolkitMode::Type Mode = EditWithinLevelEditor.IsValid() 102 | ? EToolkitMode::WorldCentric 103 | : EToolkitMode::Standalone; 104 | 105 | for (auto ObjIt = InObjects.CreateConstIterator(); ObjIt; ++ObjIt) 106 | { 107 | auto TextAsset = Cast(*ObjIt); 108 | 109 | if (TextAsset != nullptr) 110 | { 111 | TSharedRef EditorToolkit = MakeShareable(new FTextAssetEditorToolkit(Style)); 112 | EditorToolkit->Initialize(TextAsset, Mode, EditWithinLevelEditor); 113 | } 114 | } 115 | } 116 | 117 | 118 | #undef LOCTEXT_NAMESPACE 119 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/AssetTools/TextAssetActions.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "AssetTypeActions_Base.h" 6 | #include "Templates/SharedPointer.h" 7 | 8 | class ISlateStyle; 9 | 10 | 11 | /** 12 | * Implements an action for UTextAsset assets. 13 | */ 14 | class FTextAssetActions 15 | : public FAssetTypeActions_Base 16 | { 17 | public: 18 | 19 | /** 20 | * Creates and initializes a new instance. 21 | * 22 | * @param InStyle The style set to use for asset editor toolkits. 23 | */ 24 | FTextAssetActions(const TSharedRef& InStyle); 25 | 26 | public: 27 | 28 | //~ FAssetTypeActions_Base overrides 29 | 30 | virtual bool CanFilter() override; 31 | virtual void GetActions(const TArray& InObjects, FMenuBuilder& MenuBuilder) override; 32 | virtual uint32 GetCategories() override; 33 | virtual FText GetName() const override; 34 | virtual UClass* GetSupportedClass() const override; 35 | virtual FColor GetTypeColor() const override; 36 | virtual bool HasActions(const TArray& InObjects) const override; 37 | virtual void OpenAssetEditor(const TArray& InObjects, TSharedPtr EditWithinLevelEditor = TSharedPtr()) override; 38 | 39 | private: 40 | 41 | /** Pointer to the style set to use for toolkits. */ 42 | TSharedRef Style; 43 | }; 44 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/Factories/TextAssetFactory.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "TextAssetFactory.h" 4 | 5 | #include "Containers/UnrealString.h" 6 | #include "TextAsset.h" 7 | #include "Misc/FileHelper.h" 8 | 9 | 10 | /* UTextAssetFactory structors 11 | *****************************************************************************/ 12 | 13 | UTextAssetFactory::UTextAssetFactory( const FObjectInitializer& ObjectInitializer ) 14 | : Super(ObjectInitializer) 15 | { 16 | Formats.Add(FString(TEXT("txt;")) + NSLOCTEXT("UTextAssetFactory", "FormatTxt", "Text File").ToString()); 17 | SupportedClass = UTextAsset::StaticClass(); 18 | bCreateNew = false; 19 | bEditorImport = true; 20 | } 21 | 22 | 23 | /* UFactory overrides 24 | *****************************************************************************/ 25 | 26 | /* This is the old API (only for demonstration purposes) 27 | UObject* UTextAssetFactory::FactoryCreateBinary(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, const TCHAR* Type, const uint8*& Buffer, const uint8* BufferEnd, FFeedbackContext* Warn) 28 | { 29 | UTextAsset* TextAsset = nullptr; 30 | FString TextString; 31 | 32 | if (FFileHelper::LoadFileToString(TextString, *CurrentFilename)) 33 | { 34 | TextAsset = NewObject(InParent, Class, Name, Flags); 35 | TextAsset->Text = FText::FromString(TextString); 36 | } 37 | 38 | return TextAsset; 39 | }*/ 40 | 41 | 42 | UObject* UTextAssetFactory::FactoryCreateFile(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, const FString& Filename, const TCHAR* Parms, FFeedbackContext* Warn, bool& bOutOperationCanceled) 43 | { 44 | UTextAsset* TextAsset = nullptr; 45 | FString TextString; 46 | 47 | if (FFileHelper::LoadFileToString(TextString, *Filename)) 48 | { 49 | TextAsset = NewObject(InParent, InClass, InName, Flags); 50 | TextAsset->Text = FText::FromString(TextString); 51 | } 52 | 53 | bOutOperationCanceled = false; 54 | 55 | return TextAsset; 56 | } 57 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/Factories/TextAssetFactory.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "Factories/Factory.h" 6 | #include "UObject/ObjectMacros.h" 7 | 8 | #include "TextAssetFactory.generated.h" 9 | 10 | 11 | /** 12 | * Implements a factory for UTextAsset objects. 13 | */ 14 | UCLASS(hidecategories=Object) 15 | class UTextAssetFactory 16 | : public UFactory 17 | { 18 | GENERATED_UCLASS_BODY() 19 | 20 | public: 21 | 22 | //~ UFactory Interface 23 | 24 | // virtual UObject* FactoryCreateBinary(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, const TCHAR* Type, const uint8*& Buffer, const uint8* BufferEnd, FFeedbackContext* Warn) override; 25 | virtual UObject* FactoryCreateFile(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, const FString& Filename, const TCHAR* Parms, FFeedbackContext* Warn, bool& bOutOperationCanceled) override; 26 | }; 27 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/Factories/TextAssetFactoryNew.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "TextAssetFactoryNew.h" 4 | 5 | #include "TextAsset.h" 6 | 7 | 8 | /* UTextAssetFactoryNew structors 9 | *****************************************************************************/ 10 | 11 | UTextAssetFactoryNew::UTextAssetFactoryNew(const FObjectInitializer& ObjectInitializer) 12 | : Super(ObjectInitializer) 13 | { 14 | SupportedClass = UTextAsset::StaticClass(); 15 | bCreateNew = true; 16 | bEditAfterNew = true; 17 | } 18 | 19 | 20 | /* UFactory overrides 21 | *****************************************************************************/ 22 | 23 | UObject* UTextAssetFactoryNew::FactoryCreateNew(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) 24 | { 25 | return NewObject(InParent, InClass, InName, Flags); 26 | } 27 | 28 | 29 | bool UTextAssetFactoryNew::ShouldShowInNewMenu() const 30 | { 31 | return true; 32 | } 33 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/Factories/TextAssetFactoryNew.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "Factories/Factory.h" 6 | #include "UObject/ObjectMacros.h" 7 | 8 | #include "TextAssetFactoryNew.generated.h" 9 | 10 | 11 | /** 12 | * Implements a factory for UTextAsset objects. 13 | */ 14 | UCLASS(hidecategories=Object) 15 | class UTextAssetFactoryNew 16 | : public UFactory 17 | { 18 | GENERATED_UCLASS_BODY() 19 | 20 | public: 21 | 22 | //~ UFactory Interface 23 | 24 | virtual UObject* FactoryCreateNew(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override; 25 | virtual bool ShouldShowInNewMenu() const override; 26 | }; 27 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/Shared/TextAssetEditorSettings.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "TextAssetEditorSettings.h" 4 | 5 | #include "Misc/Paths.h" 6 | 7 | 8 | UTextAssetEditorSettings::UTextAssetEditorSettings() 9 | : BackgroundColor(FLinearColor::White) 10 | , ForegroundColor(FLinearColor::Black) 11 | , Font(FSlateFontInfo(FPaths::EngineContentDir() / TEXT("Slate/Fonts/DroidSansMono.ttf"), 10)) 12 | , Margin(4.0f) 13 | { } 14 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/Shared/TextAssetEditorSettings.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "Fonts/SlateFontInfo.h" 6 | #include "Styling/SlateColor.h" 7 | #include "UObject/ObjectMacros.h" 8 | 9 | #include "TextAssetEditorSettings.generated.h" 10 | 11 | 12 | UCLASS(config=Editor) 13 | class TEXTASSETEDITOR_API UTextAssetEditorSettings 14 | : public UObject 15 | { 16 | GENERATED_BODY() 17 | 18 | public: 19 | 20 | /** Color of the TextAsset editor's background. */ 21 | UPROPERTY(config, EditAnywhere, Category=Appearance) 22 | FSlateColor BackgroundColor; 23 | 24 | /** Color of the TextAsset editor's text. */ 25 | UPROPERTY(config, EditAnywhere, Category=Appearance) 26 | FSlateColor ForegroundColor; 27 | 28 | /** The font to use in the TextAsset editor window. */ 29 | UPROPERTY(config, EditAnywhere, Category=Appearance) 30 | FSlateFontInfo Font; 31 | 32 | /** The margin around the TextAsset editor window (in pixels). */ 33 | UPROPERTY(config, EditAnywhere, Category=Appearance) 34 | float Margin; 35 | 36 | public: 37 | 38 | /** Default constructor. */ 39 | UTextAssetEditorSettings(); 40 | }; 41 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/Styles/TextAssetEditorStyle.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "IPluginManager.h" 6 | #include "Brushes/SlateImageBrush.h" 7 | #include "Styling/SlateStyle.h" 8 | #include "Styling/SlateStyleRegistry.h" 9 | 10 | #define IMAGE_BRUSH(RelativePath, ...) FSlateImageBrush(RootToContentDir(RelativePath, TEXT(".png")), __VA_ARGS__) 11 | #define BOX_BRUSH(RelativePath, ...) FSlateBoxBrush(RootToContentDir(RelativePath, TEXT(".png")), __VA_ARGS__) 12 | #define BORDER_BRUSH(RelativePath, ...) FSlateBorderBrush(RootToContentDir(RelativePath, TEXT(".png")), __VA_ARGS__) 13 | #define TTF_FONT(RelativePath, ...) FSlateFontInfo(RootToContentDir(RelativePath, TEXT(".ttf")), __VA_ARGS__) 14 | #define OTF_FONT(RelativePath, ...) FSlateFontInfo(RootToContentDir(RelativePath, TEXT(".otf")), __VA_ARGS__) 15 | 16 | 17 | /** 18 | * Implements the visual style of the text asset editor UI. 19 | */ 20 | class FTextAssetEditorStyle 21 | : public FSlateStyleSet 22 | { 23 | public: 24 | 25 | /** Default constructor. */ 26 | FTextAssetEditorStyle() 27 | : FSlateStyleSet("TextAssetEditorStyle") 28 | { 29 | const FVector2D Icon16x16(16.0f, 16.0f); 30 | const FVector2D Icon20x20(20.0f, 20.0f); 31 | const FVector2D Icon40x40(40.0f, 40.0f); 32 | 33 | const FString BaseDir = IPluginManager::Get().FindPlugin("TextAsset")->GetBaseDir(); 34 | SetContentRoot(BaseDir / TEXT("Content")); 35 | 36 | // set new styles here, for example... 37 | //Set("TextAssetEditor.FancyButton", new IMAGE_BRUSH("icon_forward_40x", Icon40x40)); 38 | 39 | FSlateStyleRegistry::RegisterSlateStyle(*this); 40 | } 41 | 42 | /** Destructor. */ 43 | ~FTextAssetEditorStyle() 44 | { 45 | FSlateStyleRegistry::UnRegisterSlateStyle(*this); 46 | } 47 | }; 48 | 49 | 50 | #undef IMAGE_BRUSH 51 | #undef BOX_BRUSH 52 | #undef BORDER_BRUSH 53 | #undef TTF_FONT 54 | #undef OTF_FONT 55 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/TextAssetEditorModule.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "Containers/Array.h" 4 | #include "ISettingsModule.h" 5 | #include "ISettingsSection.h" 6 | #include "Modules/ModuleInterface.h" 7 | #include "Modules/ModuleManager.h" 8 | #include "Templates/SharedPointer.h" 9 | #include "Toolkits/AssetEditorToolkit.h" 10 | 11 | #include "AssetTools/TextAssetActions.h" 12 | #include "Styles/TextAssetEditorStyle.h" 13 | #include "TextAssetEditorSettings.h" 14 | 15 | 16 | #define LOCTEXT_NAMESPACE "FTextAssetEditorModule" 17 | 18 | 19 | /** 20 | * Implements the TextAssetEditor module. 21 | */ 22 | class FTextAssetEditorModule 23 | : public IHasMenuExtensibility 24 | , public IHasToolBarExtensibility 25 | , public IModuleInterface 26 | { 27 | public: 28 | 29 | //~ IHasMenuExtensibility interface 30 | 31 | virtual TSharedPtr GetMenuExtensibilityManager() override 32 | { 33 | return MenuExtensibilityManager; 34 | } 35 | 36 | public: 37 | 38 | //~ IHasToolBarExtensibility interface 39 | 40 | virtual TSharedPtr GetToolBarExtensibilityManager() override 41 | { 42 | return ToolBarExtensibilityManager; 43 | } 44 | 45 | public: 46 | 47 | //~ IModuleInterface interface 48 | 49 | virtual void StartupModule() override 50 | { 51 | Style = MakeShareable(new FTextAssetEditorStyle()); 52 | 53 | // FTextAssetEditorCommands::Register(); 54 | 55 | RegisterAssetTools(); 56 | RegisterMenuExtensions(); 57 | RegisterSettings(); 58 | } 59 | 60 | virtual void ShutdownModule() override 61 | { 62 | UnregisterAssetTools(); 63 | UnregisterMenuExtensions(); 64 | UnregisterSettings(); 65 | } 66 | 67 | virtual bool SupportsDynamicReloading() override 68 | { 69 | return true; 70 | } 71 | 72 | protected: 73 | 74 | /** Registers asset tool actions. */ 75 | void RegisterAssetTools() 76 | { 77 | IAssetTools& AssetTools = FModuleManager::LoadModuleChecked("AssetTools").Get(); 78 | 79 | RegisterAssetTypeAction(AssetTools, MakeShareable(new FTextAssetActions(Style.ToSharedRef()))); 80 | } 81 | 82 | /** 83 | * Registers a single asset type action. 84 | * 85 | * @param AssetTools The asset tools object to register with. 86 | * @param Action The asset type action to register. 87 | */ 88 | void RegisterAssetTypeAction(IAssetTools& AssetTools, TSharedRef Action) 89 | { 90 | AssetTools.RegisterAssetTypeActions(Action); 91 | RegisteredAssetTypeActions.Add(Action); 92 | } 93 | 94 | /** Register the text asset editor settings. */ 95 | void RegisterSettings() 96 | { 97 | ISettingsModule* SettingsModule = FModuleManager::GetModulePtr("Settings"); 98 | 99 | if (SettingsModule != nullptr) 100 | { 101 | ISettingsSectionPtr SettingsSection = SettingsModule->RegisterSettings("Editor", "Plugins", "TextAsset", 102 | LOCTEXT("TextAssetSettingsName", "Text Asset"), 103 | LOCTEXT("TextAssetSettingsDescription", "Configure the Text Asset plug-in."), 104 | GetMutableDefault() 105 | ); 106 | } 107 | } 108 | 109 | /** Unregisters asset tool actions. */ 110 | void UnregisterAssetTools() 111 | { 112 | FAssetToolsModule* AssetToolsModule = FModuleManager::GetModulePtr("AssetTools"); 113 | 114 | if (AssetToolsModule != nullptr) 115 | { 116 | IAssetTools& AssetTools = AssetToolsModule->Get(); 117 | 118 | for (auto Action : RegisteredAssetTypeActions) 119 | { 120 | AssetTools.UnregisterAssetTypeActions(Action); 121 | } 122 | } 123 | } 124 | 125 | /** Unregister the text asset editor settings. */ 126 | void UnregisterSettings() 127 | { 128 | ISettingsModule* SettingsModule = FModuleManager::GetModulePtr("Settings"); 129 | 130 | if (SettingsModule != nullptr) 131 | { 132 | SettingsModule->UnregisterSettings("Editor", "Plugins", "TextAsset"); 133 | } 134 | } 135 | 136 | protected: 137 | 138 | /** Registers main menu and tool bar menu extensions. */ 139 | void RegisterMenuExtensions() 140 | { 141 | MenuExtensibilityManager = MakeShareable(new FExtensibilityManager); 142 | ToolBarExtensibilityManager = MakeShareable(new FExtensibilityManager); 143 | } 144 | 145 | /** Unregisters main menu and tool bar menu extensions. */ 146 | void UnregisterMenuExtensions() 147 | { 148 | MenuExtensibilityManager.Reset(); 149 | ToolBarExtensibilityManager.Reset(); 150 | } 151 | 152 | private: 153 | 154 | /** Holds the menu extensibility manager. */ 155 | TSharedPtr MenuExtensibilityManager; 156 | 157 | /** The collection of registered asset type actions. */ 158 | TArray> RegisteredAssetTypeActions; 159 | 160 | /** Holds the plug-ins style set. */ 161 | TSharedPtr Style; 162 | 163 | /** Holds the tool bar extensibility manager. */ 164 | TSharedPtr ToolBarExtensibilityManager; 165 | }; 166 | 167 | 168 | IMPLEMENT_MODULE(FTextAssetEditorModule, TextAssetEditor); 169 | 170 | 171 | #undef LOCTEXT_NAMESPACE 172 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/Toolkits/TextAssetEditorToolkit.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "TextAssetEditorToolkit.h" 4 | 5 | #include "Editor.h" 6 | #include "EditorReimportHandler.h" 7 | #include "EditorStyleSet.h" 8 | #include "STextAssetEditor.h" 9 | #include "TextAsset.h" 10 | #include "UObject/NameTypes.h" 11 | #include "Widgets/Docking/SDockTab.h" 12 | 13 | #define LOCTEXT_NAMESPACE "FTextAssetEditorToolkit" 14 | 15 | DEFINE_LOG_CATEGORY_STATIC(LogTextAssetEditor, Log, All); 16 | 17 | 18 | /* Local constants 19 | *****************************************************************************/ 20 | 21 | namespace TextAssetEditor 22 | { 23 | static const FName AppIdentifier("TextAssetEditorApp"); 24 | static const FName TabId("TextEditor"); 25 | } 26 | 27 | 28 | /* FTextAssetEditorToolkit structors 29 | *****************************************************************************/ 30 | 31 | FTextAssetEditorToolkit::FTextAssetEditorToolkit(const TSharedRef& InStyle) 32 | : TextAsset(nullptr) 33 | , Style(InStyle) 34 | { } 35 | 36 | 37 | FTextAssetEditorToolkit::~FTextAssetEditorToolkit() 38 | { 39 | FReimportManager::Instance()->OnPreReimport().RemoveAll(this); 40 | FReimportManager::Instance()->OnPostReimport().RemoveAll(this); 41 | 42 | GEditor->UnregisterForUndo(this); 43 | } 44 | 45 | 46 | /* FTextAssetEditorToolkit interface 47 | *****************************************************************************/ 48 | 49 | void FTextAssetEditorToolkit::Initialize(UTextAsset* InTextAsset, const EToolkitMode::Type InMode, const TSharedPtr& InToolkitHost) 50 | { 51 | TextAsset = InTextAsset; 52 | 53 | // Support undo/redo 54 | TextAsset->SetFlags(RF_Transactional); 55 | GEditor->RegisterForUndo(this); 56 | 57 | // create tab layout 58 | const TSharedRef Layout = FTabManager::NewLayout("Standalone_TextAssetEditor") 59 | ->AddArea 60 | ( 61 | FTabManager::NewPrimaryArea() 62 | ->SetOrientation(Orient_Horizontal) 63 | ->Split 64 | ( 65 | FTabManager::NewSplitter() 66 | ->SetOrientation(Orient_Vertical) 67 | ->SetSizeCoefficient(0.66f) 68 | ->Split 69 | ( 70 | FTabManager::NewStack() 71 | ->AddTab(GetToolbarTabId(), ETabState::OpenedTab) 72 | ->SetHideTabWell(true) 73 | ->SetSizeCoefficient(0.1f) 74 | 75 | ) 76 | ->Split 77 | ( 78 | FTabManager::NewStack() 79 | ->AddTab(TextAssetEditor::TabId, ETabState::OpenedTab) 80 | ->SetHideTabWell(true) 81 | ->SetSizeCoefficient(0.9f) 82 | ) 83 | ) 84 | ); 85 | 86 | FAssetEditorToolkit::InitAssetEditor( 87 | InMode, 88 | InToolkitHost, 89 | TextAssetEditor::AppIdentifier, 90 | Layout, 91 | true /*bCreateDefaultStandaloneMenu*/, 92 | true /*bCreateDefaultToolbar*/, 93 | InTextAsset 94 | ); 95 | 96 | RegenerateMenusAndToolbars(); 97 | } 98 | 99 | 100 | /* FAssetEditorToolkit interface 101 | *****************************************************************************/ 102 | 103 | FString FTextAssetEditorToolkit::GetDocumentationLink() const 104 | { 105 | return FString(TEXT("https://github.com/ue4plugins/TextAsset")); 106 | } 107 | 108 | 109 | void FTextAssetEditorToolkit::RegisterTabSpawners(const TSharedRef& InTabManager) 110 | { 111 | WorkspaceMenuCategory = InTabManager->AddLocalWorkspaceMenuCategory(LOCTEXT("WorkspaceMenu_TextAssetEditor", "Text Asset Editor")); 112 | auto WorkspaceMenuCategoryRef = WorkspaceMenuCategory.ToSharedRef(); 113 | 114 | FAssetEditorToolkit::RegisterTabSpawners(InTabManager); 115 | 116 | InTabManager->RegisterTabSpawner(TextAssetEditor::TabId, FOnSpawnTab::CreateSP(this, &FTextAssetEditorToolkit::HandleTabManagerSpawnTab, TextAssetEditor::TabId)) 117 | .SetDisplayName(LOCTEXT("TextEditorTabName", "Text Editor")) 118 | .SetGroup(WorkspaceMenuCategoryRef) 119 | .SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.Tabs.Viewports")); 120 | } 121 | 122 | 123 | void FTextAssetEditorToolkit::UnregisterTabSpawners(const TSharedRef& InTabManager) 124 | { 125 | FAssetEditorToolkit::UnregisterTabSpawners(InTabManager); 126 | 127 | InTabManager->UnregisterTabSpawner(TextAssetEditor::TabId); 128 | } 129 | 130 | 131 | /* IToolkit interface 132 | *****************************************************************************/ 133 | 134 | FText FTextAssetEditorToolkit::GetBaseToolkitName() const 135 | { 136 | return LOCTEXT("AppLabel", "Text Asset Editor"); 137 | } 138 | 139 | 140 | FName FTextAssetEditorToolkit::GetToolkitFName() const 141 | { 142 | return FName("TextAssetEditor"); 143 | } 144 | 145 | 146 | FLinearColor FTextAssetEditorToolkit::GetWorldCentricTabColorScale() const 147 | { 148 | return FLinearColor(0.3f, 0.2f, 0.5f, 0.5f); 149 | } 150 | 151 | 152 | FString FTextAssetEditorToolkit::GetWorldCentricTabPrefix() const 153 | { 154 | return LOCTEXT("WorldCentricTabPrefix", "TextAsset ").ToString(); 155 | } 156 | 157 | 158 | /* FGCObject interface 159 | *****************************************************************************/ 160 | 161 | void FTextAssetEditorToolkit::AddReferencedObjects(FReferenceCollector& Collector) 162 | { 163 | Collector.AddReferencedObject(TextAsset); 164 | } 165 | 166 | 167 | /* FEditorUndoClient interface 168 | *****************************************************************************/ 169 | 170 | void FTextAssetEditorToolkit::PostUndo(bool bSuccess) 171 | { } 172 | 173 | 174 | void FTextAssetEditorToolkit::PostRedo(bool bSuccess) 175 | { 176 | PostUndo(bSuccess); 177 | } 178 | 179 | 180 | /* FTextAssetEditorToolkit callbacks 181 | *****************************************************************************/ 182 | 183 | TSharedRef FTextAssetEditorToolkit::HandleTabManagerSpawnTab(const FSpawnTabArgs& Args, FName TabIdentifier) 184 | { 185 | TSharedPtr TabWidget = SNullWidget::NullWidget; 186 | 187 | if (TabIdentifier == TextAssetEditor::TabId) 188 | { 189 | TabWidget = SNew(STextAssetEditor, TextAsset, Style); 190 | } 191 | 192 | return SNew(SDockTab) 193 | .TabRole(ETabRole::PanelTab) 194 | [ 195 | TabWidget.ToSharedRef() 196 | ]; 197 | } 198 | 199 | 200 | #undef LOCTEXT_NAMESPACE 201 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/Toolkits/TextAssetEditorToolkit.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "EditorUndoClient.h" 6 | #include "Templates/SharedPointer.h" 7 | #include "Toolkits/AssetEditorToolkit.h" 8 | #include "UObject/GCObject.h" 9 | 10 | class FSpawnTabArgs; 11 | class ISlateStyle; 12 | class IToolkitHost; 13 | class SDockTab; 14 | class UTextAsset; 15 | 16 | 17 | /** 18 | * Implements an Editor toolkit for textures. 19 | */ 20 | class FTextAssetEditorToolkit 21 | : public FAssetEditorToolkit 22 | , public FEditorUndoClient 23 | , public FGCObject 24 | { 25 | public: 26 | 27 | /** 28 | * Creates and initializes a new instance. 29 | * 30 | * @param InStyle The style set to use. 31 | */ 32 | FTextAssetEditorToolkit(const TSharedRef& InStyle); 33 | 34 | /** Virtual destructor. */ 35 | virtual ~FTextAssetEditorToolkit(); 36 | 37 | public: 38 | 39 | /** 40 | * Initializes the editor tool kit. 41 | * 42 | * @param InTextAsset The UTextAsset asset to edit. 43 | * @param InMode The mode to create the toolkit in. 44 | * @param InToolkitHost The toolkit host. 45 | */ 46 | void Initialize(UTextAsset* InTextAsset, const EToolkitMode::Type InMode, const TSharedPtr& InToolkitHost); 47 | 48 | public: 49 | 50 | //~ FAssetEditorToolkit interface 51 | 52 | virtual FString GetDocumentationLink() const override; 53 | virtual void RegisterTabSpawners(const TSharedRef& InTabManager) override; 54 | virtual void UnregisterTabSpawners(const TSharedRef& InTabManager) override; 55 | 56 | public: 57 | 58 | //~ IToolkit interface 59 | 60 | virtual FText GetBaseToolkitName() const override; 61 | virtual FName GetToolkitFName() const override; 62 | virtual FLinearColor GetWorldCentricTabColorScale() const override; 63 | virtual FString GetWorldCentricTabPrefix() const override; 64 | 65 | public: 66 | 67 | //~ FGCObject interface 68 | 69 | virtual void AddReferencedObjects(FReferenceCollector& Collector) override; 70 | 71 | protected: 72 | 73 | //~ FEditorUndoClient interface 74 | 75 | virtual void PostUndo(bool bSuccess) override; 76 | virtual void PostRedo(bool bSuccess) override; 77 | 78 | private: 79 | 80 | /** Callback for spawning the Properties tab. */ 81 | TSharedRef HandleTabManagerSpawnTab(const FSpawnTabArgs& Args, FName TabIdentifier); 82 | 83 | private: 84 | 85 | /** The text asset being edited. */ 86 | UTextAsset* TextAsset; 87 | 88 | /** Pointer to the style set to use for toolkits. */ 89 | TSharedRef Style; 90 | }; 91 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/Widgets/STextAssetEditor.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "STextAssetEditor.h" 4 | 5 | #include "Fonts/SlateFontInfo.h" 6 | #include "Internationalization/Text.h" 7 | #include "TextAsset.h" 8 | #include "UObject/Class.h" 9 | #include "Widgets/SBoxPanel.h" 10 | #include "Widgets/Input/SMultiLineEditableTextBox.h" 11 | 12 | #include "TextAssetEditorSettings.h" 13 | 14 | 15 | #define LOCTEXT_NAMESPACE "STextAssetEditor" 16 | 17 | 18 | /* STextAssetEditor interface 19 | *****************************************************************************/ 20 | 21 | STextAssetEditor::~STextAssetEditor() 22 | { 23 | FCoreUObjectDelegates::OnObjectPropertyChanged.RemoveAll(this); 24 | } 25 | 26 | 27 | void STextAssetEditor::Construct(const FArguments& InArgs, UTextAsset* InTextAsset, const TSharedRef& InStyle) 28 | { 29 | TextAsset = InTextAsset; 30 | 31 | auto Settings = GetDefault(); 32 | 33 | ChildSlot 34 | [ 35 | SNew(SVerticalBox) 36 | 37 | + SVerticalBox::Slot() 38 | .FillHeight(1.0f) 39 | [ 40 | SAssignNew(EditableTextBox, SMultiLineEditableTextBox) 41 | .BackgroundColor((Settings != nullptr) ? Settings->BackgroundColor : FLinearColor::White) 42 | .Font((Settings != nullptr) ? Settings->Font : FSlateFontInfo()) 43 | .ForegroundColor((Settings != nullptr) ? Settings->ForegroundColor : FLinearColor::Black) 44 | .Margin((Settings != nullptr) ? Settings->Margin : 4.0f) 45 | .OnTextChanged(this, &STextAssetEditor::HandleEditableTextBoxTextChanged) 46 | .OnTextCommitted(this, &STextAssetEditor::HandleEditableTextBoxTextCommitted) 47 | .Text(TextAsset->Text) 48 | ] 49 | ]; 50 | 51 | FCoreUObjectDelegates::OnObjectPropertyChanged.AddSP(this, &STextAssetEditor::HandleTextAssetPropertyChanged); 52 | } 53 | 54 | 55 | /* STextAssetEditor callbacks 56 | *****************************************************************************/ 57 | 58 | void STextAssetEditor::HandleEditableTextBoxTextChanged(const FText& NewText) 59 | { 60 | TextAsset->MarkPackageDirty(); 61 | } 62 | 63 | 64 | void STextAssetEditor::HandleEditableTextBoxTextCommitted(const FText& Comment, ETextCommit::Type CommitType) 65 | { 66 | TextAsset->Text = EditableTextBox->GetText(); 67 | } 68 | 69 | 70 | void STextAssetEditor::HandleTextAssetPropertyChanged(UObject* Object, FPropertyChangedEvent& PropertyChangedEvent) 71 | { 72 | if (Object == TextAsset) 73 | { 74 | EditableTextBox->SetText(TextAsset->Text); 75 | } 76 | } 77 | 78 | 79 | #undef LOCTEXT_NAMESPACE 80 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/Private/Widgets/STextAssetEditor.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "Templates/SharedPointer.h" 6 | #include "Widgets/DeclarativeSyntaxSupport.h" 7 | #include "Widgets/SCompoundWidget.h" 8 | #include "Widgets/Input/SMultiLineEditableTextBox.h" 9 | 10 | class FText; 11 | class ISlateStyle; 12 | class UTextAsset; 13 | 14 | 15 | /** 16 | * Implements the UTextAsset asset editor widget. 17 | */ 18 | class STextAssetEditor 19 | : public SCompoundWidget 20 | { 21 | public: 22 | 23 | SLATE_BEGIN_ARGS(STextAssetEditor) { } 24 | SLATE_END_ARGS() 25 | 26 | public: 27 | 28 | /** Virtual destructor. */ 29 | virtual ~STextAssetEditor(); 30 | 31 | /** 32 | * Construct this widget 33 | * 34 | * @param InArgs The declaration data for this widget. 35 | * @param InTextAsset The UTextAsset asset to edit. 36 | * @param InStyleSet The style set to use. 37 | */ 38 | void Construct(const FArguments& InArgs, UTextAsset* InTextAsset, const TSharedRef& InStyle); 39 | 40 | private: 41 | 42 | /** Callback for text changes in the editable text box. */ 43 | void HandleEditableTextBoxTextChanged(const FText& NewText); 44 | 45 | /** Callback for committed text in the editable text box. */ 46 | void HandleEditableTextBoxTextCommitted(const FText& Comment, ETextCommit::Type CommitType); 47 | 48 | /** Callback for property changes in the text asset. */ 49 | void HandleTextAssetPropertyChanged(UObject* Object, FPropertyChangedEvent& PropertyChangedEvent); 50 | 51 | private: 52 | 53 | /** Holds the editable text box widget. */ 54 | TSharedPtr EditableTextBox; 55 | 56 | /** Pointer to the text asset that is being edited. */ 57 | UTextAsset* TextAsset; 58 | }; 59 | -------------------------------------------------------------------------------- /Source/TextAssetEditor/TextAssetEditor.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class TextAssetEditor : ModuleRules 6 | { 7 | public TextAssetEditor(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | DynamicallyLoadedModuleNames.AddRange( 12 | new string[] { 13 | "AssetTools", 14 | "MainFrame", 15 | // "WorkspaceMenuStructure", 16 | }); 17 | 18 | PrivateIncludePaths.AddRange( 19 | new string[] { 20 | "TextAssetEditor/Private", 21 | "TextAssetEditor/Private/AssetTools", 22 | "TextAssetEditor/Private/Factories", 23 | "TextAssetEditor/Private/Shared", 24 | "TextAssetEditor/Private/Styles", 25 | "TextAssetEditor/Private/Toolkits", 26 | "TextAssetEditor/Private/Widgets", 27 | }); 28 | 29 | PrivateDependencyModuleNames.AddRange( 30 | new string[] { 31 | "ContentBrowser", 32 | "Core", 33 | "CoreUObject", 34 | "DesktopWidgets", 35 | "EditorStyle", 36 | "Engine", 37 | "InputCore", 38 | "Projects", 39 | "Slate", 40 | "SlateCore", 41 | "TextAsset", 42 | "UnrealEd", 43 | }); 44 | 45 | PrivateIncludePathModuleNames.AddRange( 46 | new string[] { 47 | "AssetTools", 48 | "UnrealEd", 49 | // "WorkspaceMenuStructure", 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /TextAsset.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion" : 3, 3 | "Version" : 8, 4 | "VersionName" : "8.0", 5 | "EngineVersion" : "4.19.0", 6 | "FriendlyName" : "Text Asset", 7 | "Description" : "Adds an editable text content asset for personal notes.", 8 | "Category" : "Editor", 9 | "CreatedBy" : "Epic Games Inc", 10 | "CreatedByURL" : "http://epicgames.com", 11 | "DocsURL" : "", 12 | "MarketplaceURL" : "", 13 | "SupportURL" : "", 14 | "EnabledByDefault" : true, 15 | "CanContainContent" : false, 16 | "IsBetaVersion" : false, 17 | "Installed" : false, 18 | "Modules" : 19 | [ 20 | { 21 | "Name" : "TextAsset", 22 | "Type" : "Runtime", 23 | "LoadingPhase" : "Default" 24 | }, 25 | { 26 | "Name" : "TextAssetEditor", 27 | "Type" : "Editor", 28 | "LoadingPhase" : "Default" 29 | } 30 | 31 | ] 32 | } 33 | --------------------------------------------------------------------------------