Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.27 Updates #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/TextAsset/TextAsset.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public TextAsset(ReadOnlyTargetRules Target) : base(Target)

PrivateIncludePaths.AddRange(
new string[] {
"Runtime/TextAsset/Private",
"TextAsset/Private"
});
}
}
Expand Down
47 changes: 41 additions & 6 deletions Source/TextAssetEditor/Private/AssetTools/TextAssetActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,67 @@ class ISlateStyle;
* Implements an action for UTextAsset assets.
*/
class FTextAssetActions
: public FAssetTypeActions_Base
{
: public FAssetTypeActions_Base {
public:

/**
* Creates and initializes a new instance.
*
* @param InStyle The style set to use for asset editor toolkits.
*/
FTextAssetActions(const TSharedRef<ISlateStyle>& 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<UObject*>& 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. <br />
* <b>This must be implemented so the editor knows which class is to be used</b>
* @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<UObject*>& 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<UObject*>& InObjects, TSharedPtr<IToolkitHost> EditWithinLevelEditor = TSharedPtr<IToolkitHost>()) override;

private:

/** Pointer to the style set to use for toolkits. */
TSharedRef<ISlateStyle> Style;
};
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 2 additions & 3 deletions TextAsset.uplugin
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -27,6 +27,5 @@
"Type" : "Editor",
"LoadingPhase" : "Default"
}

]
}