Sound drag/drop

This commit is contained in:
2025-11-30 22:25:57 -05:00
parent d0221928aa
commit 300e322b9d
49 changed files with 1280230 additions and 210091 deletions
+17 -1
View File
@@ -6,6 +6,8 @@
#include <imgui/backends/imgui_impl_sdl3.h>
#include "filesystem_.h"
#include "log.h"
#include "strings.h"
#include "toast.h"
using namespace anm2ed::imgui;
@@ -65,7 +67,21 @@ namespace anm2ed
if (auto document = manager.get())
document->spritesheet_add(droppedFile);
else
toasts.info("Failed to add spritesheet! Open a document first.");
{
toasts.push(localize.get(TOAST_ADD_SPRITESHEET_FAILED));
logger.warning(localize.get(TOAST_ADD_SPRITESHEET_FAILED, anm2ed::ENGLISH));
}
}
else if (filesystem::path_is_extension(droppedFile, "wav") ||
filesystem::path_is_extension(droppedFile, "ogg"))
{
if (auto document = manager.get())
document->sound_add(droppedFile);
else
{
toasts.push(localize.get(TOAST_ADD_SOUND_FAILED));
logger.warning(localize.get(TOAST_ADD_SOUND_FAILED, anm2ed::ENGLISH));
}
}
break;
}