fix for filepath to string conversions

This commit is contained in:
2025-11-11 18:54:57 -05:00
parent 96dd0fbc50
commit 993f92e412
6 changed files with 13 additions and 13 deletions

View File

@@ -68,8 +68,8 @@ namespace anm2ed::imgui
if (ImGui::MenuItem("Save As", settings.shortcutSaveAs.c_str(), false, document))
dialog.file_save(dialog::ANM2_SAVE);
if (ImGui::MenuItem("Explore XML Location", nullptr, false, document))
dialog.file_explorer_open(document->directory_get());
if (ImGui::MenuItem("Explore XML Location", nullptr, false, document))
dialog.file_explorer_open(document->directory_get().string());
ImGui::Separator();
if (ImGui::MenuItem("Exit", settings.shortcutExit.c_str())) isQuitting = true;

View File

@@ -73,7 +73,7 @@ namespace anm2ed::imgui
{
std::string errorString{};
document.snapshot("Paste Sound(s)");
if (anm2.sounds_deserialize(clipboard.get(), document.directory_get(), type, &errorString))
if (anm2.sounds_deserialize(clipboard.get(), document.directory_get().string(), type, &errorString))
document.change(Document::SOUNDS);
else
toasts.error(std::format("Failed to deserialize sound(s): {}", errorString));
@@ -131,7 +131,7 @@ namespace anm2ed::imgui
auto add = [&]()
{
int id{};
if (anm2.sound_add(document.directory_get(), dialog.path, id))
if (anm2.sound_add(document.directory_get().string(), dialog.path, id))
{
selection = {id};
toasts.info(std::format("Initialized sound #{}: {}", id, dialog.path));
@@ -145,4 +145,4 @@ namespace anm2ed::imgui
dialog.reset();
}
}
}
}

View File

@@ -46,7 +46,7 @@ namespace anm2ed::imgui
{
std::string errorString{};
document.snapshot("Paste Spritesheet(s)");
if (anm2.spritesheets_deserialize(clipboard.get(), document.directory_get(), type, &errorString))
if (anm2.spritesheets_deserialize(clipboard.get(), document.directory_get().string(), type, &errorString))
document.change(Document::SPRITESHEETS);
else
toasts.error(std::format("Failed to deserialize spritesheet(s): {}", errorString));
@@ -208,7 +208,7 @@ namespace anm2ed::imgui
for (auto& id : selection)
{
anm2::Spritesheet& spritesheet = anm2.content.spritesheets[id];
spritesheet.reload(document.directory_get());
spritesheet.reload(document.directory_get().string());
toasts.info(std::format("Reloaded spritesheet #{}: {}", id, spritesheet.path.string()));
}
};
@@ -234,7 +234,7 @@ namespace anm2ed::imgui
{
auto& id = *selection.begin();
anm2::Spritesheet& spritesheet = anm2.content.spritesheets[id];
spritesheet = anm2::Spritesheet(document.directory_get(), dialog.path);
spritesheet = anm2::Spritesheet(document.directory_get().string(), dialog.path);
toasts.info(std::format("Replaced spritesheet #{}: {}", id, spritesheet.path.string()));
};
@@ -276,7 +276,7 @@ namespace anm2ed::imgui
for (auto& id : selection)
{
anm2::Spritesheet& spritesheet = anm2.content.spritesheets[id];
if (spritesheet.save(document.directory_get()))
if (spritesheet.save(document.directory_get().string()))
toasts.info(std::format("Saved spritesheet #{}: {}", id, spritesheet.path.string()));
else
toasts.info(std::format("Unable to save spritesheet #{}: {}", id, spritesheet.path.string()));