WwiseAssetDragDropOp.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*******************************************************************************
  2. The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
  3. Technology released in source code form as part of the game integration package.
  4. The content of this file may not be used without valid licenses to the
  5. AUDIOKINETIC Wwise Technology.
  6. Note that the use of the game engine is subject to the Unreal(R) Engine End User
  7. License Agreement at https://www.unrealengine.com/en-US/eula/unreal
  8. License Usage
  9. Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
  10. this file in accordance with the end user license agreement provided with the
  11. software or, alternatively, in accordance with the terms contained
  12. in a written agreement between you and Audiokinetic Inc.
  13. Copyright (c) 2023 Audiokinetic Inc.
  14. *******************************************************************************/
  15. /*------------------------------------------------------------------------------------
  16. WwiseEventDragDropOp.h
  17. ------------------------------------------------------------------------------------*/
  18. #pragma once
  19. #include "Containers/Map.h"
  20. #include "DragAndDrop/AssetDragDropOp.h"
  21. #include "ContentBrowserDelegates.h"
  22. #include "AssetToolsModule.h"
  23. #include "WwiseBrowser/WwiseBrowserHelpers.h"
  24. class FWwiseAssetDragDropOp : public FAssetDragDropOp
  25. {
  26. public:
  27. DRAG_DROP_OPERATOR_TYPE(FWwiseEventDragDropOp, FAssetDragDropOp)
  28. static TSharedRef<FAssetDragDropOp> New(TArray<WwiseBrowserHelpers::WwiseBrowserAssetPayload> InAssetData, UActorFactory* ActorFactory = nullptr);
  29. static TSharedRef<FAssetDragDropOp> New(TArray<WwiseBrowserHelpers::WwiseBrowserAssetPayload> InAssetData, TArray<FString> InAssetPaths, UActorFactory* ActorFactory);
  30. bool OnAssetViewDrop(const FAssetViewDragAndDropExtender::FPayload& Payload);
  31. bool OnAssetViewDragOver(const FAssetViewDragAndDropExtender::FPayload& Payload);
  32. void SaveAssets();
  33. void DeleteAssets();
  34. virtual void OnDrop(bool bDropWasHandled, const FPointerEvent& MouseEvent) override;
  35. void SetCanDrop(const bool InCanDrop);
  36. void SetTooltipText();
  37. FText GetTooltipText() const;
  38. ~FWwiseAssetDragDropOp();
  39. public:
  40. FText CurrentHoverText;
  41. bool CanDrop = true;
  42. FAssetViewDragAndDropExtender* Extender = nullptr;
  43. private:
  44. // Assets contained within the drag operation. Value is true if the asset existed prior to initiating the drop.
  45. TArray<WwiseBrowserHelpers::WwiseBrowserAssetPayload> WwiseAssetsToDrop;
  46. bool bDroppedOnContentBrowser = false;
  47. FString AssetViewDropTargetPackagePath;
  48. };