// Copyright 2020-2024 CesiumGS, Inc. and Contributors #pragma once #include "Widgets/SCompoundWidget.h" #include "Widgets/Views/STableRow.h" #include #include class FArguments; enum class QuickAddItemType { TILESET, SUNSKY, DYNAMIC_PAWN, CARTOGRAPHIC_POLYGON }; struct QuickAddItem { QuickAddItemType type; std::string name{}; std::string description; std::string tilesetName{}; int64_t tilesetID = -1; std::string overlayName{}; int64_t overlayID = -1; }; class IonQuickAddPanel : public SCompoundWidget { SLATE_BEGIN_ARGS(IonQuickAddPanel) {} /** * The tile shown over the elements of the list */ SLATE_ARGUMENT(FText, Title) SLATE_END_ARGS() void Construct(const FArguments& InArgs); void AddItem(const QuickAddItem& item); void ClearItems(); void Refresh(); const FText& GetMessage() const; void SetMessage(const FText& message); private: TSharedRef QuickAddList(); TSharedRef CreateQuickAddItemRow( TSharedRef item, const TSharedRef& list); void AddItemToLevel(TSharedRef item); void AddIonTilesetToLevel(TSharedRef item); void AddCesiumSunSkyToLevel(); void AddDynamicPawnToLevel(); TArray> _quickAddItems; std::unordered_set _itemsBeingAdded; TSharedPtr>> _pQuickAddList; FText _message; };