Skip to content

Commit bd9a4bf

Browse files
committed
Update 2.3.1.8
2 parents 86620bb + b91e186 commit bd9a4bf

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

xivModdingFramework/Cache/XivDependencyGraph.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,18 @@ public struct XivDependencyRootInfo :ICloneable
168168
// Slot may not exist for all types.
169169
public string? Slot;
170170

171+
public XivDependencyRootInfo GetOtherSlot(string slot)
172+
{
173+
return new XivDependencyRootInfo()
174+
{
175+
PrimaryId = PrimaryId,
176+
PrimaryType = PrimaryType,
177+
SecondaryId = SecondaryId,
178+
SecondaryType = SecondaryType,
179+
Slot = slot
180+
};
181+
}
182+
171183
/// <summary>
172184
/// Converts this dependency root into a raw string entry.
173185
/// </summary>

xivModdingFramework/Mods/Modding.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public async Task<bool> ToggleModStatus(string internalFilePath, bool enable)
267267

268268
var modEntry = modList.Mods.FirstOrDefault(x => x.fullPath == internalFilePath);
269269

270-
var result = await ToggleModUnsafe(enable, modEntry);
270+
var result = await ToggleModUnsafe(enable, modEntry, false, true);
271271
if(!result)
272272
{
273273
return result;
@@ -319,7 +319,7 @@ public async Task ToggleModPackStatus(string modPackName, bool enable)
319319

320320
foreach (var modEntry in mods)
321321
{
322-
await ToggleModUnsafe(enable, modEntry);
322+
await ToggleModUnsafe(enable, modEntry, false, true);
323323
}
324324

325325
SaveModList(modList);
@@ -338,7 +338,7 @@ public async Task ToggleModPackStatus(string modPackName, bool enable)
338338
/// <param name="enable"></param>
339339
/// <param name="mod"></param>
340340
/// <returns></returns>
341-
public async Task<bool> ToggleModUnsafe(bool enable, Mod mod, bool includeInternal = false)
341+
public async Task<bool> ToggleModUnsafe(bool enable, Mod mod, bool includeInternal, bool updateCache)
342342
{
343343
if (mod == null) return false;
344344
if (string.IsNullOrEmpty(mod.name)) return false;
@@ -368,7 +368,7 @@ public async Task<bool> ToggleModUnsafe(bool enable, Mod mod, bool includeIntern
368368
// Added file.
369369
if (enable && !mod.enabled)
370370
{
371-
await index.AddFileDescriptor(mod.fullPath, mod.data.modOffset, IOUtil.GetDataFileFromPath(mod.fullPath), false);
371+
await index.AddFileDescriptor(mod.fullPath, mod.data.modOffset, IOUtil.GetDataFileFromPath(mod.fullPath), updateCache);
372372
mod.enabled = true;
373373

374374
// Check if we're re-enabling a metadata mod.
@@ -387,7 +387,7 @@ public async Task<bool> ToggleModUnsafe(bool enable, Mod mod, bool includeIntern
387387
{
388388

389389
// Delete file descriptor handles removing metadata as needed on its own.
390-
await index.DeleteFileDescriptor(mod.fullPath, IOUtil.GetDataFileFromPath(mod.fullPath), false);
390+
await index.DeleteFileDescriptor(mod.fullPath, IOUtil.GetDataFileFromPath(mod.fullPath), updateCache);
391391
mod.enabled = false;
392392
}
393393

@@ -397,12 +397,12 @@ public async Task<bool> ToggleModUnsafe(bool enable, Mod mod, bool includeIntern
397397
// Standard mod.
398398
if (enable && !mod.enabled)
399399
{
400-
await index.UpdateDataOffset(mod.data.modOffset, mod.fullPath, false);
400+
await index.UpdateDataOffset(mod.data.modOffset, mod.fullPath, updateCache);
401401
mod.enabled = true;
402402
}
403403
else if (!enable && mod.enabled)
404404
{
405-
await index.UpdateDataOffset(mod.data.originalOffset, mod.fullPath, false);
405+
await index.UpdateDataOffset(mod.data.originalOffset, mod.fullPath, updateCache);
406406
mod.enabled = false;
407407
}
408408
}
@@ -432,7 +432,7 @@ public async Task ToggleAllMods(bool enable, IProgress<(int current, int total,
432432
// Save disabling these for last.
433433
if (modEntry.IsInternal()) continue;
434434

435-
await ToggleModUnsafe(enable, modEntry);
435+
await ToggleModUnsafe(enable, modEntry, false, false);
436436
progress?.Report((++modNum, modList.Mods.Count, string.Empty));
437437
}
438438

@@ -442,7 +442,7 @@ public async Task ToggleAllMods(bool enable, IProgress<(int current, int total,
442442
var internalEntries = modList.Mods.Where(x => x.IsInternal());
443443
foreach (var modEntry in internalEntries)
444444
{
445-
await ToggleModUnsafe(enable, modEntry, true);
445+
await ToggleModUnsafe(enable, modEntry, true, false);
446446
}
447447
}
448448

0 commit comments

Comments
 (0)