/**
	 * Uses the provided ActionGetter to get a list of selected actions, and then 
	 * removes every one from the user's favorites.
	 * 
	 * @param  ActionGetter		A delegate to use for grabbing the palette's selected actions.
	 */
	static void RemoveSelectedFavorites(FPaletteActionGetter ActionGetter)
	{
		const UEditorPerProjectUserSettings* EditorPerProjectUserSettings = GetDefault<UEditorPerProjectUserSettings>();
		if (ActionGetter.IsBound() && (EditorPerProjectUserSettings->BlueprintFavorites != NULL))
		{
			TArray< TSharedPtr<FEdGraphSchemaAction> > SelectedActions;
			ActionGetter.Execute(SelectedActions);

			EditorPerProjectUserSettings->BlueprintFavorites->RemoveFavorites(SelectedActions);
		}
	}
コード例 #2
0
	/**
	 * Uses the provided ActionGetter to get a list of selected actions, and then 
	 * removes every one from the user's favorites.
	 * 
	 * @param  ActionGetter		A delegate to use for grabbing the palette's selected actions.
	 */
	static void RemoveSelectedFavorites(FPaletteActionGetter ActionGetter)
	{
		UEditorUserSettings const& EditorUserSettings = GEditor->AccessEditorUserSettings();
		if (ActionGetter.IsBound() && (EditorUserSettings.BlueprintFavorites != NULL))
		{
			TArray< TSharedPtr<FEdGraphSchemaAction> > SelectedActions;
			ActionGetter.Execute(SelectedActions);

			EditorUserSettings.BlueprintFavorites->RemoveFavorites(SelectedActions);
		}
	}
コード例 #3
0
	/**
	 * Utility function used to check if any of the selected actions (returned 
	 * by the supplied ActionGetter) are currently one of the user's favorites.
	 * 
	 * @param  ActionGetter		A delegate that'll retrieve the list of actions that you want tested.
	 * @return True if at least one action (returned by ActionGetter) can be removed from the user's favorites, false if not.
	 */
	static bool IsAnyActionRemovable(FPaletteActionGetter ActionGetter)
	{
		bool bCanAnyBeRemoved = false;

		UEditorUserSettings const& EditorUserSettings = GEditor->AccessEditorUserSettings();
		if (ActionGetter.IsBound() && (EditorUserSettings.BlueprintFavorites != NULL))
		{
			TArray< TSharedPtr<FEdGraphSchemaAction> > SelectedActions;
			ActionGetter.Execute(SelectedActions);

			for (TSharedPtr<FEdGraphSchemaAction> Action : SelectedActions)
			{
				if (EditorUserSettings.BlueprintFavorites->IsFavorited(Action))
				{
					bCanAnyBeRemoved = true;
					break;
				}
			}
		}

		return bCanAnyBeRemoved;
	}
コード例 #4
0
	/**
	 * Utility function used to check if any of the selected actions (returned 
	 * by the supplied ActionGetter) are candidates for adding to the user's
	 * favorites.
	 * 
	 * @param  ActionGetter		A delegate that'll retrieve the list of actions that you want tested.
	 * @return True if at least one action (returned by ActionGetter) can be added as a favorite, false if not.
	 */
	static bool IsAnyActionFavoritable(FPaletteActionGetter ActionGetter)
	{
		bool bCanAnyBeFavorited = false;

		const UEditorPerProjectUserSettings* EditorPerProjectUserSettings = GetDefault<UEditorPerProjectUserSettings>();
		if (ActionGetter.IsBound() && (EditorPerProjectUserSettings->BlueprintFavorites != NULL))
		{
			TArray< TSharedPtr<FEdGraphSchemaAction> > SelectedActions;
			ActionGetter.Execute(SelectedActions);

			for (TSharedPtr<FEdGraphSchemaAction> Action : SelectedActions)
			{
				if (EditorPerProjectUserSettings->BlueprintFavorites->CanBeFavorited(Action) && !EditorPerProjectUserSettings->BlueprintFavorites->IsFavorited(Action))
				{
					bCanAnyBeFavorited = true;
					break;
				}
			}
		}

		return bCanAnyBeFavorited;
	}