From f6a5c01d74f62b6cdcbf2fc03e6909a67ed83f48 Mon Sep 17 00:00:00 2001 From: shweet Date: Sun, 30 Nov 2025 23:22:39 -0500 Subject: [PATCH] addressing windows issues --- src/document.cpp | 18 ++++++++---------- src/imgui/window/spritesheets.cpp | 2 +- src/util/filesystem_.cpp | 5 +++++ src/util/filesystem_.h | 1 + 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/document.cpp b/src/document.cpp index aa2b8fd..aa88add 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -4,8 +4,6 @@ #include -#include - #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 { diff --git a/src/imgui/window/spritesheets.cpp b/src/imgui/window/spritesheets.cpp index 27e9054..9430cc4 100644 --- a/src/imgui/window/spritesheets.cpp +++ b/src/imgui/window/spritesheets.cpp @@ -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; diff --git a/src/util/filesystem_.cpp b/src/util/filesystem_.cpp index a9b3d90..7ee4bd4 100644 --- a/src/util/filesystem_.cpp +++ b/src/util/filesystem_.cpp @@ -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); } } diff --git a/src/util/filesystem_.h b/src/util/filesystem_.h index cd7fd8f..b1a26c9 100644 --- a/src/util/filesystem_.h +++ b/src/util/filesystem_.h @@ -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(); }; }