addressing windows issues
This commit is contained in:
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
#include <format>
|
#include <format>
|
||||||
|
|
||||||
#include <format>
|
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "strings.h"
|
#include "strings.h"
|
||||||
#include "toast.h"
|
#include "toast.h"
|
||||||
@@ -88,15 +86,15 @@ namespace anm2ed
|
|||||||
if (anm2.serialize(absolutePath, errorString))
|
if (anm2.serialize(absolutePath, errorString))
|
||||||
{
|
{
|
||||||
toasts.push(std::vformat(localize.get(TOAST_SAVE_DOCUMENT), std::make_format_args(absolutePath)));
|
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),
|
logger.info(
|
||||||
std::make_format_args(absolutePath)));
|
std::vformat(localize.get(TOAST_SAVE_DOCUMENT, anm2ed::ENGLISH), std::make_format_args(absolutePath)));
|
||||||
clean();
|
clean();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (errorString)
|
else if (errorString)
|
||||||
{
|
{
|
||||||
toasts.push(std::vformat(localize.get(TOAST_SAVE_DOCUMENT_FAILED),
|
toasts.push(
|
||||||
std::make_format_args(absolutePath, *errorString)));
|
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),
|
logger.error(std::vformat(localize.get(TOAST_SAVE_DOCUMENT_FAILED, anm2ed::ENGLISH),
|
||||||
std::make_format_args(absolutePath, *errorString)));
|
std::make_format_args(absolutePath, *errorString)));
|
||||||
}
|
}
|
||||||
@@ -135,8 +133,8 @@ namespace anm2ed
|
|||||||
}
|
}
|
||||||
else if (errorString)
|
else if (errorString)
|
||||||
{
|
{
|
||||||
toasts.push(std::vformat(localize.get(TOAST_AUTOSAVE_FAILED),
|
toasts.push(
|
||||||
std::make_format_args(autosavePathString, *errorString)));
|
std::vformat(localize.get(TOAST_AUTOSAVE_FAILED), std::make_format_args(autosavePathString, *errorString)));
|
||||||
logger.error(std::vformat(localize.get(TOAST_AUTOSAVE_FAILED, anm2ed::ENGLISH),
|
logger.error(std::vformat(localize.get(TOAST_AUTOSAVE_FAILED, anm2ed::ENGLISH),
|
||||||
std::make_format_args(autosavePathString, *errorString)));
|
std::make_format_args(autosavePathString, *errorString)));
|
||||||
}
|
}
|
||||||
@@ -279,8 +277,8 @@ namespace anm2ed
|
|||||||
sound.selection = {id};
|
sound.selection = {id};
|
||||||
sound.reference = id;
|
sound.reference = id;
|
||||||
toasts.push(std::vformat(localize.get(TOAST_SOUND_INITIALIZED), std::make_format_args(id, soundPath)));
|
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),
|
logger.info(
|
||||||
std::make_format_args(id, soundPath)));
|
std::vformat(localize.get(TOAST_SOUND_INITIALIZED, anm2ed::ENGLISH), std::make_format_args(id, soundPath)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ namespace anm2ed::imgui
|
|||||||
{
|
{
|
||||||
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left))
|
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());
|
dialog.file_explorer_open(spritesheet.path.parent_path().string());
|
||||||
}
|
}
|
||||||
hovered = id;
|
hovered = id;
|
||||||
|
|||||||
@@ -56,5 +56,10 @@ namespace anm2ed::util::filesystem
|
|||||||
std::filesystem::current_path(path);
|
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); }
|
WorkingDirectory::~WorkingDirectory() { std::filesystem::current_path(previous); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ namespace anm2ed::util::filesystem
|
|||||||
std::filesystem::path previous;
|
std::filesystem::path previous;
|
||||||
|
|
||||||
WorkingDirectory(const std::string&, bool = false);
|
WorkingDirectory(const std::string&, bool = false);
|
||||||
|
WorkingDirectory(const std::filesystem::path&, bool = false);
|
||||||
~WorkingDirectory();
|
~WorkingDirectory();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user