CollectionViewUtils.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2017-2021 marynate. All Rights Reserved.
  2. #pragma once
  3. #include "CoreMinimal.h"
  4. #include "CollectionManagerTypes.h"
  5. namespace CollectionViewUtils
  6. {
  7. /**
  8. * Loads the color of this collection from the config
  9. *
  10. * @param InCollectionName - The name of the collection to get the color for
  11. * @param InCollectionType - The type of the collection to get the color for
  12. * @return The color the collection should appear as, will be null if not customized
  13. */
  14. const TSharedPtr<FLinearColor> LoadColor(const FString& InCollectionName, const ECollectionShareType::Type& InCollectionType);
  15. /**
  16. * Saves the color of the collection to the config
  17. *
  18. * @param InCollectionName - The name of the collection to set the color for
  19. * @param InCollectionType - The type of the collection to set the color for
  20. * @param CollectionColor - The color the collection should appear as
  21. * @param bForceAdd - If true, force the color to be added even if it's the default color
  22. */
  23. void SaveColor(const FString& InCollectionName, const ECollectionShareType::Type& InCollectionType, const TSharedPtr<FLinearColor> CollectionColor, const bool bForceAdd = false);
  24. /**
  25. * Checks to see if any collection has a custom color, optionally outputs them to a list
  26. *
  27. * @param OutColors - If specified, returns all the custom colors being used
  28. * @return true, if custom colors are present
  29. */
  30. bool HasCustomColors( TArray< FLinearColor >* OutColors = nullptr );
  31. /** Gets the default color the collection should appear as */
  32. FLinearColor GetDefaultColor();
  33. }