void FIOSTargetSettingsCustomization::BuildImageRow(IDetailLayoutBuilder& DetailLayout, IDetailCategoryBuilder& Category, const FPlatformIconInfo& Info, const FVector2D& MaxDisplaySize) { const FString AutomaticImagePath = EngineGraphicsPath / Info.IconPath; const FString TargetImagePath = GameGraphicsPath / Info.IconPath; Category.AddCustomRow(Info.IconName.ToString()) .NameContent() [ SNew(SHorizontalBox) + SHorizontalBox::Slot() .Padding(FMargin(0, 1, 0, 1)) .FillWidth(1.0f) [ SNew(STextBlock) .Text(Info.IconName) .Font(DetailLayout.GetDetailFont()) ] ] .ValueContent() .MaxDesiredWidth(400.0f) .MinDesiredWidth(100.0f) [ SNew(SHorizontalBox) + SHorizontalBox::Slot() .FillWidth(1.0f) .VAlign(VAlign_Center) [ SNew(SExternalImageReference, AutomaticImagePath, TargetImagePath) .FileDescription(Info.IconDescription) .RequiredSize(Info.IconRequiredSize) .MaxDisplaySize(MaxDisplaySize) ] ]; }
void FAndroidTargetSettingsCustomization::BuildIconSection(IDetailLayoutBuilder& DetailLayout) { // Icon category IDetailCategoryBuilder& IconCategory = DetailLayout.EditCategory(TEXT("Icons")); IconCategory.AddCustomRow(TEXT("Icons Hyperlink"), false) .WholeRowWidget [ SNew(SBox) .HAlign(HAlign_Center) [ SNew(SHyperlinkLaunchURL, TEXT("http://developer.android.com/design/style/iconography.html")) .Text(LOCTEXT("AndroidDeveloperIconographyPage", "Android Developer Page on Iconography")) .ToolTipText(LOCTEXT("AndroidDeveloperIconographyPageTooltip", "Opens a page on Android Iconography")) ] ]; for (const FPlatformIconInfo& Info : IconNames) { const FString AutomaticImagePath = EngineAndroidPath / Info.IconPath; const FString TargetImagePath = GameAndroidPath / Info.IconPath; IconCategory.AddCustomRow(Info.IconName.ToString()) .NameContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .Padding( FMargin( 0, 1, 0, 1 ) ) .FillWidth(1.0f) [ SNew(STextBlock) .Text(Info.IconName) .Font(DetailLayout.GetDetailFont()) ] ] .ValueContent() .MaxDesiredWidth(400.0f) .MinDesiredWidth(100.0f) [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .FillWidth(1.0f) .VAlign(VAlign_Center) [ SNew(SExternalImageReference, AutomaticImagePath, TargetImagePath) .FileDescription(Info.IconDescription) .RequiredSize(Info.IconRequiredSize) .MaxDisplaySize(FVector2D(Info.IconRequiredSize)) ] ]; } }
void FPluginMetadataCustomization::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder) { TArray<TWeakObjectPtr<UObject>> Objects; DetailBuilder.GetObjectsBeingCustomized(Objects); if(Objects.Num() == 1 && Objects[0].IsValid()) { UPluginMetadataObject* PluginMetadata = Cast<UPluginMetadataObject>(Objects[0].Get()); if(PluginMetadata != nullptr && PluginMetadata->TargetIconPath.Len() > 0) { // Get the current icon path FString CurrentIconPath = PluginMetadata->TargetIconPath; if(!FPaths::FileExists(CurrentIconPath)) { CurrentIconPath = IPluginManager::Get().FindPlugin(TEXT("PluginBrowser"))->GetBaseDir() / TEXT("Resources") / TEXT("DefaultIcon128.png"); } // Add the customization to edit the icon row IDetailCategoryBuilder& ImageCategory = DetailBuilder.EditCategory(TEXT("Icon")); const FText IconDesc(NSLOCTEXT("PluginBrowser", "PluginIcon", "Icon")); ImageCategory.AddCustomRow(IconDesc) .NameContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .Padding( FMargin( 0, 1, 0, 1 ) ) .FillWidth(1.0f) [ SNew(STextBlock) .Text(IconDesc) .Font(DetailBuilder.GetDetailFont()) ] ] .ValueContent() .MaxDesiredWidth(500.0f) .MinDesiredWidth(100.0f) [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .FillWidth(1.0f) .VAlign(VAlign_Center) [ SNew(SExternalImageReference, CurrentIconPath, PluginMetadata->TargetIconPath) .FileDescription(IconDesc) .RequiredSize(FIntPoint(128, 128)) ] ]; } } }
void FGeneralProjectSettingsDetails::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder) { IDetailCategoryBuilder& ImageCategory = DetailBuilder.EditCategory(TEXT("About")); const FText ProjectThumbnailDesc(LOCTEXT("ProjectThumbnailLabel", "Project Thumbnail")); const FString ProjectThumbnail_TargetImagePath = FPaths::GetPath(FPaths::GetProjectFilePath()) / FString::Printf(TEXT("%s.png"), FApp::GetGameName()); FString ProjectThumbnail_AutomaticImagePath = FPaths::GameSavedDir() / TEXT("AutoScreenshot.png"); if (!FPaths::FileExists(ProjectThumbnail_AutomaticImagePath)) { ProjectThumbnail_AutomaticImagePath = FPaths::EngineContentDir() / TEXT("Editor") / TEXT("Slate") / TEXT("GameProjectDialog") / TEXT("default_game_thumbnail_192x.png"); } ImageCategory.AddCustomRow(ProjectThumbnailDesc) .NameContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .Padding( FMargin( 0, 1, 0, 1 ) ) .FillWidth(1.0f) [ SNew(STextBlock) .Text(ProjectThumbnailDesc) .Font(DetailBuilder.GetDetailFont()) ] ] .ValueContent() .MaxDesiredWidth(500.0f) .MinDesiredWidth(100.0f) [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .FillWidth(1.0f) .VAlign(VAlign_Center) [ SNew(SExternalImageReference, ProjectThumbnail_AutomaticImagePath, ProjectThumbnail_TargetImagePath) .FileDescription(ProjectThumbnailDesc) .RequiredSize(FIntPoint(192, 192)) ] ]; }
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION void FLandscapeEditorDetailCustomization_MiscTools::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder) { IDetailCategoryBuilder& ToolsCategory = DetailBuilder.EditCategory("Tool Settings"); if (IsBrushSetActive("BrushSet_Component")) { ToolsCategory.AddCustomRow(LOCTEXT("Component.ClearSelection", "Clear Component Selection")) .Visibility(TAttribute<EVisibility>::Create(TAttribute<EVisibility>::FGetter::CreateStatic(&FLandscapeEditorDetailCustomization_MiscTools::GetClearComponentSelectionVisibility))) [ SNew(SButton) .Text(LOCTEXT("Component.ClearSelection", "Clear Component Selection")) .HAlign(HAlign_Center) .OnClicked_Static(&FLandscapeEditorDetailCustomization_MiscTools::OnClearComponentSelectionButtonClicked) ]; } //if (IsToolActive("Mask")) { ToolsCategory.AddCustomRow(LOCTEXT("Mask.ClearSelection", "Clear Region Selection")) .Visibility(TAttribute<EVisibility>::Create(TAttribute<EVisibility>::FGetter::CreateStatic(&FLandscapeEditorDetailCustomization_MiscTools::GetClearRegionSelectionVisibility))) [ SNew(SButton) .Text(LOCTEXT("Mask.ClearSelection", "Clear Region Selection")) .HAlign(HAlign_Center) .OnClicked_Static(&FLandscapeEditorDetailCustomization_MiscTools::OnClearRegionSelectionButtonClicked) ]; } if (IsToolActive("Splines")) { ToolsCategory.AddCustomRow(LOCTEXT("ApplySplinesLabel", "Apply Splines")) [ SNew(SHorizontalBox) + SHorizontalBox::Slot() .Padding(0, 6, 0, 0) [ SNew(STextBlock) .Font(DetailBuilder.GetDetailFont()) .ShadowOffset(FVector2D::UnitVector) .Text(LOCTEXT("Spline.ApplySplines", "Deform Landscape to Splines:")) ] ]; ToolsCategory.AddCustomRow(LOCTEXT("ApplySplinesLabel", "Apply Splines")) [ SNew(SHorizontalBox) + SHorizontalBox::Slot() [ SNew(SButton) .ToolTipText(LOCTEXT("Spline.ApplySplines.All.Tooltip", "Deforms and paints the landscape to fit all the landscape spline segments and controlpoints.")) .Text(LOCTEXT("Spline.ApplySplines.All", "All Splines")) .HAlign(HAlign_Center) .OnClicked_Static(&FLandscapeEditorDetailCustomization_MiscTools::OnApplyAllSplinesButtonClicked) ] + SHorizontalBox::Slot() [ SNew(SButton) .ToolTipText(LOCTEXT("Spline.ApplySplines.Tooltip", "Deforms and paints the landscape to fit only the selected landscape spline segments and controlpoints.")) .Text(LOCTEXT("Spline.ApplySplines.Selected", "Only Selected")) .HAlign(HAlign_Center) .OnClicked_Static(&FLandscapeEditorDetailCustomization_MiscTools::OnApplySelectedSplinesButtonClicked) ] ]; ToolsCategory.AddCustomRow(LOCTEXT("Spline.bUseAutoRotateControlPoint.Selected", "Use Auto Rotate Control Point")) [ SNew(SHorizontalBox) + SHorizontalBox::Slot() .Padding(0, 6, 0, 0) [ SNew(SCheckBox) .OnCheckStateChanged(this, &FLandscapeEditorDetailCustomization_MiscTools::OnbUseAutoRotateControlPointChanged) .IsChecked(this, &FLandscapeEditorDetailCustomization_MiscTools::GetbUseAutoRotateControlPoint) .Content() [ SNew(STextBlock).Text(LOCTEXT("Spline.bUseAutoRotateControlPoint.Selected", "Use Auto Rotate Control Point")) ] ] ]; } if (IsToolActive("Ramp")) { ToolsCategory.AddCustomRow(LOCTEXT("RampLabel", "Ramp")) [ SNew(SHorizontalBox) + SHorizontalBox::Slot() .Padding(0, 6, 0, 0) [ SNew(STextBlock) .Font(DetailBuilder.GetDetailFont()) .ShadowOffset(FVector2D::UnitVector) .Text(LOCTEXT("Ramp.Hint", "Click to add ramp points, then press \"Add Ramp\".")) ] ]; ToolsCategory.AddCustomRow(LOCTEXT("ApplyRampLabel", "Apply Ramp")) [ SNew(SBox) .Padding(FMargin(0, 0, 12, 0)) // Line up with the other properties due to having no reset to default button [ SNew(SHorizontalBox) + SHorizontalBox::Slot() .Padding(0, 0, 3, 0) [ SNew(SButton) .Text(LOCTEXT("Ramp.Reset", "Reset")) .HAlign(HAlign_Center) .OnClicked_Static(&FLandscapeEditorDetailCustomization_MiscTools::OnResetRampButtonClicked) ] + SHorizontalBox::Slot() .Padding(3, 0, 0, 0) [ SNew(SButton) .IsEnabled_Static(&FLandscapeEditorDetailCustomization_MiscTools::GetApplyRampButtonIsEnabled) .Text(LOCTEXT("Ramp.Apply", "Add Ramp")) .HAlign(HAlign_Center) .OnClicked_Static(&FLandscapeEditorDetailCustomization_MiscTools::OnApplyRampButtonClicked) ] ] ]; } if (IsToolActive("Mirror")) { ToolsCategory.AddProperty(GET_MEMBER_NAME_CHECKED(ULandscapeEditorObject, MirrorPoint)); ToolsCategory.AddProperty(GET_MEMBER_NAME_CHECKED(ULandscapeEditorObject, MirrorOp)); ToolsCategory.AddCustomRow(LOCTEXT("ApplyMirrorLabel", "Apply Mirror")) [ SNew(SBox) .Padding(FMargin(0, 0, 12, 0)) // Line up with the other properties due to having no reset to default button [ SNew(SHorizontalBox) + SHorizontalBox::Slot() .Padding(0, 0, 3, 0) [ SNew(SButton) .Text(LOCTEXT("Mirror.Reset", "Recenter")) .HAlign(HAlign_Center) .OnClicked_Lambda(&FLandscapeEditorDetailCustomization_MiscTools::OnResetMirrorPointButtonClicked) ] + SHorizontalBox::Slot() .Padding(3, 0, 0, 0) [ SNew(SButton) //.IsEnabled_Static(&FLandscapeEditorDetailCustomization_MiscTools::GetApplyMirrorButtonIsEnabled) .Text(LOCTEXT("Mirror.Apply", "Apply")) .HAlign(HAlign_Center) .OnClicked_Static(&FLandscapeEditorDetailCustomization_MiscTools::OnApplyMirrorButtonClicked) ] ] ]; } }
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION void FLandscapeEditorDetailCustomization_CopyPaste::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder) { if (!IsToolActive("ToolSet_CopyPaste")) { return; } IDetailCategoryBuilder& ToolsCategory = DetailBuilder.EditCategory("Tool Settings"); ToolsCategory.AddCustomRow("Copy Data to Gizmo") [ SNew(SButton) .ToolTipText(LOCTEXT("CopyToGizmo.Tooltip", "Copies the data within the gizmo bounds to the gizmo taking into account any masking from selected regions.")) .Text(LOCTEXT("CopyToGizmo", "Copy Data to Gizmo")) .HAlign(HAlign_Center) .OnClicked_Static(&FLandscapeEditorDetailCustomization_CopyPaste::OnCopyToGizmoButtonClicked) ]; ToolsCategory.AddCustomRow("Fit Gizmo to Selected Regions") [ SNew(SButton) .ToolTipText(LOCTEXT("FitGizmoToSelection.Tooltip", "Positions and resizes the gizmo so that it completely encompasses all region selections.")) .Text(LOCTEXT("FitGizmoToSelection", "Fit Gizmo to Selected Regions")) .HAlign(HAlign_Center) .OnClicked_Static(&FLandscapeEditorDetailCustomization_CopyPaste::OnFitGizmoToSelectionButtonClicked) ]; ToolsCategory.AddCustomRow("Fit Height Values to Gizmo Size") [ SNew(SButton) .ToolTipText(LOCTEXT("FitHeightsToGizmo.Tooltip", "Scales the data in the gizmo to fit the gizmo's Z size")) .Text(LOCTEXT("FitHeightsToGizmo", "Fit Height Values to Gizmo Size")) .HAlign(HAlign_Center) .OnClicked_Static(&FLandscapeEditorDetailCustomization_CopyPaste::OnFitHeightsToGizmoButtonClicked) ]; ToolsCategory.AddCustomRow("Clear Gizmo Data") [ SNew(SButton) .ToolTipText(LOCTEXT("ClearGizmoData.Tooltip", "Clears the gizmo of any copied data.")) .Text(LOCTEXT("ClearGizmoData", "Clear Gizmo Data")) .HAlign(HAlign_Center) .OnClicked_Static(&FLandscapeEditorDetailCustomization_CopyPaste::OnClearGizmoDataButtonClicked) ]; IDetailGroup& GizmoImportExportGroup = ToolsCategory.AddGroup("Gizmo Import / Export", LOCTEXT("ImportExportTitle", "Gizmo Import / Export").ToString(), true); TSharedRef<IPropertyHandle> PropertyHandle_Heightmap = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(ULandscapeEditorObject, GizmoHeightmapFilenameString)); DetailBuilder.HideProperty(PropertyHandle_Heightmap); GizmoImportExportGroup.AddPropertyRow(PropertyHandle_Heightmap) .CustomWidget() .NameContent() [ PropertyHandle_Heightmap->CreatePropertyNameWidget() ] .ValueContent() .MinDesiredWidth(250.0f) .MaxDesiredWidth(0) [ SNew(SHorizontalBox) + SHorizontalBox::Slot() [ PropertyHandle_Heightmap->CreatePropertyValueWidget() ] + SHorizontalBox::Slot() .AutoWidth() //.Padding(0,0,12,0) // Line up with the other properties due to having no reset to default button [ SNew(SButton) .ContentPadding(FMargin(4, 0)) .Text(NSLOCTEXT("UnrealEd", "GenericOpenDialog", "...")) .OnClicked_Static(&FLandscapeEditorDetailCustomization_CopyPaste::OnGizmoHeightmapFilenameButtonClicked, PropertyHandle_Heightmap) ] ]; TSharedRef<IPropertyHandle> PropertyHandle_ImportSize = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(ULandscapeEditorObject, GizmoImportSize)); TSharedRef<IPropertyHandle> PropertyHandle_ImportSize_X = PropertyHandle_ImportSize->GetChildHandle("X").ToSharedRef(); TSharedRef<IPropertyHandle> PropertyHandle_ImportSize_Y = PropertyHandle_ImportSize->GetChildHandle("Y").ToSharedRef(); DetailBuilder.HideProperty(PropertyHandle_ImportSize); GizmoImportExportGroup.AddPropertyRow(PropertyHandle_ImportSize) .CustomWidget() .NameContent() [ PropertyHandle_ImportSize->CreatePropertyNameWidget() ] .ValueContent() [ SNew(SHorizontalBox) + SHorizontalBox::Slot() .FillWidth(1) [ SNew(SNumericEntryBox<int32>) .LabelVAlign(VAlign_Center) .Font(DetailBuilder.GetDetailFont()) .MinValue(1) .MaxValue(8192) .MinSliderValue(1) .MaxSliderValue(8192) .AllowSpin(true) .UndeterminedString(NSLOCTEXT("PropertyEditor", "MultipleValues", "Multiple Values")) .Value_Static(&FLandscapeEditorDetailCustomization_Base::OnGetValue, PropertyHandle_ImportSize_X) .OnValueChanged_Static(&FLandscapeEditorDetailCustomization_Base::OnValueChanged, PropertyHandle_ImportSize_X) .OnValueCommitted_Static(&FLandscapeEditorDetailCustomization_Base::OnValueCommitted, PropertyHandle_ImportSize_X) ] + SHorizontalBox::Slot() .AutoWidth() .Padding(2, 0) .VAlign(VAlign_Center) [ SNew(STextBlock) .Font(DetailBuilder.GetDetailFont()) .Text(FString().AppendChar(0xD7)) // Multiply sign ] + SHorizontalBox::Slot() .FillWidth(1) [ SNew(SNumericEntryBox<int32>) .LabelVAlign(VAlign_Center) .Font(DetailBuilder.GetDetailFont()) .MinValue(1) .MaxValue(8192) .MinSliderValue(1) .MaxSliderValue(8192) .AllowSpin(true) .UndeterminedString(NSLOCTEXT("PropertyEditor", "MultipleValues", "Multiple Values")) .Value_Static(&FLandscapeEditorDetailCustomization_Base::OnGetValue, PropertyHandle_ImportSize_Y) .OnValueChanged_Static(&FLandscapeEditorDetailCustomization_Base::OnValueChanged, PropertyHandle_ImportSize_Y) .OnValueCommitted_Static(&FLandscapeEditorDetailCustomization_Base::OnValueCommitted, PropertyHandle_ImportSize_Y) ] ]; TSharedRef<IPropertyHandle> PropertyHandle_ImportLayers = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(ULandscapeEditorObject, GizmoImportLayers)); DetailBuilder.HideProperty(PropertyHandle_ImportLayers); GizmoImportExportGroup.AddPropertyRow(PropertyHandle_ImportLayers); GizmoImportExportGroup.AddWidgetRow() .FilterString("") [ SNew(SHorizontalBox) + SHorizontalBox::Slot() .AutoWidth() [ SNew(SButton) .Text(LOCTEXT("GizmoImport", "Import")) .IsEnabled(this, &FLandscapeEditorDetailCustomization_CopyPaste::GetGizmoImportButtonIsEnabled) .OnClicked(this, &FLandscapeEditorDetailCustomization_CopyPaste::OnGizmoImportButtonClicked) ] + SHorizontalBox::Slot() .AutoWidth() [ SNew(SButton) .Text(LOCTEXT("GizmoExport", "Export")) .OnClicked(this, &FLandscapeEditorDetailCustomization_CopyPaste::OnGizmoExportButtonClicked) ] ]; //GuessGizmoImportSize(); }
void FIOSTargetSettingsCustomization::BuildPListSection(IDetailLayoutBuilder& DetailLayout) { // Info.plist category IDetailCategoryBuilder& AppManifestCategory = DetailLayout.EditCategory(TEXT("Info.plist")); IDetailCategoryBuilder& BundleCategory = DetailLayout.EditCategory(TEXT("Bundle Information")); IDetailCategoryBuilder& OrientationCategory = DetailLayout.EditCategory(TEXT("Orientation")); IDetailCategoryBuilder& RenderCategory = DetailLayout.EditCategory(TEXT("Rendering")); TSharedRef<SPlatformSetupMessage> PlatformSetupMessage = SNew(SPlatformSetupMessage, GameInfoPath) .PlatformName(LOCTEXT("iOSPlatformName", "iOS")) .OnSetupClicked(this, &FIOSTargetSettingsCustomization::CopySetupFilesIntoProject); SetupForPlatformAttribute = PlatformSetupMessage->GetReadyToGoAttribute(); AppManifestCategory.AddCustomRow(TEXT("Warning"), false) .WholeRowWidget [ PlatformSetupMessage ]; AppManifestCategory.AddCustomRow(TEXT("Info.plist Hyperlink"), false) .WholeRowWidget [ SNew(SBox) .HAlign(HAlign_Center) [ SNew(SHyperlinkLaunchURL, TEXT("https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html")) .Text(LOCTEXT("ApplePlistPage", "About Information Property List Files")) .ToolTipText(LOCTEXT("ApplePlistPageTooltip", "Opens a page that discusses Info.plist")) ] ]; AppManifestCategory.AddCustomRow(TEXT("Info.plist"), false) .IsEnabled(SetupForPlatformAttribute) .NameContent() [ SNew(SHorizontalBox) + SHorizontalBox::Slot() .Padding(FMargin(0, 1, 0, 1)) .FillWidth(1.0f) [ SNew(STextBlock) .Text(LOCTEXT("PlistLabel", "Info.plist")) .Font(DetailLayout.GetDetailFont()) ] ] .ValueContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .AutoWidth() [ SNew(SButton) .Text(LOCTEXT("OpenPlistFolderButton", "Open PList Folder")) .ToolTipText(LOCTEXT("OpenPlistFolderButton_Tooltip", "Opens the folder containing the plist for the current project in Explorer or Finder")) .OnClicked(this, &FIOSTargetSettingsCustomization::OpenPlistFolder) ] ]; // Show properties that are gated by the plist being present and writable FSimpleDelegate PlistModifiedDelegate = FSimpleDelegate::CreateRaw(this, &FIOSTargetSettingsCustomization::OnPlistPropertyModified); #define SETUP_PLIST_PROP(PropName, Category, Tip) \ { \ TSharedRef<IPropertyHandle> PropertyHandle = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UIOSRuntimeSettings, PropName)); \ PropertyHandle->SetOnPropertyValueChanged(PlistModifiedDelegate); \ Category.AddProperty(PropertyHandle) \ .EditCondition(SetupForPlatformAttribute, NULL) \ .ToolTip(Tip); \ } SETUP_PLIST_PROP(BundleDisplayName, BundleCategory, TEXT("Specifies the the display name for the application. This will be displayed under the icon on the device.")); SETUP_PLIST_PROP(BundleName, BundleCategory, TEXT("Specifies the the name of the application bundle. This is the short name for the application bundle.")); SETUP_PLIST_PROP(BundleIdentifier, BundleCategory, TEXT("Specifies the bundle identifier for the application.")); SETUP_PLIST_PROP(VersionInfo, BundleCategory, TEXT("Specifies the version for the application.")); SETUP_PLIST_PROP(bSupportsPortraitOrientation, OrientationCategory, TEXT("Supports default portrait orientation. Landscape will not be supported.")); SETUP_PLIST_PROP(bSupportsUpsideDownOrientation, OrientationCategory, TEXT("Supports upside down portrait orientation. Landscape will not be supported.")); SETUP_PLIST_PROP(bSupportsLandscapeLeftOrientation, OrientationCategory, TEXT("Supports left landscape orientation. Protrait will not be supported.")); SETUP_PLIST_PROP(bSupportsLandscapeRightOrientation, OrientationCategory, TEXT("Supports right landscape orientation. Protrait will not be supported.")); SETUP_PLIST_PROP(bSupportsMetal, RenderCategory, TEXT("Whether or not to add support for Metal API (requires IOS8 and A7 processors).")); SETUP_PLIST_PROP(bSupportsOpenGLES2, RenderCategory, TEXT("Whether or not to add support for OpenGL ES2 (if this is false, then your game should specify minimum IOS8 version and use \"metal\" instead of \"opengles-2\" in UIRequiredDeviceCapabilities)")); #undef SETUP_PLIST_PROP }
void FInternationalizationSettingsModelDetails::CustomizeDetails( IDetailLayoutBuilder& DetailBuilder ) { FInternationalization& I18N = FInternationalization::Get(); TArray< TWeakObjectPtr<UObject> > ObjectsBeingCustomized; DetailBuilder.GetObjectsBeingCustomized(ObjectsBeingCustomized); check(ObjectsBeingCustomized.Num() == 1); if(ObjectsBeingCustomized[0].IsValid()) { Model = Cast<UInternationalizationSettingsModel>(ObjectsBeingCustomized[0].Get()); } check(Model.IsValid()); Model->OnSettingChanged().AddRaw(this, &FInternationalizationSettingsModelDetails::OnSettingsChanged); // If the saved culture is not the same as the actual current culture, a restart is needed to sync them fully and properly. FString SavedCultureName = Model->GetCultureName(); if ( !SavedCultureName.IsEmpty() && SavedCultureName != I18N.GetCurrentCulture()->GetName() ) { SelectedCulture = I18N.GetCulture(SavedCultureName); RequiresRestart = true; } else { SelectedCulture = I18N.GetCurrentCulture(); RequiresRestart = false; } // Populate all our cultures RefreshAvailableCultures(); IDetailCategoryBuilder& CategoryBuilder = DetailBuilder.EditCategory("Internationalization"); const FText LanguageToolTipText = LOCTEXT("EditorLanguageTooltip", "Change the Editor language (requires restart to take effect)"); // For use in the Slate macros below, the type must be typedef'd to compile. typedef FCulturePtr ThreadSafeCulturePtr; CategoryBuilder.AddCustomRow("Language") .NameContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .Padding( FMargin( 0, 1, 0, 1 ) ) .FillWidth(1.0f) [ SNew(STextBlock) .Text(LOCTEXT("EditorLanguageLabel", "Language")) .Font(DetailBuilder.GetDetailFont()) .ToolTipText(LanguageToolTipText) ] ] .ValueContent() .MaxDesiredWidth(300.0f) [ SAssignNew(LanguageComboBox, SComboBox< ThreadSafeCulturePtr > ) .OptionsSource( &AvailableLanguages ) .InitiallySelectedItem(SelectedLanguage) .OnGenerateWidget(this, &FInternationalizationSettingsModelDetails::OnLanguageGenerateWidget, &DetailBuilder) .ToolTipText(LanguageToolTipText) .OnSelectionChanged(this, &FInternationalizationSettingsModelDetails::OnLanguageSelectionChanged) .Content() [ SNew(STextBlock) .Text(this, &FInternationalizationSettingsModelDetails::GetCurrentLanguageText) .Font(DetailBuilder.GetDetailFont()) ] ]; const FText RegionToolTipText = LOCTEXT("EditorRegionTooltip", "Change the Editor region (requires restart to take effect)"); CategoryBuilder.AddCustomRow("Region") .NameContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .Padding( FMargin( 0, 1, 0, 1 ) ) .FillWidth(1.0f) [ SNew(STextBlock) .Text(LOCTEXT("EditorRegionLabel", "Region")) .Font(DetailBuilder.GetDetailFont()) .ToolTipText(RegionToolTipText) ] ] .ValueContent() .MaxDesiredWidth(300.0f) [ SAssignNew(RegionComboBox, SComboBox< ThreadSafeCulturePtr > ) .OptionsSource( &AvailableRegions ) .InitiallySelectedItem(SelectedCulture) .OnGenerateWidget(this, &FInternationalizationSettingsModelDetails::OnRegionGenerateWidget, &DetailBuilder) .ToolTipText(RegionToolTipText) .OnSelectionChanged(this, &FInternationalizationSettingsModelDetails::OnRegionSelectionChanged) .IsEnabled(this, &FInternationalizationSettingsModelDetails::IsRegionSelectionAllowed) .Content() [ SNew(STextBlock) .Text(this, &FInternationalizationSettingsModelDetails::GetCurrentRegionText) .Font(DetailBuilder.GetDetailFont()) ] ]; const FText FieldNamesToolTipText = LOCTEXT("EditorFieldNamesTooltip", "Toggle showing localized field names (requires restart to take effect)"); CategoryBuilder.AddCustomRow("FieldNames") .NameContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .Padding( FMargin( 0, 1, 0, 1 ) ) .FillWidth(1.0f) [ SNew(STextBlock) .Text(LOCTEXT("EditorFieldNamesLabel", "Use Localized Field Names")) .Font(DetailBuilder.GetDetailFont()) .ToolTipText(FieldNamesToolTipText) ] ] .ValueContent() .MaxDesiredWidth(300.0f) [ SAssignNew(FieldNamesCheckBox, SCheckBox) .IsChecked(Model->ShouldLoadLocalizedPropertyNames() ? ESlateCheckBoxState::Checked : ESlateCheckBoxState::Unchecked) .ToolTipText(FieldNamesToolTipText) .OnCheckStateChanged(this, &FInternationalizationSettingsModelDetails::ShoudLoadLocalizedFieldNamesCheckChanged) ]; CategoryBuilder.AddCustomRow("RestartWarning") .Visibility( TAttribute<EVisibility>(this, &FInternationalizationSettingsModelDetails::GetInternationalizationRestartRowVisibility) ) .WholeRowContent() .HAlign(HAlign_Center) [ SNew( SHorizontalBox ) +SHorizontalBox::Slot() .AutoWidth() .VAlign(VAlign_Center) .Padding(2.0f, 0.0f) [ SNew( SImage ) .Image( FCoreStyle::Get().GetBrush("Icons.Warning") ) ] +SHorizontalBox::Slot() .FillWidth(1.0f) .VAlign(VAlign_Center) [ SNew( STextBlock ) .Text( LOCTEXT("RestartWarningText", "Changes require restart to take effect.") ) .Font(DetailBuilder.GetDetailFont()) ] ]; }
void FAndroidTargetSettingsCustomization::BuildAppManifestSection(IDetailLayoutBuilder& DetailLayout) { // App manifest category IDetailCategoryBuilder& AppManifestCategory = DetailLayout.EditCategory(TEXT("AppManifest")); TSharedRef<SPlatformSetupMessage> PlatformSetupMessage = SNew(SPlatformSetupMessage, GameManifestPath) .PlatformName(LOCTEXT("AndroidPlatformName", "Android")) .OnSetupClicked(this, &FAndroidTargetSettingsCustomization::CopySetupFilesIntoProject); SetupForPlatformAttribute = PlatformSetupMessage->GetReadyToGoAttribute(); AppManifestCategory.AddCustomRow(TEXT("Warning"), false) .WholeRowWidget [ PlatformSetupMessage ]; AppManifestCategory.AddCustomRow(TEXT("App Manifest Hyperlink"), false) .WholeRowWidget [ SNew(SBox) .HAlign(HAlign_Center) [ SNew(SHyperlinkLaunchURL, TEXT("http://developer.android.com/guide/topics/manifest/manifest-intro.html")) .Text(LOCTEXT("AndroidDeveloperManifestPage", "Android Developer Page on the App Manifest")) .ToolTipText(LOCTEXT("AndroidDeveloperManifestPageTooltip", "Opens a page that discusses the App Manifest")) ] ]; AppManifestCategory.AddCustomRow(TEXT("App Manifest"), false) .IsEnabled(SetupForPlatformAttribute) .NameContent() [ SNew(SHorizontalBox) + SHorizontalBox::Slot() .Padding(FMargin(0, 1, 0, 1)) .FillWidth(1.0f) [ SNew(STextBlock) .Text(LOCTEXT("AppManifestLabel", "App Manifest")) .Font(DetailLayout.GetDetailFont()) ] ] .ValueContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .AutoWidth() [ SNew(SButton) .Text(LOCTEXT("OpenManifestFolderButton", "Open Manifest Folder")) .ToolTipText(LOCTEXT("OpenManifestFolderButton_Tooltip", "Opens the folder containing the manifest (AndroidManifest.xml) in Explorer or Finder")) .OnClicked(this, &FAndroidTargetSettingsCustomization::OpenManifestFolder) ] ]; // Show properties that are gated by the manifest file being present and writable TSharedRef<IPropertyHandle> OrientationProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, Orientation)); OrientationProperty->SetOnPropertyValueChanged(FSimpleDelegate::CreateRaw(this, &FAndroidTargetSettingsCustomization::OnOrientationModified)); AppManifestCategory.AddProperty(OrientationProperty) .EditCondition(SetupForPlatformAttribute, NULL); TSharedRef<IPropertyHandle> DepthBufferPreferenceProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, DepthBufferPreference)); DepthBufferPreferenceProperty->SetOnPropertyValueChanged(FSimpleDelegate::CreateRaw(this, &FAndroidTargetSettingsCustomization::OnDepthBufferPreferenceModified)); AppManifestCategory.AddProperty(DepthBufferPreferenceProperty) .EditCondition(SetupForPlatformAttribute, NULL); // Google Play category IDetailCategoryBuilder& GooglePlayCategory = DetailLayout.EditCategory(TEXT("GooglePlayServices")); TSharedRef<SPlatformSetupMessage> GooglePlaySetupMessage = SNew(SPlatformSetupMessage, GameGooglePlayAppIDPath) .PlatformName(LOCTEXT("GooglePlayPlatformName", "Google Play services")) .OnSetupClicked(this, &FAndroidTargetSettingsCustomization::CopyGooglePlayAppIDFileIntoProject); SetupForGooglePlayAttribute = GooglePlaySetupMessage->GetReadyToGoAttribute(); GooglePlayCategory.AddCustomRow(TEXT("Warning"), false) .WholeRowWidget [ GooglePlaySetupMessage ]; GooglePlayCategory.AddCustomRow(TEXT("App ID Hyperlink"), false) .WholeRowWidget [ SNew(SBox) .HAlign(HAlign_Center) [ SNew(SHyperlinkLaunchURL, TEXT("http://developer.android.com/google/index.html")) .Text(LOCTEXT("GooglePlayDeveloperPage", "Android Developer Page on Google Play services")) .ToolTipText(LOCTEXT("GooglePlayDeveloperPageTooltip", "Opens a page that discusses Google Play services")) ] ]; TSharedRef<IPropertyHandle> EnabledProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, bEnableGooglePlaySupport)); GooglePlayCategory.AddProperty(EnabledProperty) .EditCondition(SetupForGooglePlayAttribute, NULL); TSharedRef<IPropertyHandle> AppIDProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, GamesAppID)); AppIDProperty->SetOnPropertyValueChanged(FSimpleDelegate::CreateRaw(this, &FAndroidTargetSettingsCustomization::OnAppIDModified)); GooglePlayCategory.AddProperty(AppIDProperty) .EditCondition(SetupForGooglePlayAttribute, NULL); TSharedRef<IPropertyHandle> AdMobAdUnitIDProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, AdMobAdUnitID)); GooglePlayCategory.AddProperty(AdMobAdUnitIDProperty) .EditCondition(SetupForGooglePlayAttribute, NULL); }
void FPaperTileMapDetailsCustomization::CustomizeDetails(IDetailLayoutBuilder& DetailLayout) { const TArray< TWeakObjectPtr<UObject> >& SelectedObjects = DetailLayout.GetDetailsView().GetSelectedObjects(); MyDetailLayout = &DetailLayout; FNotifyHook* NotifyHook = DetailLayout.GetPropertyUtilities()->GetNotifyHook(); bool bEditingActor = false; UPaperTileMap* TileMap = nullptr; UPaperTileMapComponent* TileComponent = nullptr; for (int32 ObjectIndex = 0; ObjectIndex < SelectedObjects.Num(); ++ObjectIndex) { UObject* TestObject = SelectedObjects[ObjectIndex].Get(); if (AActor* CurrentActor = Cast<AActor>(TestObject)) { if (UPaperTileMapComponent* CurrentComponent = CurrentActor->FindComponentByClass<UPaperTileMapComponent>()) { bEditingActor = true; TileComponent = CurrentComponent; TileMap = CurrentComponent->TileMap; break; } } else if (UPaperTileMapComponent* TestComponent = Cast<UPaperTileMapComponent>(TestObject)) { TileComponent = TestComponent; TileMap = TestComponent->TileMap; break; } else if (UPaperTileMap* TestTileMap = Cast<UPaperTileMap>(TestObject)) { TileMap = TestTileMap; break; } } TileMapPtr = TileMap; TileMapComponentPtr = TileComponent; IDetailCategoryBuilder& TileMapCategory = DetailLayout.EditCategory("Tile Map"); TAttribute<EVisibility> InternalInstanceVis = TAttribute<EVisibility>::Create(TAttribute<EVisibility>::FGetter::CreateSP(this, &FPaperTileMapDetailsCustomization::GetVisibilityForInstancedOnlyProperties)); if (TileComponent != nullptr) { TileMapCategory .AddCustomRow(LOCTEXT( "TileMapInstancingControlsSearchText", "Edit New Promote Asset")) [ SNew(SVerticalBox) + SVerticalBox::Slot() .Padding(0.0f, 2.0f, 0.0f, 0.0f) .FillHeight(1.0f) .VAlign(VAlign_Center) [ SNew(SHorizontalBox) // Edit button +SHorizontalBox::Slot() .AutoWidth() .Padding( 2.0f, 0.0f ) .VAlign(VAlign_Center) .HAlign(HAlign_Left) [ SNew(SButton) .VAlign(VAlign_Center) .OnClicked(this, &FPaperTileMapDetailsCustomization::EnterTileMapEditingMode) .Visibility(this, &FPaperTileMapDetailsCustomization::GetNonEditModeVisibility) .Text( LOCTEXT("EditAsset", "Edit") ) .ToolTipText( LOCTEXT("EditAssetToolTip", "Edit this tile map") ) ] // Create new tile map button +SHorizontalBox::Slot() .AutoWidth() .Padding( 2.0f, 0.0f ) .VAlign(VAlign_Center) .HAlign(HAlign_Left) [ SNew(SButton) .VAlign(VAlign_Center) .OnClicked(this, &FPaperTileMapDetailsCustomization::OnNewButtonClicked) .Visibility(this, &FPaperTileMapDetailsCustomization::GetNewButtonVisiblity) .Text(LOCTEXT("CreateNewInstancedMap", "New")) .ToolTipText( LOCTEXT("CreateNewInstancedMapToolTip", "Create a new tile map") ) ] // Promote to asset button +SHorizontalBox::Slot() .AutoWidth() .Padding( 2.0f, 0.0f ) .VAlign(VAlign_Center) .HAlign(HAlign_Left) [ SNew(SButton) .VAlign(VAlign_Center) .OnClicked(this, &FPaperTileMapDetailsCustomization::OnPromoteButtonClicked) .Visibility(this, &FPaperTileMapDetailsCustomization::GetVisibilityForInstancedOnlyProperties) .Text(LOCTEXT("PromoteToAsset", "Promote to asset")) .ToolTipText(LOCTEXT("PromoteToAssetToolTip", "Save this tile map as a reusable asset")) ] ] ]; TileMapCategory.AddProperty(GET_MEMBER_NAME_CHECKED(UPaperTileMapComponent, TileMap)); } // Add the layer browser if (TileMap != nullptr) { TAttribute<EVisibility> LayerBrowserVis; LayerBrowserVis.Set(EVisibility::Visible); if (TileComponent != nullptr) { LayerBrowserVis = InternalInstanceVis; } FText TileLayerListText = LOCTEXT("TileLayerList", "Tile layer list"); TileMapCategory.AddCustomRow(TileLayerListText) .Visibility(LayerBrowserVis) [ SNew(SVerticalBox) +SVerticalBox::Slot() .AutoHeight() [ SNew(STextBlock) .Font(DetailLayout.GetDetailFont()) .Text(TileLayerListText) ] +SVerticalBox::Slot() [ SNew(STileLayerList, TileMap, NotifyHook) ] ]; } // Add all of the properties from the inline tilemap if ((TileComponent != nullptr) && (TileComponent->OwnsTileMap())) { TArray<UObject*> ListOfTileMaps; ListOfTileMaps.Add(TileMap); for (TFieldIterator<UProperty> PropIt(UPaperTileMap::StaticClass()); PropIt; ++PropIt) { UProperty* TestProperty = *PropIt; if (TestProperty->HasAnyPropertyFlags(CPF_Edit)) { FName CategoryName(*TestProperty->GetMetaData(TEXT("Category"))); IDetailCategoryBuilder& Category = DetailLayout.EditCategory(CategoryName); if (IDetailPropertyRow* ExternalRow = Category.AddExternalProperty(ListOfTileMaps, TestProperty->GetFName())) { ExternalRow->Visibility(InternalInstanceVis); } } } } // Make sure the setup category is near the top DetailLayout.EditCategory("Setup"); }
void FAndroidTargetSettingsCustomization::BuildAppManifestSection(IDetailLayoutBuilder& DetailLayout) { // Cache some categories IDetailCategoryBuilder& APKPackagingCategory = DetailLayout.EditCategory(TEXT("APKPackaging")); IDetailCategoryBuilder& BuildCategory = DetailLayout.EditCategory(TEXT("Build")); IDetailCategoryBuilder& SigningCategory = DetailLayout.EditCategory(TEXT("DistributionSigning")); TSharedRef<SPlatformSetupMessage> PlatformSetupMessage = SNew(SPlatformSetupMessage, GameProjectPropertiesPath) .PlatformName(LOCTEXT("AndroidPlatformName", "Android")) .OnSetupClicked(this, &FAndroidTargetSettingsCustomization::CopySetupFilesIntoProject); SetupForPlatformAttribute = PlatformSetupMessage->GetReadyToGoAttribute(); APKPackagingCategory.AddCustomRow(LOCTEXT("Warning", "Warning"), false) .WholeRowWidget [ PlatformSetupMessage ]; APKPackagingCategory.AddCustomRow(LOCTEXT("UpgradeInfo", "Upgrade Info"), false) .WholeRowWidget [ SNew(SBorder) .Padding(1) [ SNew(SHorizontalBox) + SHorizontalBox::Slot() .Padding(FMargin(10, 10, 10, 10)) .FillWidth(1.0f) [ SNew(SRichTextBlock) .Text(LOCTEXT("UpgradeInfoMessage", "<RichTextBlock.TextHighlight>Note to users from 4.6 or earlier</>: We now <RichTextBlock.TextHighlight>GENERATE</> an AndroidManifest.xml when building, so if you have customized your .xml file, you will need to put all of your changes into the below settings. Note that we don't touch your AndroidManifest.xml that is in your project directory.\nAdditionally, we no longer use SigningConfig.xml, the settings are now set in the Distribution Signing section.\n\nThere is currently no .obb file downloader support in the engine, so if you don't package your data into your .apk (see the below setting and its tooltip about 50MB limit), device is not guaranteed to have the .obb file downloaded in all cases. Until Unreal Engine v4.8, there won't be a way for your app to download the .obb file from the Google Play Store. See <a id=\"browser\" href=\"http://developer.android.com/google/play/expansion-files.html#Downloading\" style=\"HoverOnlyHyperlink\">http://developer.android.com/google/play/expansion-files.html</> for more information.")) .TextStyle(FEditorStyle::Get(), "MessageLog") .DecoratorStyleSet(&FEditorStyle::Get()) .AutoWrapText(true) + SRichTextBlock::HyperlinkDecorator(TEXT("browser"), FSlateHyperlinkRun::FOnClick::CreateStatic(&OnBrowserLinkClicked)) ] ] ]; APKPackagingCategory.AddCustomRow(LOCTEXT("BuildFolderLabel", "Build Folder"), false) .IsEnabled(SetupForPlatformAttribute) .NameContent() [ SNew(SHorizontalBox) + SHorizontalBox::Slot() .Padding(FMargin(0, 1, 0, 1)) .FillWidth(1.0f) [ SNew(STextBlock) .Text(LOCTEXT("BuildFolderLabel", "Build Folder")) .Font(DetailLayout.GetDetailFont()) ] ] .ValueContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .AutoWidth() [ SNew(SButton) .Text(LOCTEXT("OpenBuildFolderButton", "Open Build Folder")) .ToolTipText(LOCTEXT("OpenManifestFolderButton_Tooltip", "Opens the folder containing the build files in Explorer or Finder (it's recommended you check these in to source control to share with your team)")) .OnClicked(this, &FAndroidTargetSettingsCustomization::OpenBuildFolder) ] ]; // Signing category SigningCategory.AddCustomRow(LOCTEXT("SigningHyperlink", "Signing Hyperlink"), false) .WholeRowWidget [ SNew(SBox) .HAlign(HAlign_Center) [ SNew(SHyperlinkLaunchURL, TEXT("http://developer.android.com/tools/publishing/app-signing.html#releasemode")) .Text(LOCTEXT("AndroidDeveloperSigningPage", "Android Developer page on Signing for Distribution")) .ToolTipText(LOCTEXT("AndroidDeveloperSigningPageTooltip", "Opens a page that discusses the signing using keytool")) ] ]; // Google Play category IDetailCategoryBuilder& GooglePlayCategory = DetailLayout.EditCategory(TEXT("GooglePlayServices")); TSharedRef<SPlatformSetupMessage> GooglePlaySetupMessage = SNew(SPlatformSetupMessage, GameGooglePlayAppIDPath) .PlatformName(LOCTEXT("GooglePlayPlatformName", "Google Play services")) .OnSetupClicked(this, &FAndroidTargetSettingsCustomization::CopyGooglePlayAppIDFileIntoProject); SetupForGooglePlayAttribute = GooglePlaySetupMessage->GetReadyToGoAttribute(); GooglePlayCategory.AddCustomRow(LOCTEXT("Warning", "Warning"), false) .WholeRowWidget [ GooglePlaySetupMessage ]; GooglePlayCategory.AddCustomRow(LOCTEXT("AppIDHyperlink", "App ID Hyperlink"), false) .WholeRowWidget [ SNew(SBox) .HAlign(HAlign_Center) [ SNew(SHyperlinkLaunchURL, TEXT("http://developer.android.com/google/index.html")) .Text(LOCTEXT("GooglePlayDeveloperPage", "Android Developer Page on Google Play services")) .ToolTipText(LOCTEXT("GooglePlayDeveloperPageTooltip", "Opens a page that discusses Google Play services")) ] ]; TSharedRef<IPropertyHandle> EnabledProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, bEnableGooglePlaySupport)); GooglePlayCategory.AddProperty(EnabledProperty) .EditCondition(SetupForGooglePlayAttribute, NULL); TSharedRef<IPropertyHandle> AppIDProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, GamesAppID)); AppIDProperty->SetOnPropertyValueChanged(FSimpleDelegate::CreateRaw(this, &FAndroidTargetSettingsCustomization::OnAppIDModified)); GooglePlayCategory.AddProperty(AppIDProperty) .EditCondition(SetupForGooglePlayAttribute, NULL); TSharedRef<IPropertyHandle> AdMobAdUnitIDProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, AdMobAdUnitID)); GooglePlayCategory.AddProperty(AdMobAdUnitIDProperty) .EditCondition(SetupForGooglePlayAttribute, NULL); TSharedRef<IPropertyHandle> GooglePlayLicenseKeyProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, GooglePlayLicenseKey)); GooglePlayCategory.AddProperty(GooglePlayLicenseKeyProperty) .EditCondition(SetupForGooglePlayAttribute, NULL); #define SETUP_NONROCKET_PROP(PropName, Category, Tip) \ { \ TSharedRef<IPropertyHandle> PropertyHandle = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, PropName)); \ Category.AddProperty(PropertyHandle) \ .EditCondition(SetupForPlatformAttribute, NULL) \ .IsEnabled(!FRocketSupport::IsRocket()) \ .ToolTip(!FRocketSupport::IsRocket() ? Tip : FAndroidTargetSettingsCustomizationConstants::DisabledTip); \ } SETUP_NONROCKET_PROP(bBuildForArmV7, BuildCategory, LOCTEXT("BuildForArmV7ToolTip", "Enable ArmV7 CPU architecture support? (this will be used if all CPU architecture types are unchecked)")); SETUP_NONROCKET_PROP(bBuildForX86, BuildCategory, LOCTEXT("BuildForX86ToolTip", "Enable X86 CPU architecture support?")); SETUP_NONROCKET_PROP(bBuildForES2, BuildCategory, LOCTEXT("BuildForES2ToolTip", "Enable OpenGL ES2 rendering support? (this will be used if rendering types are unchecked)")); SETUP_NONROCKET_PROP(bBuildForES31, BuildCategory, LOCTEXT("BuildForES31ToolTip", "Enable OpenGL ES31 + AEP (Android Extension Pack) rendering support? Currently only Tegra K1 supports this, as it will force DXT textures (In 4.8 3.1+AEP will work with all texture formats).\nIf you use the Launch On feature (in the main toolbar), when you change this setting, you need to restart the editor to make sure it will launch with the proper 3.1+AEP support!")); // @todo android fat binary: Put back in when we expose those // SETUP_NONROCKET_PROP(bSplitIntoSeparateApks, BuildCategory, LOCTEXT("SplitIntoSeparateAPKsToolTip", "If checked, CPU architectures and rendering types will be split into separate .apk files")); }
void FEditorStyleSettingsDetails::CustomizeDetails( IDetailLayoutBuilder& DetailBuilder ) { // Take a note of the culture we start out with OriginalCulture = FInternationalization::GetCurrentCulture(); FString SavedCultureName; if ( GConfig->GetString( TEXT("Internationalization"), TEXT("Culture"), SavedCultureName, GEngineIni ) ) { // If we have another language pended restart, change our original choice to that TSharedPtr<FCulture> SavedCulture = FInternationalization::GetCulture( SavedCultureName ); if ( SavedCulture.IsValid() ) { OriginalCulture = SavedCulture; } } // Populate all our cultures RefreshAvailableCultures(); IDetailCategoryBuilder& CategoryBuilder = DetailBuilder.EditCategory("Internationalization"); const FText LanguageToolTipText = LOCTEXT("EditorLanguageTooltip", "Change the Editor language (requires restart to take affect)"); CategoryBuilder.AddCustomRow("Language") .NameContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .Padding( FMargin( 0, 1, 0, 1 ) ) .FillWidth(1.0f) [ SNew(STextBlock) .Text(LOCTEXT("EditorLanguageLabel", "Language")) .Font(DetailBuilder.GetDetailFont()) .ToolTipText(LanguageToolTipText) ] ] .ValueContent() .MaxDesiredWidth(300.0f) [ SNew(SComboBox< TSharedPtr<FCulture> >) .OptionsSource( &AvailableLanguages ) .InitiallySelectedItem(SelectedLanguage) .OnGenerateWidget(this, &FEditorStyleSettingsDetails::OnLanguageGenerateWidget, &DetailBuilder) .ToolTipText(LanguageToolTipText) .OnSelectionChanged(this, &FEditorStyleSettingsDetails::OnLanguageSelectionChanged) .Content() [ SNew(STextBlock) .Text(this, &FEditorStyleSettingsDetails::GetCurrentLanguageText) .Font(DetailBuilder.GetDetailFont()) ] ]; const FText RegionToolTipText = LOCTEXT("EditorRegionTooltip", "Change the Editor region (requires restart to take affect)"); CategoryBuilder.AddCustomRow("Region") .NameContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .Padding( FMargin( 0, 1, 0, 1 ) ) .FillWidth(1.0f) [ SNew(STextBlock) .Text(LOCTEXT("EditorRegionLabel", "Region")) .Font(DetailBuilder.GetDetailFont()) .ToolTipText(RegionToolTipText) ] ] .ValueContent() .MaxDesiredWidth(300.0f) [ SAssignNew(RegionComboBox, SComboBox< TSharedPtr<FCulture> >) .OptionsSource( &AvailableRegions ) .InitiallySelectedItem(SelectedCulture) .OnGenerateWidget(this, &FEditorStyleSettingsDetails::OnRegionGenerateWidget, &DetailBuilder) .ToolTipText(RegionToolTipText) .OnSelectionChanged(this, &FEditorStyleSettingsDetails::OnRegionSelectionChanged) .IsEnabled(this, &FEditorStyleSettingsDetails::IsRegionSelectionAllowed) .Content() [ SNew(STextBlock) .Text(this, &FEditorStyleSettingsDetails::GetCurrentRegionText) .Font(DetailBuilder.GetDetailFont()) ] ]; }
void FWindowsTargetSettingsDetails::CustomizeDetails( IDetailLayoutBuilder& DetailBuilder ) { // Setup the supported/targeted RHI property view TargetShaderFormatsDetails = MakeShareable(new FTargetShaderFormatsPropertyDetails(&DetailBuilder)); TargetShaderFormatsDetails->CreateTargetShaderFormatsPropertyView(); TSharedRef<IPropertyHandle> MinOSProperty = DetailBuilder.GetProperty("MinimumOSVersion"); IDetailCategoryBuilder& OSInfoCategory = DetailBuilder.EditCategory(TEXT("OS Info")); // Setup edit condition and tool tip of Min OS property. Determined by whether the engine is installed or not. bool bIsMinOSSelectionAvailable = FApp::IsEngineInstalled() == false; IDetailPropertyRow& MinOSRow = OSInfoCategory.AddProperty(MinOSProperty); MinOSRow.IsEnabled(bIsMinOSSelectionAvailable); MinOSRow.ToolTip(bIsMinOSSelectionAvailable ? MinOSProperty->GetToolTipText() : WindowsTargetSettingsDetailsConstants::DisabledTip); // Next add the splash image customization const FText EditorSplashDesc(LOCTEXT("EditorSplashLabel", "Editor Splash")); IDetailCategoryBuilder& SplashCategoryBuilder = DetailBuilder.EditCategory(TEXT("Splash")); FDetailWidgetRow& EditorSplashWidgetRow = SplashCategoryBuilder.AddCustomRow(EditorSplashDesc); const FString EditorSplash_TargetImagePath = GetSplashFilename(EImageScope::GameOverride, true); const FString EditorSplash_DefaultImagePath = GetSplashFilename(EImageScope::Engine, true); EditorSplashWidgetRow .NameContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .Padding( FMargin( 0, 1, 0, 1 ) ) .FillWidth(1.0f) [ SNew(STextBlock) .Text(EditorSplashDesc) .Font(DetailBuilder.GetDetailFont()) ] ] .ValueContent() .MaxDesiredWidth(500.0f) .MinDesiredWidth(100.0f) [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .FillWidth(1.0f) .VAlign(VAlign_Center) [ SNew(SExternalImageReference, EditorSplash_DefaultImagePath, EditorSplash_TargetImagePath) .FileDescription(EditorSplashDesc) .OnGetPickerPath(FOnGetPickerPath::CreateSP(this, &FWindowsTargetSettingsDetails::GetPickerPath)) .OnPostExternalImageCopy(FOnPostExternalImageCopy::CreateSP(this, &FWindowsTargetSettingsDetails::HandlePostExternalIconCopy)) ] ]; const FText GameSplashDesc(LOCTEXT("GameSplashLabel", "Game Splash")); FDetailWidgetRow& GameSplashWidgetRow = SplashCategoryBuilder.AddCustomRow(GameSplashDesc); const FString GameSplash_TargetImagePath = GetSplashFilename(EImageScope::GameOverride, false); const FString GameSplash_DefaultImagePath = GetSplashFilename(EImageScope::Engine, false); GameSplashWidgetRow .NameContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .Padding( FMargin( 0, 1, 0, 1 ) ) .FillWidth(1.0f) [ SNew(STextBlock) .Text(GameSplashDesc) .Font(DetailBuilder.GetDetailFont()) ] ] .ValueContent() .MaxDesiredWidth(500.0f) .MinDesiredWidth(100.0f) [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .FillWidth(1.0f) .VAlign(VAlign_Center) [ SNew(SExternalImageReference, GameSplash_DefaultImagePath, GameSplash_TargetImagePath) .FileDescription(GameSplashDesc) .OnGetPickerPath(FOnGetPickerPath::CreateSP(this, &FWindowsTargetSettingsDetails::GetPickerPath)) .OnPostExternalImageCopy(FOnPostExternalImageCopy::CreateSP(this, &FWindowsTargetSettingsDetails::HandlePostExternalIconCopy)) ] ]; IDetailCategoryBuilder& IconsCategoryBuilder = DetailBuilder.EditCategory(TEXT("Icon")); FDetailWidgetRow& GameIconWidgetRow = IconsCategoryBuilder.AddCustomRow(LOCTEXT("GameIconLabel", "Game Icon")); GameIconWidgetRow .NameContent() [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .Padding( FMargin( 0, 1, 0, 1 ) ) .FillWidth(1.0f) [ SNew(STextBlock) .Text(LOCTEXT("GameIconLabel", "Game Icon")) .Font(DetailBuilder.GetDetailFont()) ] ] .ValueContent() .MaxDesiredWidth(500.0f) .MinDesiredWidth(100.0f) [ SNew(SHorizontalBox) +SHorizontalBox::Slot() .FillWidth(1.0f) .VAlign(VAlign_Center) [ SNew(SExternalImageReference, GetIconFilename(EImageScope::Engine), GetIconFilename(EImageScope::GameOverride)) .FileDescription(GameSplashDesc) .OnPreExternalImageCopy(FOnPreExternalImageCopy::CreateSP(this, &FWindowsTargetSettingsDetails::HandlePreExternalIconCopy)) .OnGetPickerPath(FOnGetPickerPath::CreateSP(this, &FWindowsTargetSettingsDetails::GetPickerPath)) .OnPostExternalImageCopy(FOnPostExternalImageCopy::CreateSP(this, &FWindowsTargetSettingsDetails::HandlePostExternalIconCopy)) ] ]; }