fix for filepath to string conversions
This commit is contained in:
@@ -71,7 +71,7 @@ namespace anm2ed
|
||||
{
|
||||
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()));
|
||||
clean();
|
||||
@@ -212,7 +212,7 @@ namespace anm2ed
|
||||
auto add = [&]()
|
||||
{
|
||||
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];
|
||||
this->spritesheet.selection = {id};
|
||||
|
||||
@@ -69,7 +69,6 @@ namespace anm2ed
|
||||
bool save(const std::string& = {}, std::string* = nullptr);
|
||||
void hash_set();
|
||||
void clean();
|
||||
void on_change();
|
||||
void change(ChangeType);
|
||||
bool is_dirty();
|
||||
bool is_autosave_dirty();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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()));
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <fstream>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "util.h"
|
||||
#define POPEN _popen
|
||||
#define PCLOSE _pclose
|
||||
#define PWRITE_MODE "wb"
|
||||
@@ -19,7 +18,9 @@
|
||||
#endif
|
||||
|
||||
#include "log.h"
|
||||
#include "string_.h"
|
||||
|
||||
using namespace anm2ed::util;
|
||||
using namespace anm2ed::resource;
|
||||
using namespace glm;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user