Added enough code for event nodes to be created for each UComboAction class. Now to figure out how to make them actually fire.
This commit is contained in:
@@ -4,8 +4,12 @@
|
||||
|
||||
#include "ComboInputAssets.h"
|
||||
#include "ToolMenuSection.h"
|
||||
|
||||
#include "AssetTypeActions/AssetTypeActions_DataAsset.h"
|
||||
#include "Interfaces/IPluginManager.h"
|
||||
#include "Styling/SlateStyle.h"
|
||||
#include "Styling/SlateStyleMacros.h"
|
||||
#include "Styling/SlateStyleRegistry.h"
|
||||
|
||||
#include UE_INLINE_GENERATED_CPP_BY_NAME(ComboInputEditor)
|
||||
|
||||
@@ -113,15 +117,49 @@ UObject *UComboInputAsset_Factory::FactoryCreateNew(UClass *Class, UObject *InPa
|
||||
|
||||
|
||||
|
||||
class FComboInputSlateStyle final : public FSlateStyleSet
|
||||
{
|
||||
public:
|
||||
FComboInputSlateStyle() : FSlateStyleSet("ComboInputEditor")
|
||||
{
|
||||
SetParentStyleName(FAppStyle::GetAppStyleSetName());
|
||||
|
||||
// The icons are located in /Engine/Plugins/ComboInput/Content/Editor/Slate/Icons
|
||||
SetContentRoot(FPaths::EnginePluginsDir() / TEXT("ComboInput/Content/Editor/Slate"));
|
||||
SetCoreContentRoot(FPaths::EngineContentDir() / TEXT("Slate"));
|
||||
|
||||
// Combo Input Editor icons
|
||||
static const FVector2D Icon16 = FVector2D(16.0f, 16.0f);
|
||||
static const FVector2D Icon64 = FVector2D(64.0f, 64.0f);
|
||||
|
||||
Set("ComboInputIcon_Small", new IMAGE_BRUSH_SVG("Icons/ComboInput_16", Icon16));
|
||||
Set("ComboInputIcon_Large", new IMAGE_BRUSH_SVG("Icons/ComboInput_64", Icon64));
|
||||
|
||||
Set("ClassIcon.ComboAction", new IMAGE_BRUSH_SVG("Icons/ComboAction_16", Icon16));
|
||||
Set("ClassThumbnail.ComboAction", new IMAGE_BRUSH_SVG("Icons/ComboAction_64", Icon64));
|
||||
|
||||
Set("ClassIcon.ComboSequenceNode", new IMAGE_BRUSH_SVG("Icons/ComboSequenceNode_16", Icon16));
|
||||
Set("ClassThumbnail.ComboSequenceNode", new IMAGE_BRUSH_SVG("Icons/ComboSequenceNode_64", Icon64));
|
||||
|
||||
Set("ClassIcon.ComboInputAsset", new IMAGE_BRUSH_SVG("Icons/ComboInputAsset_16", Icon16));
|
||||
Set("ClassThumbnail.ComboInputAsset", new IMAGE_BRUSH_SVG("Icons/ComboInputAsset_64", Icon64));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
void FComboInputEditorModule::StartupModule()
|
||||
{
|
||||
// Register combo action asset
|
||||
IAssetTools &AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get();
|
||||
FComboInputEditorModule::ComboAssetsCategory = AssetTools.RegisterAdvancedAssetCategory(FName(TEXT("Input")), LOCTEXT("InputAssetsCategory", "Input"));
|
||||
|
||||
this->RegisterAssetTypeActions(AssetTools, MakeShareable(new FAssetTypeActions_ComboAction));
|
||||
this->RegisterAssetTypeActions(AssetTools, MakeShareable(new FAssetTypeActions_ComboSequenceNode));
|
||||
this->RegisterAssetTypeActions(AssetTools, MakeShareable(new FAssetTypeActions_ComboInputAsset));
|
||||
|
||||
// Make a new style set for Combo Input, which will register any custom icons for the types in this plugin
|
||||
StyleSet = MakeShared<FComboInputSlateStyle>();
|
||||
FSlateStyleRegistry::RegisterSlateStyle(*StyleSet.Get());
|
||||
}
|
||||
|
||||
void FComboInputEditorModule::ShutdownModule()
|
||||
|
||||
Reference in New Issue
Block a user