49 lines
1.2 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "BagShapeGridWidget.h"
#include "ProjectFish/DataAsset/BagShapeAsset.h"
/**
*
*/
class PROJECTFISHEDITOR_API SBagShapeEditorWidget: public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SBagShapeEditorWidget) {}
SLATE_ARGUMENT(UBagShapeAsset*, BagShapeAsset)
SLATE_END_ARGS()
void Construct(const FArguments& InArgs);
private:
/** Refresh the grid display */
void RefreshGrid();
//背包大小UI
TSharedRef<SWidget> CreateSizeControls();
/** Get the current bag width */
int32 GetBagWidth() const;
/** Get the current bag height */
int32 GetBagHeight() const;
/** Handle width spin box value change */
void OnWidthChanged(int32 NewWidth);
/** Handle height spin box value change */
void OnHeightChanged(int32 NewHeight);
//重置背包状态
TSharedRef<SWidget> CreateGridControls();
FReply OnAllEnableClicked();
FReply OnAllDisableClicked();
//点击背包格子
void OnSlotClicked(int32 X, int32 Y);
//刷新图标
void RefreshThumbnail();
private:
TWeakObjectPtr<class UBagShapeAsset> BagShapeAsset;
TSharedPtr<SBagShapeGridWidget> GridWidget;
};