// Copyright Epic Games, Inc. All Rights Reserved. #include "BlueprintEditorSettings.h" #include "Misc/ConfigCacheIni.h" #include "Editor/EditorPerProjectUserSettings.h" #include "Settings/EditorExperimentalSettings.h" #include "BlueprintActionDatabase.h" #include "FindInBlueprintManager.h" #include "Subsystems/AssetEditorSubsystem.h" #include "Editor.h" #include "BlueprintTypePromotion.h" UBlueprintEditorSettings::UBlueprintEditorSettings(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) // Style Settings , bDrawMidpointArrowsInBlueprints(false) , bShowGraphInstructionText(true) , bHideUnrelatedNodes(false) , bShowShortTooltips(true) // Workflow Settings , bSplitContextTargetSettings(true) , bExposeAllMemberComponentFunctions(true) , bShowContextualFavorites(false) , bExposeDeprecatedFunctions(false) , bCompactCallOnMemberNodes(false) , bFlattenFavoritesMenus(true) , bAutoCastObjectConnections(false) , bShowViewportOnSimulate(false) , bSpawnDefaultBlueprintNodes(true) , bHideConstructionScriptComponentsInDetailsView(true) , bHostFindInBlueprintsInGlobalTab(true) , bNavigateToNativeFunctionsFromCallNodes(true) , bDoubleClickNavigatesToParent(true) , bEnableTypePromotion(true) // Experimental , bEnableNamespaceFilteringFeatures(false) , bEnableNamespaceImportingFeatures(false) , bFavorPureCastNodes(false) // Compiler Settings , SaveOnCompile(SoC_Never) , bJumpToNodeErrors(false) , bAllowExplicitImpureNodeDisabling(false) // Developer Settings , bShowActionMenuItemSignatures(false) // Perf Settings , bShowDetailedCompileResults(false) , CompileEventDisplayThresholdMs(5) , NodeTemplateCacheCapMB(20.f) // No category , bShowInheritedVariables(false) , bAlwaysShowInterfacesInOverrides(true) , bShowParentClassInOverrides(true) , bShowEmptySections(true) , bShowAccessSpecifier(false) , bIncludeCommentNodesInBookmarksTab(true) , bShowBookmarksForCurrentDocumentOnlyInTab(false) { // settings that were moved out of experimental... UEditorExperimentalSettings const* ExperimentalSettings = GetDefault(); bDrawMidpointArrowsInBlueprints = ExperimentalSettings->bDrawMidpointArrowsInBlueprints; // settings that were moved out of editor-user settings... UEditorPerProjectUserSettings const* UserSettings = GetDefault(); bShowActionMenuItemSignatures = UserSettings->bDisplayActionListItemRefIds; FString const ClassConfigKey = GetClass()->GetPathName(); bool bOldSaveOnCompileVal = false; // backwards compatibility: handle the case where users have already switched this on if (GConfig->GetBool(*ClassConfigKey, TEXT("bSaveOnCompile"), bOldSaveOnCompileVal, GEditorPerProjectIni) && bOldSaveOnCompileVal) { SaveOnCompile = SoC_SuccessOnly; } } void UBlueprintEditorSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) { const FName PropertyName = (PropertyChangedEvent.Property != nullptr) ? PropertyChangedEvent.Property->GetFName() : NAME_None; if (PropertyName == GET_MEMBER_NAME_CHECKED(UBlueprintEditorSettings, bHostFindInBlueprintsInGlobalTab)) { // Close all open Blueprint editors to reset associated FiB states. UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem(); TArray EditedAssets = AssetEditorSubsystem->GetAllEditedAssets(); for (UObject* EditedAsset : EditedAssets) { if (EditedAsset->IsA()) { AssetEditorSubsystem->CloseAllEditorsForAsset(EditedAsset); } } // Enable or disable the feature through the FiB manager. FFindInBlueprintSearchManager::Get().EnableGlobalFindResults(bHostFindInBlueprintsInGlobalTab); } bool bShouldRebuildRegistry = false; if (PropertyName == GET_MEMBER_NAME_CHECKED(UBlueprintEditorSettings, bExposeDeprecatedFunctions)) { bShouldRebuildRegistry = true; } // Refresh type promotion when the preference gets changed so that we can correctly rebuild the action database if (PropertyName == GET_MEMBER_NAME_CHECKED(UBlueprintEditorSettings, bEnableTypePromotion)) { FTypePromotion::ClearNodeSpawners(); bShouldRebuildRegistry = true; } if (bShouldRebuildRegistry) { FBlueprintActionDatabase::Get().RefreshAll(); } Super::PostEditChangeProperty(PropertyChangedEvent); OnSettingsChange.Broadcast(this, PropertyChangedEvent.ChangeType); }