Going through the process of using UInputActions instead of a custom class wherever possible, to make using the plugin less confusing.
This commit is contained in:
@@ -38,14 +38,14 @@ public:
|
||||
virtual UClass *GetSupportedClass() const override { return UComboSequenceNode::StaticClass(); }
|
||||
};
|
||||
|
||||
class FAssetTypeActions_ComboInputAsset : public FAssetTypeActions_DataAsset
|
||||
class FAssetTypeActions_ComboInputGroup : public FAssetTypeActions_DataAsset
|
||||
{
|
||||
public:
|
||||
virtual FText GetName() const override { return NSLOCTEXT("AssetTypeActions", "AssetTypeActions_ComboInputAsset", "Combo Input Asset"); }
|
||||
virtual FText GetName() const override { return NSLOCTEXT("AssetTypeActions", "AssetTypeActions_ComboInputGroup", "Combo Input Asset"); }
|
||||
virtual uint32 GetCategories() override { return FComboInputEditorModule::GetInputAssetsCategory(); }
|
||||
virtual FColor GetTypeColor() const override { return FColor(255, 127, 255); }
|
||||
virtual FText GetAssetDescription(const FAssetData &AssetData) const override { return NSLOCTEXT("AssetTypeActions", "AssetTypeActions_ComboInputAssetDesc", "This maps a sequence of button inputs from EnhancedInput to a combo action that can be used to execute a sequence of moves.This gets sent from the input buffer subsystem to the player controller's ComboManagerComponent, which executes the associated action in the current ComboSequenceNode."); }
|
||||
virtual UClass *GetSupportedClass() const override { return UComboInputAsset::StaticClass(); }
|
||||
virtual FText GetAssetDescription(const FAssetData &AssetData) const override { return NSLOCTEXT("AssetTypeActions", "AssetTypeActions_ComboInputGroupDesc", "This maps a sequence of button inputs from EnhancedInput to a combo action that can be used to execute a sequence of moves.This gets sent from the input buffer subsystem to the player controller's ComboManagerComponent, which executes the associated action in the current ComboSequenceNode."); }
|
||||
virtual UClass *GetSupportedClass() const override { return UComboInputGroup::StaticClass(); }
|
||||
};
|
||||
|
||||
|
||||
@@ -94,24 +94,24 @@ UObject *UComboSequenceNode_Factory::FactoryCreateNew(UClass *Class, UObject *In
|
||||
}
|
||||
|
||||
|
||||
UComboInputAsset_Factory::UComboInputAsset_Factory(const FObjectInitializer &ObjectInitializer)
|
||||
UComboInputGroup_Factory::UComboInputGroup_Factory(const FObjectInitializer &ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
SupportedClass = UComboInputAsset::StaticClass();
|
||||
SupportedClass = UComboInputGroup::StaticClass();
|
||||
bEditAfterNew = true;
|
||||
bCreateNew = true;
|
||||
}
|
||||
|
||||
UObject *UComboInputAsset_Factory::FactoryCreateNew(UClass *Class, UObject *InParent, FName Name, EObjectFlags Flags, UObject *Context, FFeedbackContext *Warn)
|
||||
UObject *UComboInputGroup_Factory::FactoryCreateNew(UClass *Class, UObject *InParent, FName Name, EObjectFlags Flags, UObject *Context, FFeedbackContext *Warn)
|
||||
{
|
||||
if (this->ComboInputAssetClass != nullptr)
|
||||
if (this->ComboInputGroupClass != nullptr)
|
||||
{
|
||||
return NewObject<UComboInputAsset>(InParent, this->ComboInputAssetClass, Name, Flags | RF_Transactional, Context);
|
||||
return NewObject<UComboInputGroup>(InParent, this->ComboInputGroupClass, Name, Flags | RF_Transactional, Context);
|
||||
}
|
||||
else
|
||||
{
|
||||
check(Class->IsChildOf(UComboInputAsset::StaticClass()));
|
||||
return NewObject<UComboInputAsset>(InParent, Class, Name, Flags | RF_Transactional, Context);
|
||||
check(Class->IsChildOf(UComboInputGroup::StaticClass()));
|
||||
return NewObject<UComboInputGroup>(InParent, Class, Name, Flags | RF_Transactional, Context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,8 +142,8 @@ public:
|
||||
this->Set("ClassIcon.ComboSequenceNode", new IMAGE_BRUSH_SVG("Icons/ComboSequenceNode_16", Icon16));
|
||||
this->Set("ClassThumbnail.ComboSequenceNode", new IMAGE_BRUSH_SVG("Icons/ComboSequenceNode_64", Icon64));
|
||||
|
||||
this->Set("ClassIcon.ComboInputAsset", new IMAGE_BRUSH_SVG("Icons/ComboInputAsset_16", Icon16));
|
||||
this->Set("ClassThumbnail.ComboInputAsset", new IMAGE_BRUSH_SVG("Icons/ComboInputAsset_64", Icon64));
|
||||
this->Set("ClassIcon.ComboInputGroup", new IMAGE_BRUSH_SVG("Icons/ComboInputGroup_16", Icon16));
|
||||
this->Set("ClassThumbnail.ComboInputGroup", new IMAGE_BRUSH_SVG("Icons/ComboInputGroup_64", Icon64));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -156,7 +156,7 @@ void FComboInputEditorModule::StartupModule()
|
||||
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));
|
||||
this->RegisterAssetTypeActions(AssetTools, MakeShareable(new FAssetTypeActions_ComboInputGroup));
|
||||
|
||||
// Make a new style set for Combo Input, which will register any custom icons for the types in this plugin
|
||||
StyleSet = MakeShared<FComboInputSlateStyle>();
|
||||
|
||||
Reference in New Issue
Block a user