SoundBankStatusColumn.cpp 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. #include "SoundBankStatusColumn.h"
  16. #include "WwiseBrowserHelpers.h"
  17. #include "Widgets/SWidget.h"
  18. #include "Widgets/Layout/SSpacer.h"
  19. #include "Widgets/Text/STextBlock.h"
  20. #define LOCTEXT_NAMESPACE "AkAudio"
  21. FText FSoundBankStatusColumn::GetDisplayedName(FWwiseTreeItemPtr TreeItem)
  22. {
  23. if(!TreeItem->ShouldDisplayInfo())
  24. {
  25. return LOCTEXT("WwiseBrowserEmpty", "");
  26. }
  27. if(TreeItem->IsUAssetUpToDate())
  28. {
  29. return LOCTEXT("UAssetStatusUpToDate", "UAsset Up to Date");
  30. }
  31. else if(TreeItem->IsUAssetOutOfDate())
  32. {
  33. return LOCTEXT("UAssetOutOfDate", "UAsset Needs Update");
  34. }
  35. else if(TreeItem->IsRenamedInSoundBank())
  36. {
  37. return LOCTEXT("UAssetStatusRename", "Renamed in SoundBank");
  38. }
  39. else if(TreeItem->IsUAssetOrphaned())
  40. {
  41. return LOCTEXT("UAssetStatusOrphaned", "UAsset Orphaned");
  42. }
  43. else if(TreeItem->HasMultipleUAssets())
  44. {
  45. return LOCTEXT("UAssetStatusMultiple", "Multiple UAssets");
  46. }
  47. else if(TreeItem->IsUAssetMissing())
  48. {
  49. return LOCTEXT("UAssetStatusMissing", "UAsset Missing");
  50. }
  51. return LOCTEXT("UAssetStatusNotInSoundBank", "Not in SoundBank or Unreal");
  52. }
  53. FName FSoundBankStatusColumn::GetColumnId()
  54. {
  55. return FName("SoundBankStatus");
  56. }
  57. const TSharedRef<SWidget> FSoundBankStatusColumn::ConstructRowWidget(FWwiseTreeItemPtr TreeItem,
  58. const STableRow<FWwiseTreeItemPtr>& Row)
  59. {
  60. return SNew(SHorizontalBox)
  61. + SHorizontalBox::Slot()
  62. .AutoWidth()
  63. [
  64. SNew(SSpacer)
  65. .Size(8.f)
  66. ]
  67. + SHorizontalBox::Slot()
  68. .AutoWidth().
  69. VAlign(VAlign_Center)
  70. [
  71. SNew(STextBlock)
  72. .Text(GetDisplayedName(TreeItem))
  73. .ColorAndOpacity(WwiseBrowserHelpers::GetTextColor(TreeItem->IsUAssetUpToDate()))
  74. ];
  75. }
  76. SHeaderRow::FColumn::FArguments FSoundBankStatusColumn::ConstructHeaderRowColumn()
  77. {
  78. auto UEStatusColumnHeader = SHeaderRow::Column(GetColumnId());
  79. TAttribute<FText> UEStatusLabel;
  80. UEStatusLabel.Set(FText::FromString("SoundBanks vs UAssets"));
  81. UEStatusColumnHeader.DefaultLabel(UEStatusLabel);
  82. UEStatusColumnHeader.DefaultTooltip(LOCTEXT("SoundBankColumn_Tooltip", "The status of the UAssets compared to the information in the Generated SoundBanks."));
  83. return UEStatusColumnHeader;
  84. }
  85. #undef LOCTEXT_NAMESPACE