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-08-30 18:03:42 +08:00
|
|
|
#include "BagShapeGridWidget.h"
|
2025-08-30 13:43:09 +08:00
|
|
|
#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);
|
|
|
|
|
|
2025-08-30 18:03:42 +08:00
|
|
|
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();
|
2025-08-30 13:43:09 +08:00
|
|
|
private:
|
|
|
|
|
TWeakObjectPtr<class UBagShapeAsset> BagShapeAsset;
|
2025-08-30 18:03:42 +08:00
|
|
|
TSharedPtr<SBagShapeGridWidget> GridWidget;
|
2025-08-30 13:43:09 +08:00
|
|
|
};
|