Moved asynchronous image loading function to atom tools framework

Moved settings registry wrapper function to atom tools framework
Created registry settings with default values for preview configurations based on asset type
Changed lighting preset previews and thumbnails to use reflective material
Created registry settings for preset selection dialog borders, padding, sizes
Updated shared preview utility functions to compare against registered asset types instead of passing them in individually

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
This commit is contained in:
Guthrie Adams
2021-11-16 23:23:25 -06:00
parent 6dcbc64cd6
commit cb552256f8
15 changed files with 225 additions and 147 deletions
@@ -8,8 +8,9 @@
#pragma once
#include <AzCore/PlatformDef.h>
#include <AzCore/Asset/AssetManager.h>
#include <AzCore/PlatformDef.h>
#include <AzCore/Settings/SettingsRegistry.h>
#include <AzCore/std/containers/vector.h>
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
@@ -18,11 +19,24 @@ AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnin
#include <QStringList>
AZ_POP_DISABLE_WARNING
class QImage;
namespace AtomToolsFramework
{
template<typename T>
T GetSettingOrDefault(AZStd::string_view path, const T& defaultValue)
{
T result;
auto settingsRegistry = AZ::SettingsRegistry::Get();
return (settingsRegistry && settingsRegistry->Get(result, path)) ? result : defaultValue;
}
using LoadImageAsyncCallback = AZStd::function<void(const QImage&)>;
void LoadImageAsync(const AZStd::string& path, LoadImageAsyncCallback callback);
QFileInfo GetSaveFileInfo(const QString& initialPath);
QFileInfo GetOpenFileInfo(const AZStd::vector<AZ::Data::AssetType>& assetTypes);
QFileInfo GetUniqueFileInfo(const QString& initialPath);
QFileInfo GetDuplicationFileInfo(const QString& initialPath);
bool LaunchTool(const QString& baseName, const QString& extension, const QStringList& arguments);
}
} // namespace AtomToolsFramework