第一次提交
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// Copyright 2025 https://yuewu.dev/en All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "AssetTypeActions/AssetTypeActions_DataAsset.h"
|
||||
|
||||
class FGIS_AssetTypeAction : public FAssetTypeActions_DataAsset
|
||||
{
|
||||
public:
|
||||
virtual uint32 GetCategories() override;
|
||||
virtual FColor GetTypeColor() const override;
|
||||
};
|
||||
|
||||
#define DEFINE_GIS_ASSET_ACTION(ActionName) \
|
||||
class FGIS_AssetTypeAction_##ActionName final : public FGIS_AssetTypeAction \
|
||||
{ \
|
||||
public: \
|
||||
virtual FText GetName() const override; \
|
||||
virtual FText GetAssetDescription(const FAssetData& AssetData) const override; \
|
||||
virtual UClass* GetSupportedClass() const override; \
|
||||
};
|
||||
|
||||
DEFINE_GIS_ASSET_ACTION(ItemDefinition)
|
||||
|
||||
DEFINE_GIS_ASSET_ACTION(ItemDefinitionSchema)
|
||||
|
||||
DEFINE_GIS_ASSET_ACTION(ItemCollectionDefinition)
|
||||
|
||||
DEFINE_GIS_ASSET_ACTION(ItemSlotCollectionDefinition)
|
||||
|
||||
DEFINE_GIS_ASSET_ACTION(ItemMultiStackCollectionDefinition)
|
||||
|
||||
DEFINE_GIS_ASSET_ACTION(CurrencyDefinition)
|
||||
@@ -0,0 +1,69 @@
|
||||
// Copyright 2025 https://yuewu.dev/en All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "UObject/ObjectMacros.h"
|
||||
#include "Templates/SubclassOf.h"
|
||||
#include "Factories/Factory.h"
|
||||
#include "GIS_DataAssetsFactories.generated.h"
|
||||
|
||||
UCLASS(Abstract)
|
||||
class UGIS_Factory : public UFactory
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UGIS_Factory(const FObjectInitializer& ObjectInitializer);
|
||||
virtual uint32 GetMenuCategories() const override;
|
||||
virtual const TArray<FText>& GetMenuCategorySubMenus() const override;
|
||||
};
|
||||
|
||||
UCLASS()
|
||||
class UGIS_Factory_ItemDefinition : public UGIS_Factory
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UGIS_Factory_ItemDefinition(const FObjectInitializer& ObjectInitializer);
|
||||
virtual UObject* FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override;
|
||||
};
|
||||
|
||||
UCLASS()
|
||||
class UGIS_Factory_ItemDefinitionSchema : public UGIS_Factory
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UGIS_Factory_ItemDefinitionSchema(const FObjectInitializer& ObjectInitializer);
|
||||
virtual UObject* FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override;
|
||||
};
|
||||
|
||||
UCLASS()
|
||||
class UGIS_Factory_ItemCollectionDefinition : public UGIS_Factory
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UGIS_Factory_ItemCollectionDefinition(const FObjectInitializer& ObjectInitializer);
|
||||
virtual UObject* FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override;
|
||||
};
|
||||
|
||||
UCLASS()
|
||||
class UGIS_Factory_ItemSlotCollectionDefinition : public UGIS_Factory
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UGIS_Factory_ItemSlotCollectionDefinition(const FObjectInitializer& ObjectInitializer);
|
||||
virtual UObject* FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override;
|
||||
};
|
||||
|
||||
UCLASS()
|
||||
class UGIS_Factory_ItemMultiStackCollectionDefinition : public UGIS_Factory
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UGIS_Factory_ItemMultiStackCollectionDefinition(const FObjectInitializer& ObjectInitializer);
|
||||
virtual UObject* FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override;
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "AssetTypeCategories.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
|
||||
class IAssetTypeActions;
|
||||
|
||||
class FGenericInventoryEditorModule : public IModuleInterface
|
||||
{
|
||||
public:
|
||||
virtual void StartupModule() override;
|
||||
virtual void ShutdownModule() override;
|
||||
|
||||
static EAssetTypeCategories::Type GetAssetsCategory()
|
||||
{
|
||||
return AssetsCategory;
|
||||
}
|
||||
|
||||
private:
|
||||
static TArray<TSharedPtr<IAssetTypeActions>> AssetTypeActions;
|
||||
static EAssetTypeCategories::Type AssetsCategory;
|
||||
};
|
||||
Reference in New Issue
Block a user