mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 20:54:16 +01:00
Wait for saves to finish when the file might be read immediately after saving.
This commit is contained in:
parent
a9f36c6aef
commit
bb742463e9
6 changed files with 10 additions and 9 deletions
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
||||||
Subproject commit 3e2d4ae934694918d312280d62127cf1a55b03e4
|
Subproject commit 7098e9577117a3555f5f6181edae6cd306a4b5d4
|
||||||
|
|
@ -14,7 +14,7 @@ internal static class ModCollectionMigration
|
||||||
{
|
{
|
||||||
var changes = MigrateV0ToV1(collection, ref version);
|
var changes = MigrateV0ToV1(collection, ref version);
|
||||||
if (changes)
|
if (changes)
|
||||||
saver.ImmediateSave(new ModCollectionSave(mods, collection));
|
saver.ImmediateSaveSync(new ModCollectionSave(mods, collection));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Migrate a mod collection from Version 0 to Version 1, which introduced support for inheritance. </summary>
|
/// <summary> Migrate a mod collection from Version 0 to Version 1, which introduced support for inheritance. </summary>
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public class DuplicateManager
|
||||||
{
|
{
|
||||||
var sub = (SubMod)subMod;
|
var sub = (SubMod)subMod;
|
||||||
sub.FileData = dict;
|
sub.FileData = dict;
|
||||||
_saveService.ImmediateSave(new ModSaveGroup(mod, groupIdx));
|
_saveService.ImmediateSaveSync(new ModSaveGroup(mod, groupIdx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ public partial class ModCreator
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_saveService.SaveAllOptionGroups(mod, false);
|
_saveService.SaveAllOptionGroups(mod, false);
|
||||||
_saveService.ImmediateSave(new ModSaveGroup(mod.ModPath, mod.Default));
|
_saveService.ImmediateSaveSync(new ModSaveGroup(mod.ModPath, mod.Default));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -261,7 +261,7 @@ public partial class ModCreator
|
||||||
DefaultSettings = defaultSettings,
|
DefaultSettings = defaultSettings,
|
||||||
};
|
};
|
||||||
group.PrioritizedOptions.AddRange(subMods.OfType<SubMod>().Select((s, idx) => (s, idx)));
|
group.PrioritizedOptions.AddRange(subMods.OfType<SubMod>().Select((s, idx) => (s, idx)));
|
||||||
_saveService.ImmediateSave(new ModSaveGroup(baseFolder, group, index));
|
_saveService.ImmediateSaveSync(new ModSaveGroup(baseFolder, group, index));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GroupType.Single:
|
case GroupType.Single:
|
||||||
|
|
@ -274,7 +274,7 @@ public partial class ModCreator
|
||||||
DefaultSettings = defaultSettings,
|
DefaultSettings = defaultSettings,
|
||||||
};
|
};
|
||||||
group.OptionData.AddRange(subMods.OfType<SubMod>());
|
group.OptionData.AddRange(subMods.OfType<SubMod>());
|
||||||
_saveService.ImmediateSave(new ModSaveGroup(baseFolder, group, index));
|
_saveService.ImmediateSaveSync(new ModSaveGroup(baseFolder, group, index));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -321,7 +321,7 @@ public partial class ModCreator
|
||||||
}
|
}
|
||||||
|
|
||||||
IncorporateMetaChanges(mod.Default, directory, true);
|
IncorporateMetaChanges(mod.Default, directory, true);
|
||||||
_saveService.ImmediateSave(new ModSaveGroup(mod, -1));
|
_saveService.ImmediateSaveSync(new ModSaveGroup(mod, -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Return the name of a new valid directory based on the base directory and the given name. </summary>
|
/// <summary> Return the name of a new valid directory based on the base directory and the given name. </summary>
|
||||||
|
|
|
||||||
|
|
@ -372,7 +372,7 @@ public class ConfigMigrationService
|
||||||
var emptyStorage = new ModStorage();
|
var emptyStorage = new ModStorage();
|
||||||
var collection = ModCollection.CreateFromData(_saveService, emptyStorage, ModCollection.DefaultCollectionName, 0, 1, dict,
|
var collection = ModCollection.CreateFromData(_saveService, emptyStorage, ModCollection.DefaultCollectionName, 0, 1, dict,
|
||||||
Array.Empty<string>());
|
Array.Empty<string>());
|
||||||
_saveService.ImmediateSave(new ModCollectionSave(emptyStorage, collection));
|
_saveService.ImmediateSaveSync(new ModCollectionSave(emptyStorage, collection));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,8 @@ public sealed class SaveService : SaveServiceBase<FilenameService>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0; i < mod.Groups.Count; ++i)
|
for (var i = 0; i < mod.Groups.Count - 1; ++i)
|
||||||
ImmediateSave(new ModSaveGroup(mod, i));
|
ImmediateSave(new ModSaveGroup(mod, i));
|
||||||
|
ImmediateSaveSync(new ModSaveGroup(mod, mod.Groups.Count - 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue