Skip to content

Commit

Permalink
Move some classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ottermandias committed Jul 29, 2023
1 parent ef916fc commit 1d5e050
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Penumbra/Import/TexToolsImporter.ModPack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
using System.Linq;
using Newtonsoft.Json;
using Penumbra.Api.Enums;
using Penumbra.Import.Structs;
using Penumbra.Import.Structs;
using Penumbra.Mods;
using Penumbra.Mods.Subclasses;
using Penumbra.Util;
using SharpCompress.Archives.Zip;

Expand Down
1 change: 1 addition & 0 deletions Penumbra/Mods/Editor/DuplicateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Threading;
using System.Threading.Tasks;
using Penumbra.Mods.Manager;
using Penumbra.Mods.Subclasses;
using Penumbra.Services;
using Penumbra.String.Classes;

Expand Down
1 change: 1 addition & 0 deletions Penumbra/Mods/Editor/IMod.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using OtterGui.Classes;
using Penumbra.Mods.Subclasses;

namespace Penumbra.Mods;

Expand Down
1 change: 1 addition & 0 deletions Penumbra/Mods/Editor/ModEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.IO;
using OtterGui;
using Penumbra.Mods.Editor;
using Penumbra.Mods.Subclasses;

namespace Penumbra.Mods;

Expand Down
1 change: 1 addition & 0 deletions Penumbra/Mods/Manager/ModMigration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Newtonsoft.Json.Linq;
using OtterGui;
using Penumbra.Api.Enums;
using Penumbra.Mods.Subclasses;
using Penumbra.Services;
using Penumbra.String.Classes;
using Penumbra.Util;
Expand Down
6 changes: 3 additions & 3 deletions Penumbra/Mods/Manager/ModOptionEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using OtterGui.Filesystem;
using Penumbra.Api.Enums;
using Penumbra.Meta.Manipulations;
using Penumbra.Mods.Subclasses;
using Penumbra.Services;
using Penumbra.String.Classes;
using Penumbra.Util;
Expand Down Expand Up @@ -127,11 +128,10 @@ public void AddModGroup(Mod mod, GroupType type, string newName)
/// <summary> Delete a given option group. Fires an event to prepare before actually deleting. </summary>
public void DeleteModGroup(Mod mod, int groupIdx)
{
var group = mod.Groups[groupIdx];
_communicator.ModOptionChanged.Invoke(ModOptionChangeType.PrepareChange, mod, groupIdx, -1, -1);
mod.Groups.RemoveAt(groupIdx);
UpdateSubModPositions(mod, groupIdx);
_saveService.SaveAllOptionGroups(mod);
_saveService.SaveAllOptionGroups(mod, false);
_communicator.ModOptionChanged.Invoke(ModOptionChangeType.GroupDeleted, mod, groupIdx, -1, -1);
}

Expand All @@ -142,7 +142,7 @@ public void MoveModGroup(Mod mod, int groupIdxFrom, int groupIdxTo)
return;

UpdateSubModPositions(mod, Math.Min(groupIdxFrom, groupIdxTo));
_saveService.SaveAllOptionGroups(mod);
_saveService.SaveAllOptionGroups(mod, false);
_communicator.ModOptionChanged.Invoke(ModOptionChangeType.GroupMoved, mod, groupIdxFrom, -1, groupIdxTo);
}

Expand Down
1 change: 1 addition & 0 deletions Penumbra/Mods/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Penumbra.Collections.Cache;
using Penumbra.Import;
using Penumbra.Meta;
using Penumbra.Mods.Subclasses;
using Penumbra.String.Classes;

namespace Penumbra.Mods;
Expand Down
7 changes: 5 additions & 2 deletions Penumbra/Mods/ModCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Penumbra.Import.Structs;
using Penumbra.Meta;
using Penumbra.Mods.Manager;
using Penumbra.Mods.Subclasses;
using Penumbra.Services;
using Penumbra.String.Classes;
using Penumbra.Util;
Expand Down Expand Up @@ -117,7 +118,9 @@ public void LoadAllGroups(Mod mod)
}

