49 lines
1.2 KiB
C
Raw Normal View History

2025-08-30 13:43:09 +08:00
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
2025-10-15 18:25:31 +08:00
#include "ShapeGridWidget.h"
#include "ProjectFish/DataAsset/ShapeAsset.h"
2025-08-30 13:43:09 +08:00
/**
*
*/
2025-10-15 18:25:31 +08:00
class PROJECTFISHEDITOR_API SShapeEditorWidget: public SCompoundWidget
2025-08-30 13:43:09 +08:00
{
public:
2025-10-15 18:25:31 +08:00
SLATE_BEGIN_ARGS(SShapeEditorWidget) {}
SLATE_ARGUMENT(UShapeAsset*, BagShapeAsset)
2025-08-30 13:43:09 +08:00
SLATE_END_ARGS()
void Construct(const FArguments& InArgs);
2025-08-30 18:03:42 +08:00
private:
/** Refresh the grid display */
void RefreshGrid();
//背包大小UI
TSharedRef<SWidget> CreateSizeControls();
/** Get the current bag width */
2025-10-15 18:25:31 +08:00
int32 GetShapeWidth() const;
2025-08-30 18:03:42 +08:00
/** Get the current bag height */
2025-10-15 18:25:31 +08:00
int32 GetShapeHeight() const;
2025-08-30 18:03:42 +08:00
/** 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();
2025-08-30 13:43:09 +08:00
private:
2025-10-15 18:25:31 +08:00
TWeakObjectPtr<class UShapeAsset> BagShapeAsset;
TSharedPtr<SShapeGridWidget> GridWidget;
2025-08-30 13:43:09 +08:00
};