2025-10-15 18:25:31 +08:00

49 lines
1.2 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "ShapeGridWidget.h"
#include "ProjectFish/DataAsset/ShapeAsset.h"
/**
*
*/
class PROJECTFISHEDITOR_API SShapeEditorWidget: public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SShapeEditorWidget) {}
SLATE_ARGUMENT(UShapeAsset*, 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 GetShapeWidth() const;
/** Get the current bag height */
int32 GetShapeHeight() 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 UShapeAsset> BagShapeAsset;
TSharedPtr<SShapeGridWidget> GridWidget;
};