第一次提交
This commit is contained in:
60
Source/PHYInventory/Public/UI/ItemStacks/ItemStack_Base.h
Normal file
60
Source/PHYInventory/Public/UI/ItemStacks/ItemStack_Base.h
Normal file
@@ -0,0 +1,60 @@
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
#include "UI/Common/GUIS_ListEntry.h"
|
||||
#include "ItemStack_Base.generated.h"
|
||||
|
||||
class UItemDataDragDropOperation;
|
||||
class UItemDataDraggingWidget;
|
||||
class UAmountContainerBase;
|
||||
class USizeBox;
|
||||
class UMenuAnchor;
|
||||
class UGUIS_UIActionWidget;
|
||||
class UGUIS_UIActionFactory;
|
||||
class UItemData;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class PHYINVENTORY_API UItemStack_Base : public UGUIS_ListEntry
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
private:
|
||||
UPROPERTY()
|
||||
UItemData* ItemData;
|
||||
UPROPERTY(meta=(BindWidgetOptional))
|
||||
UGUIS_UIActionWidget* DynamicUIActionWidget;
|
||||
UPROPERTY(EditAnywhere, Category="Config")
|
||||
TSoftObjectPtr<UGUIS_UIActionFactory> UIActionFactory;
|
||||
UPROPERTY(meta=(BindWidgetOptional))
|
||||
UMenuAnchor* ActionsAnchor;
|
||||
UPROPERTY(meta=(BindWidgetOptional))
|
||||
UAmountContainerBase* AmountContainer;
|
||||
UPROPERTY(EditAnywhere, Category="Config")
|
||||
TEnumAsByte<EHorizontalAlignment> ActionAnchorHorizontalAlignment = HAlign_Right;
|
||||
UPROPERTY(EditAnywhere, Category="Config")
|
||||
TEnumAsByte<EVerticalAlignment> ActionAnchorVerticalAlignment = VAlign_Center;
|
||||
UPROPERTY(EditAnywhere, Category="Config")
|
||||
TSubclassOf<UItemDataDraggingWidget> DraggingWidgetClass;
|
||||
protected:
|
||||
virtual void UpdateAmount();
|
||||
virtual void ResetState();
|
||||
virtual void NativeOnListItemObjectSet(UObject* ListItemObject) override;
|
||||
|
||||
virtual void NativeOnEntryReleased() override;
|
||||
virtual void NativePreConstruct() override;
|
||||
virtual void NativeOnDeselected(bool bBroadcast) override;
|
||||
virtual void NativeOnSelected(bool bBroadcast) override;
|
||||
|
||||
// 拖拽操作
|
||||
// 从这个item发起拖拽得时候调用
|
||||
UItemDataDragDropOperation* DragFromSource(const FString& Tag);
|
||||
// 放下到这个item的时候调用
|
||||
void DropToDest(UItemDataDragDropOperation& DragOperation) const;
|
||||
virtual void NativeOnDragDetected(const FGeometry& InGeometry, const FPointerEvent& InMouseEvent, UDragDropOperation*& OutOperation) override;
|
||||
virtual bool NativeOnDrop(const FGeometry& InGeometry, const FDragDropEvent& InDragDropEvent, UDragDropOperation* InOperation) override;
|
||||
};
|
||||
Reference in New Issue
Block a user