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

@@ -71,7 +71,7 @@ namespace anm2ed
{ {
this->path = !path.empty() ? path : this->path.string(); this->path = !path.empty() ? path : this->path.string();
if (anm2.serialize(this->path, errorString)) if (anm2.serialize(this->path.string(), errorString))
{ {
toasts.info(std::format("Saved document to: {}", this->path.string())); toasts.info(std::format("Saved document to: {}", this->path.string()));
clean(); clean();
@@ -212,7 +212,7 @@ namespace anm2ed
auto add = [&]() auto add = [&]()
{ {
int id{}; int id{};
if (anm2.spritesheet_add(directory_get(), path, id)) if (anm2.spritesheet_add(directory_get().string(), path, id))
{ {
anm2::Spritesheet& spritesheet = anm2.content.spritesheets[id]; anm2::Spritesheet& spritesheet = anm2.content.spritesheets[id];
this->spritesheet.selection = {id}; this->spritesheet.selection = {id};

View File

@@ -69,7 +69,6 @@ namespace anm2ed
bool save(const std::string& = {}, std::string* = nullptr); bool save(const std::string& = {}, std::string* = nullptr);
void hash_set(); void hash_set();
void clean(); void clean();
void on_change();
void change(ChangeType); void change(ChangeType);
bool is_dirty(); bool is_dirty();
bool is_autosave_dirty(); bool is_autosave_dirty();

View File

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

View File

@@ -73,7 +73,7 @@ namespace anm2ed::imgui
{ {
std::string errorString{}; std::string errorString{};
document.snapshot("Paste Sound(s)"); 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); document.change(Document::SOUNDS);
else else
toasts.error(std::format("Failed to deserialize sound(s): {}", errorString)); toasts.error(std::format("Failed to deserialize sound(s): {}", errorString));
@@ -131,7 +131,7 @@ namespace anm2ed::imgui
auto add = [&]() auto add = [&]()
{ {
int id{}; 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}; selection = {id};
toasts.info(std::format("Initialized sound #{}: {}", id, dialog.path)); toasts.info(std::format("Initialized sound #{}: {}", id, dialog.path));

View File

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

View File

@@ -6,7 +6,6 @@
#include <fstream> #include <fstream>
#ifdef _WIN32 #ifdef _WIN32
#include "util.h"
#define POPEN _popen #define POPEN _popen
#define PCLOSE _pclose #define PCLOSE _pclose
#define PWRITE_MODE "wb" #define PWRITE_MODE "wb"
@@ -19,7 +18,9 @@
#endif #endif
#include "log.h" #include "log.h"
#include "string_.h"
using namespace anm2ed::util;
using namespace anm2ed::resource; using namespace anm2ed::resource;
using namespace glm; using namespace glm;