SAkGeometrySurfaceOverrideController.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. #pragma once
  16. #include "Framework/Application/SlateApplication.h"
  17. #include "Widgets/SCompoundWidget.h"
  18. #include "Editor.h"
  19. class IDetailLayoutBuilder;
  20. class IDetailCategoryBuilder;
  21. class UMaterialInterface;
  22. class UAkGeometryComponent;
  23. struct FAkGeometrySurfaceOverride;
  24. class UAkAcousticTexture;
  25. class SSurfacePropertiesLabels : public SCompoundWidget
  26. {
  27. public:
  28. SLATE_BEGIN_ARGS(SSurfacePropertiesLabels) {}
  29. SLATE_END_ARGS()
  30. AUDIOKINETICTOOLS_API void Construct(const FArguments& InArgs, FAkGeometrySurfaceOverride* InSurfaceOverride);
  31. private:
  32. FAkGeometrySurfaceOverride* SurfaceOverride = nullptr;
  33. EVisibility TransmissionLossVisibility() const;
  34. };
  35. class SAkGeometrySurfaceController : public SCompoundWidget
  36. {
  37. public:
  38. SLATE_BEGIN_ARGS(SAkGeometrySurfaceController) {}
  39. SLATE_END_ARGS()
  40. AUDIOKINETICTOOLS_API void Construct(const FArguments& InArgs
  41. , TWeakObjectPtr<UObject> ObjectBeingCustomized
  42. , const TSharedPtr<IDetailLayoutBuilder>& InLayoutBuilder
  43. );
  44. ~SAkGeometrySurfaceController();
  45. private:
  46. void BeginModify(FText TransactionText);
  47. void EndModify();
  48. virtual FAkGeometrySurfaceOverride* GetSurfaceOverride() const { return nullptr; }
  49. void BuildSlate();
  50. FString GetSelectedTextureAssetPath() const;
  51. void OnTextureAssetChanged(const FAssetData& InAssetData);
  52. TOptional<float> GetTransmissionLossValue() const;
  53. void OnTransmissionLossChanged(float NewValue, ETextCommit::Type Commit);
  54. EVisibility TransmissionLossVisibility() const;
  55. ECheckBoxState GetEnableTransmissionLossOverrideCheckBoxState() const;
  56. void OnEnableTransmissionLossOverrideChanged(ECheckBoxState NewState);
  57. UAkAcousticTexture* CurrentTexture = nullptr;
  58. /** The details layout in the editor */
  59. TWeakPtr<IDetailLayoutBuilder> LayoutBuilder = nullptr;
  60. /** The AkGeometryComponent being customized */
  61. mutable UAkGeometryComponent* ComponentBeingCustomized = nullptr;
  62. friend class SAkGeometryCollisionMeshSurfaceController;
  63. friend class SAkGeometryStaticMeshSurfaceController;
  64. };
  65. class SAkGeometryCollisionMeshSurfaceController : public SAkGeometrySurfaceController
  66. {
  67. private:
  68. virtual FAkGeometrySurfaceOverride* GetSurfaceOverride() const override;
  69. };
  70. class SAkGeometryStaticMeshSurfaceController : public SAkGeometrySurfaceController
  71. {
  72. public:
  73. AUDIOKINETICTOOLS_API void Construct(const FArguments& InArgs
  74. , TWeakObjectPtr<UObject> ObjectBeingCustomized
  75. , const TSharedPtr<IDetailLayoutBuilder>& InLayoutBuilder
  76. , UMaterialInterface* InMaterialKey
  77. );
  78. private:
  79. virtual FAkGeometrySurfaceOverride* GetSurfaceOverride() const override;
  80. UMaterialInterface* MaterialKey;
  81. };