addressing windows issues

This commit is contained in:
2025-11-30 23:22:39 -05:00
parent 63c170adbb
commit f6a5c01d74
4 changed files with 15 additions and 11 deletions

View File

@@ -4,8 +4,6 @@
#include <format>
#include <format>
#include "log.h"
#include "strings.h"
#include "toast.h"
@@ -88,15 +86,15 @@ namespace anm2ed
if (anm2.serialize(absolutePath, errorString))
{
toasts.push(std::vformat(localize.get(TOAST_SAVE_DOCUMENT), std::make_format_args(absolutePath)));
logger.info(std::vformat(localize.get(TOAST_SAVE_DOCUMENT, anm2ed::ENGLISH),
std::make_format_args(absolutePath)));
logger.info(
std::vformat(localize.get(TOAST_SAVE_DOCUMENT, anm2ed::ENGLISH), std::make_format_args(absolutePath)));
clean();
return true;
}
else if (errorString)
{
toasts.push(std::vformat(localize.get(TOAST_SAVE_DOCUMENT_FAILED),
std::make_format_args(absolutePath, *errorString)));
toasts.push(
std::vformat(localize.get(TOAST_SAVE_DOCUMENT_FAILED), std::make_format_args(absolutePath, *errorString)));
logger.error(std::vformat(localize.get(TOAST_SAVE_DOCUMENT_FAILED, anm2ed::ENGLISH),
std::make_format_args(absolutePath, *errorString)));
}
@@ -135,8 +133,8 @@ namespace anm2ed
}
else if (errorString)
{
toasts.push(std::vformat(localize.get(TOAST_AUTOSAVE_FAILED),
std::make_format_args(autosavePathString, *errorString)));
toasts.push(
std::vformat(localize.get(TOAST_AUTOSAVE_FAILED), std::make_format_args(autosavePathString, *errorString)));
logger.error(std::vformat(localize.get(TOAST_AUTOSAVE_FAILED, anm2ed::ENGLISH),
std::make_format_args(autosavePathString, *errorString)));
}
@@ -279,8 +277,8 @@ namespace anm2ed
sound.selection = {id};
sound.reference = id;
toasts.push(std::vformat(localize.get(TOAST_SOUND_INITIALIZED), std::make_format_args(id, soundPath)));
logger.info(std::vformat(localize.get(TOAST_SOUND_INITIALIZED, anm2ed::ENGLISH),
std::make_format_args(id, soundPath)));
logger.info(
std::vformat(localize.get(TOAST_SOUND_INITIALIZED, anm2ed::ENGLISH), std::make_format_args(id, soundPath)));
}
else
{

View File

@@ -122,7 +122,7 @@ namespace anm2ed::imgui
{
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left))
{
filesystem::WorkingDirectory workingDirectory(document.directory_get());
filesystem::WorkingDirectory workingDirectory(document.directory_get().string());
dialog.file_explorer_open(spritesheet.path.parent_path().string());
}
hovered = id;

View File

@@ -56,5 +56,10 @@ namespace anm2ed::util::filesystem
std::filesystem::current_path(path);
}
WorkingDirectory::WorkingDirectory(const std::filesystem::path& path, bool isFile)
: WorkingDirectory(path.string(), isFile)
{
}
WorkingDirectory::~WorkingDirectory() { std::filesystem::current_path(previous); }
}

View File

@@ -18,6 +18,7 @@ namespace anm2ed::util::filesystem
std::filesystem::path previous;
WorkingDirectory(const std::string&, bool = false);
WorkingDirectory(const std::filesystem::path&, bool = false);
~WorkingDirectory();
};
}