preliminary utf-16 stuff

This commit is contained in:
2025-12-13 21:54:29 -05:00
parent 1a3c75a84a
commit 31ac9707e7
13 changed files with 155 additions and 97 deletions
+1 -1
View File
@@ -268,7 +268,7 @@ namespace anm2ed::imgui
if (ImGui::MenuItem(localize.get(LABEL_SAVE_AS), settings.shortcutSaveAs.c_str(), false, document))
dialog.file_save(dialog::ANM2_SAVE);
if (ImGui::MenuItem(localize.get(LABEL_EXPLORE_XML_LOCATION), nullptr, false, document))
dialog.file_explorer_open(document->directory_get().string());
dialog.file_explorer_open(document->directory_get());
ImGui::Separator();
if (ImGui::MenuItem(localize.get(LABEL_EXIT), settings.shortcutExit.c_str())) isQuitting = true;
+2 -2
View File
@@ -94,7 +94,7 @@ namespace anm2ed::imgui
{
auto& id = *selection.begin();
anm2::Sound& sound = anm2.content.sounds[id];
sound = anm2::Sound(document.directory_get().string(), path);
sound = anm2::Sound(document.directory_get(), path);
auto pathString = sound.path.string();
toasts.push(std::vformat(localize.get(TOAST_REPLACE_SOUND), std::make_format_args(id, pathString)));
logger.info(
@@ -129,7 +129,7 @@ namespace anm2ed::imgui
{
std::string errorString{};
document.snapshot(localize.get(TOAST_SOUNDS_PASTE));
if (anm2.sounds_deserialize(clipboard.get(), document.directory_get().string(), merge::APPEND, &errorString))
if (anm2.sounds_deserialize(clipboard.get(), document.directory_get(), merge::APPEND, &errorString))
document.change(Document::SOUNDS);
else
{
+4 -4
View File
@@ -34,7 +34,7 @@ namespace anm2ed::imgui
auto add = [&](const std::filesystem::path& path)
{
if (path.empty()) return;
document.spritesheet_add(path.string());
document.spritesheet_add(path);
newSpritesheetId = document.spritesheet.reference;
};
@@ -87,7 +87,7 @@ namespace anm2ed::imgui
{
auto& id = *selection.begin();
anm2::Spritesheet& spritesheet = anm2.content.spritesheets[id];
spritesheet = anm2::Spritesheet(document.directory_get().string(), path);
spritesheet = anm2::Spritesheet(document.directory_get(), path);
auto pathString = spritesheet.path.string();
toasts.push(std::vformat(localize.get(TOAST_REPLACE_SPRITESHEET), std::make_format_args(id, pathString)));
logger.info(std::vformat(localize.get(TOAST_REPLACE_SPRITESHEET, anm2ed::ENGLISH),
@@ -105,7 +105,7 @@ namespace anm2ed::imgui
{
anm2::Spritesheet& spritesheet = anm2.content.spritesheets[id];
auto pathString = spritesheet.path.string();
if (spritesheet.save(document.directory_get().string()))
if (spritesheet.save(document.directory_get()))
{
toasts.push(std::vformat(localize.get(TOAST_SAVE_SPRITESHEET), std::make_format_args(id, pathString)));
logger.info(std::vformat(localize.get(TOAST_SAVE_SPRITESHEET, anm2ed::ENGLISH),
@@ -145,7 +145,7 @@ namespace anm2ed::imgui
{
std::string errorString{};
document.snapshot(localize.get(EDIT_PASTE_SPRITESHEETS));
if (anm2.spritesheets_deserialize(clipboard.get(), document.directory_get().string(), merge::APPEND,
if (anm2.spritesheets_deserialize(clipboard.get(), document.directory_get(), merge::APPEND,
&errorString))
document.change(Document::SPRITESHEETS);
else