-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathTextAssetActions.h
More file actions
78 lines (63 loc) · 2.46 KB
/
TextAssetActions.h
File metadata and controls
78 lines (63 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "AssetTypeActions_Base.h"
#include "Templates/SharedPointer.h"
class ISlateStyle;
/**
* Implements an action for UTextAsset assets.
*/
class FTextAssetActions
: 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);
//~ 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;
};