|
7 | 7 | #include "CesiumGlobeAnchorComponent.h" |
8 | 8 | #include "DetailCategoryBuilder.h" |
9 | 9 | #include "DetailLayoutBuilder.h" |
| 10 | +#include "DetailWidgetRow.h" |
10 | 11 | #include "IDetailGroup.h" |
11 | 12 | #include "Widgets/SToolTip.h" |
| 13 | +#include "Widgets/Text/STextBlock.h" |
| 14 | + |
| 15 | +#define LOCTEXT_NAMESPACE "CesiumGlobeAnchorCustomization" |
12 | 16 |
|
13 | 17 | FName FCesiumGlobeAnchorCustomization::RegisteredLayoutName; |
14 | 18 |
|
@@ -36,6 +40,7 @@ FCesiumGlobeAnchorCustomization::MakeInstance() { |
36 | 40 | void FCesiumGlobeAnchorCustomization::CustomizeDetails( |
37 | 41 | IDetailLayoutBuilder& DetailBuilder) { |
38 | 42 | DetailBuilder.GetObjectsBeingCustomized(this->SelectedObjects); |
| 43 | + const bool bIsMultiSelect = this->SelectedObjects.Num() > 1; |
39 | 44 |
|
40 | 45 | IDetailCategoryBuilder& CesiumCategory = DetailBuilder.EditCategory("Cesium"); |
41 | 46 |
|
@@ -67,11 +72,29 @@ void FCesiumGlobeAnchorCustomization::CustomizeDetails( |
67 | 72 | UCesiumGlobeAnchorComponent, |
68 | 73 | TeleportWhenUpdatingTransform)); |
69 | 74 |
|
70 | | - this->UpdateDerivedProperties(); |
71 | | - |
72 | | - this->CreatePositionLongitudeLatitudeHeight(DetailBuilder, CesiumCategory); |
73 | | - this->CreatePositionEarthCenteredEarthFixed(DetailBuilder, CesiumCategory); |
74 | | - this->CreateRotationEastSouthUp(DetailBuilder, CesiumCategory); |
| 75 | + if (!bIsMultiSelect) { |
| 76 | + this->UpdateDerivedProperties(); |
| 77 | + this->CreatePositionLongitudeLatitudeHeight(DetailBuilder, CesiumCategory); |
| 78 | + this->CreatePositionEarthCenteredEarthFixed(DetailBuilder, CesiumCategory); |
| 79 | + this->CreateRotationEastSouthUp(DetailBuilder, CesiumCategory); |
| 80 | + } else { |
| 81 | + FDetailWidgetRow& Row = |
| 82 | + CesiumCategory |
| 83 | + .AddCustomRow( |
| 84 | + LOCTEXT("MultipleSelectionFilter", "Multiple Selection")) |
| 85 | + .FilterString(LOCTEXT( |
| 86 | + "MultipleSelectionFilters", |
| 87 | + "Latitude Longitude Height ECEF ESU")); |
| 88 | + |
| 89 | + Row.WholeRowContent()[SNew(SBox).Padding(FMargin( |
| 90 | + 0.f, |
| 91 | + 4.f))[SNew(STextBlock) |
| 92 | + .Text(LOCTEXT( |
| 93 | + "MultiSelectInfo", |
| 94 | + "Multiple actors selected. Geodetic position (Latitude, Longitude, Height; ECEF) and " |
| 95 | + "ESU rotation cannot be edited in multi-select. Select a single actor to edit these values.")) |
| 96 | + .AutoWrapText(true)]]; |
| 97 | + } |
75 | 98 | } |
76 | 99 |
|
77 | 100 | void FCesiumGlobeAnchorCustomization::CreatePositionEarthCenteredEarthFixed( |
@@ -296,3 +319,5 @@ TStatId UCesiumGlobeAnchorDerivedProperties::GetStatId() const { |
296 | 319 | UCesiumGlobeAnchorRotationEastSouthUp, |
297 | 320 | STATGROUP_Tickables); |
298 | 321 | } |
| 322 | + |
| 323 | +#undef LOCTEXT_NAMESPACE |
0 commit comments