From 898dfcc68f02acc6d77ea34ef49329c653cf090f Mon Sep 17 00:00:00 2001 From: shweet Date: Sat, 13 Dec 2025 22:02:48 -0500 Subject: [PATCH] more fixes? --- src/imgui/documents.cpp | 11 +++++++---- src/imgui/window/welcome.cpp | 8 ++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/imgui/documents.cpp b/src/imgui/documents.cpp index 925c2db..0c12b56 100644 --- a/src/imgui/documents.cpp +++ b/src/imgui/documents.cpp @@ -3,12 +3,14 @@ #include #include +#include "filesystem_.h" #include "strings.h" #include "time_.h" using namespace anm2ed::resource; using namespace anm2ed::types; using namespace anm2ed::util; +namespace filesystem = anm2ed::util::filesystem; namespace anm2ed::imgui { @@ -86,7 +88,7 @@ namespace anm2ed::imgui auto isRequested = i == manager.pendingSelected; auto font = isDirty ? font::ITALICS : font::REGULAR; - auto filename = document.filename_get().string(); + auto filename = filesystem::path_to_utf8(document.filename_get()); auto string = isDirty ? std::vformat(localize.get(FORMAT_NOT_SAVED), std::make_format_args(filename)) : filename; auto label = std::format("{}###Document{}", string, i); @@ -103,7 +105,8 @@ namespace anm2ed::imgui ImGui::EndTabItem(); } - ImGui::SetItemTooltip("%s", document.path.string().c_str()); + auto pathUtf8 = filesystem::path_to_utf8(document.path); + ImGui::SetItemTooltip("%s", pathUtf8.c_str()); ImGui::PopFont(); } @@ -126,7 +129,7 @@ namespace anm2ed::imgui { auto& closeDocument = manager.documents[closeDocumentIndex]; - auto filename = closeDocument.filename_get().string(); + auto filename = filesystem::path_to_utf8(closeDocument.filename_get()); auto prompt = std::vformat(localize.get(LABEL_DOCUMENT_MODIFIED_PROMPT), std::make_format_args(filename)); ImGui::TextUnformatted(prompt.c_str()); @@ -213,7 +216,7 @@ namespace anm2ed::imgui { for (auto& path : manager.anm2DragDropPaths) { - anm2::Anm2 source(path.string()); + anm2::Anm2 source(path); document->anm2.merge(source, document->directory_get(), path.parent_path()); } }; diff --git a/src/imgui/window/welcome.cpp b/src/imgui/window/welcome.cpp index 0f9441e..7fb1971 100644 --- a/src/imgui/window/welcome.cpp +++ b/src/imgui/window/welcome.cpp @@ -2,9 +2,11 @@ #include +#include "filesystem_.h" #include "strings.h" using namespace anm2ed::resource; +namespace filesystem = anm2ed::util::filesystem; namespace anm2ed::imgui { @@ -44,7 +46,8 @@ namespace anm2ed::imgui { ImGui::PushID(i); - auto label = std::format(FILE_LABEL_FORMAT, file.filename().string(), file.string()); + auto label = std::format(FILE_LABEL_FORMAT, filesystem::path_to_utf8(file.filename()), + filesystem::path_to_utf8(file)); if (ImGui::Selectable(label.c_str())) { @@ -75,7 +78,8 @@ namespace anm2ed::imgui { for (auto& file : manager.autosaveFiles) { - auto label = std::format(FILE_LABEL_FORMAT, file.filename().string(), file.string()); + auto label = std::format(FILE_LABEL_FORMAT, filesystem::path_to_utf8(file.filename()), + filesystem::path_to_utf8(file)); ImGui::TextUnformatted(label.c_str()); } }