Add import & export warning messageboxes.

This commit is contained in:
Zode
2025-06-09 14:56:54 +03:00
committed by GitHub
parent eee4e55cf0
commit f8daff273a
2 changed files with 14 additions and 0 deletions

View File

@@ -18,6 +18,7 @@
#include "Engine/Tools/AudioTool/OggVorbisDecoder.h" #include "Engine/Tools/AudioTool/OggVorbisDecoder.h"
#include "Engine/Tools/AudioTool/OggVorbisEncoder.h" #include "Engine/Tools/AudioTool/OggVorbisEncoder.h"
#include "Engine/Serialization/JsonWriters.h" #include "Engine/Serialization/JsonWriters.h"
#include "Engine/Platform/MessageBox.h"
bool ImportAudio::TryGetImportOptions(const StringView& path, Options& options) bool ImportAudio::TryGetImportOptions(const StringView& path, Options& options)
{ {
@@ -118,6 +119,7 @@ CreateAssetResult ImportAudio::Import(CreateAssetContext& context, AudioDecoder&
} }
#else #else
#define HANDLE_VORBIS(chunkIndex, dataPtr, dataSize) \ #define HANDLE_VORBIS(chunkIndex, dataPtr, dataSize) \
MessageBox::Show(TEXT("Vorbis format is not supported."), TEXT("Import warning"), MessageBoxButtons::OK, MessageBoxIcon::Warning);
LOG(Warning, "Vorbis format is not supported."); \ LOG(Warning, "Vorbis format is not supported."); \
return CreateAssetResult::Error; return CreateAssetResult::Error;
#endif #endif
@@ -140,6 +142,7 @@ CreateAssetResult ImportAudio::Import(CreateAssetContext& context, AudioDecoder&
break; \ break; \
default: \ default: \
{ \ { \
MessageBox::Show(TEXT("Unknown audio format."), TEXT("Import warning"), MessageBoxButtons::OK, MessageBoxIcon::Warning); \
LOG(Warning, "Unknown audio format."); \ LOG(Warning, "Unknown audio format."); \
return CreateAssetResult::Error; \ return CreateAssetResult::Error; \
} \ } \

View File

@@ -13,6 +13,7 @@
#include "Engine/Graphics/PixelFormatExtensions.h" #include "Engine/Graphics/PixelFormatExtensions.h"
#include "Engine/Utilities/AnsiPathTempFile.h" #include "Engine/Utilities/AnsiPathTempFile.h"
#include "Engine/Platform/File.h" #include "Engine/Platform/File.h"
#include "Engine/Platform/MessageBox.h"
#define STBI_ASSERT(x) ASSERT(x) #define STBI_ASSERT(x) ASSERT(x)
#define STBI_MALLOC(sz) Allocator::Allocate(sz) #define STBI_MALLOC(sz) Allocator::Allocate(sz)
@@ -286,21 +287,27 @@ bool TextureTool::ExportTextureStb(ImageType type, const StringView& path, const
break; break;
} }
case ImageType::GIF: case ImageType::GIF:
MessageBox::Show(TEXT("GIF format is not supported."), TEXT("Export warning"), MessageBoxButtons::OK, MessageBoxIcon::Warning);
LOG(Warning, "GIF format is not supported."); LOG(Warning, "GIF format is not supported.");
break; break;
case ImageType::TIFF: case ImageType::TIFF:
MessageBox::Show(TEXT("TIFF format is not supported."), TEXT("Export warning"), MessageBoxButtons::OK, MessageBoxIcon::Warning);
LOG(Warning, "GIF format is not supported."); LOG(Warning, "GIF format is not supported.");
break; break;
case ImageType::DDS: case ImageType::DDS:
MessageBox::Show(TEXT("DDS format is not supported."), TEXT("Export warning"), MessageBoxButtons::OK, MessageBoxIcon::Warning);
LOG(Warning, "DDS format is not supported."); LOG(Warning, "DDS format is not supported.");
break; break;
case ImageType::RAW: case ImageType::RAW:
MessageBox::Show(TEXT("RAW format is not supported."), TEXT("Export warning"), MessageBoxButtons::OK, MessageBoxIcon::Warning);
LOG(Warning, "RAW format is not supported."); LOG(Warning, "RAW format is not supported.");
break; break;
case ImageType::EXR: case ImageType::EXR:
MessageBox::Show(TEXT("EXR format is not supported."), TEXT("Export warning"), MessageBoxButtons::OK, MessageBoxIcon::Warning);
LOG(Warning, "EXR format is not supported."); LOG(Warning, "EXR format is not supported.");
break; break;
default: default:
MessageBox::Show(TEXT("Unknown format."), TEXT("Export warning"), MessageBoxButtons::OK, MessageBoxIcon::Warning);
LOG(Warning, "Unknown format."); LOG(Warning, "Unknown format.");
break; break;
} }
@@ -434,17 +441,21 @@ bool TextureTool::ImportTextureStb(ImageType type, const StringView& path, Textu
free(pixels); free(pixels);
#else #else
MessageBox::Show(TEXT("EXR format is not supported."), TEXT("Import warning"), MessageBoxButtons::OK, MessageBoxIcon::Warning);
LOG(Warning, "EXR format is not supported."); LOG(Warning, "EXR format is not supported.");
#endif #endif
break; break;
} }
case ImageType::DDS: case ImageType::DDS:
MessageBox::Show(TEXT("DDS format is not supported."), TEXT("Import warning"), MessageBoxButtons::OK, MessageBoxIcon::Warning);
LOG(Warning, "DDS format is not supported."); LOG(Warning, "DDS format is not supported.");
break; break;
case ImageType::TIFF: case ImageType::TIFF:
MessageBox::Show(TEXT("TIFF format is not supported."), TEXT("Import warning"), MessageBoxButtons::OK, MessageBoxIcon::Warning);
LOG(Warning, "TIFF format is not supported."); LOG(Warning, "TIFF format is not supported.");
break; break;
default: default:
MessageBox::Show(TEXT("Unknown format."), TEXT("Import warning"), MessageBoxButtons::OK, MessageBoxIcon::Warning);
LOG(Warning, "Unknown format."); LOG(Warning, "Unknown format.");
return true; return true;
} }