Add PNG support for clipboard operations
- Implemented conditional compilation for image copy and retrieval functions in clipboard.cc, clipboard.h, and clipboard.mm, enabling PNG support when YAZE_LIB_PNG is defined. - Updated graphics_editor.cc and overworld_editor.cc to handle PNG data copying to the clipboard, including error handling for cases when PNG support is disabled. - Enhanced user feedback by providing alternative actions when PNG export is unavailable, improving overall user experience.
This commit is contained in:
@@ -121,9 +121,14 @@ void GraphicsEditor::DrawGfxEditToolset() {
|
||||
|
||||
TableNextColumn();
|
||||
if (Button(ICON_MD_CONTENT_COPY)) {
|
||||
#if YAZE_LIB_PNG == 1
|
||||
std::vector<uint8_t> png_data =
|
||||
gfx::Arena::Get().gfx_sheets().at(current_sheet_).GetPngData();
|
||||
core::CopyImageToClipboard(png_data);
|
||||
#else
|
||||
// PNG support disabled - show message or alternative action
|
||||
status_ = absl::UnimplementedError("PNG export not available in this build");
|
||||
#endif
|
||||
}
|
||||
HOVER_HINT("Copy to Clipboard");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user