if (changes)
_saveService.SaveAllOptionGroups(mod);
{
_saveService.SaveAllOptionGroups(mod, true);
}
}

/// <summary> Load the default option for a given mod.</summary>
Expand Down Expand Up @@ -182,7 +185,7 @@ public void IncorporateAllMetaChanges(Mod mod, bool delete)
if (!changes)
return;

_saveService.SaveAllOptionGroups(mod);
_saveService.SaveAllOptionGroups(mod, false);
_saveService.ImmediateSave(new ModSaveGroup(mod.ModPath, mod.Default));
}

Expand Down
3 changes: 1 addition & 2 deletions Penumbra/Mods/Subclasses/IModGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
using Newtonsoft.Json;
using Penumbra.Api.Enums;
using Penumbra.Services;
using Penumbra.Util;

namespace Penumbra.Mods;
namespace Penumbra.Mods.Subclasses;

public interface IModGroup : IEnumerable<ISubMod>
{
Expand Down
1 change: 1 addition & 0 deletions Penumbra/Mods/Subclasses/ISubMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.IO;
using Newtonsoft.Json;
using Penumbra.Meta.Manipulations;
using Penumbra.Mods.Subclasses;
using Penumbra.String.Classes;

namespace Penumbra.Mods;
Expand Down
1 change: 1 addition & 0 deletions Penumbra/Mods/Subclasses/Mod.Files.SubMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Penumbra.Import;
using Penumbra.Meta;
using Penumbra.Meta.Manipulations;
using Penumbra.Mods.Subclasses;
using Penumbra.String.Classes;

namespace Penumbra.Mods;
Expand Down
1 change: 1 addition & 0 deletions Penumbra/Mods/Subclasses/ModSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Penumbra.Api.Enums;
using Penumbra.Meta.Manipulations;
using Penumbra.Mods.Manager;
using Penumbra.Mods.Subclasses;
using Penumbra.String.Classes;

namespace Penumbra.Mods;
Expand Down
1 change: 1 addition & 0 deletions Penumbra/Mods/Subclasses/MultiModGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using OtterGui;
using OtterGui.Filesystem;
using Penumbra.Api.Enums;
using Penumbra.Mods.Subclasses;

namespace Penumbra.Mods;

Expand Down
1 change: 1 addition & 0 deletions Penumbra/Mods/Subclasses/SingleModGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using OtterGui;
using OtterGui.Filesystem;
using Penumbra.Api.Enums;
using Penumbra.Mods.Subclasses;

namespace Penumbra.Mods;

Expand Down
1 change: 1 addition & 0 deletions Penumbra/Mods/TemporaryMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Penumbra.Collections;
using Penumbra.Meta.Manipulations;
using Penumbra.Mods.Manager;
using Penumbra.Mods.Subclasses;
using Penumbra.Services;
using Penumbra.String.Classes;
using Penumbra.Util;
Expand Down
1 change: 1 addition & 0 deletions Penumbra/UI/AdvancedWindow/ItemSwapTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Penumbra.Mods;
using Penumbra.Mods.ItemSwap;
using Penumbra.Mods.Manager;
using Penumbra.Mods.Subclasses;
using Penumbra.Services;
using Penumbra.UI.Classes;

Expand Down
1 change: 1 addition & 0 deletions Penumbra/UI/ModsTab/ModPanelEditTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Penumbra.Mods;
using Penumbra.Mods.Editor;
using Penumbra.Mods.Manager;
using Penumbra.Mods.Subclasses;
using Penumbra.Services;
using Penumbra.UI.AdvancedWindow;

Expand Down
1 change: 1 addition & 0 deletions Penumbra/UI/ModsTab/ModPanelSettingsTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Dalamud.Interface;
using Penumbra.Collections.Manager;
using Penumbra.Mods.Manager;
using Penumbra.Mods.Subclasses;
using Penumbra.Services;

namespace Penumbra.UI.ModsTab;
Expand Down

0 comments on commit 1d5e050

Please sign in to comment.