mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 20:24:17 +01:00
Move editors into folder.
This commit is contained in:
parent
1e5ed1c414
commit
cff6172453
18 changed files with 74 additions and 62 deletions
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
||||||
Subproject commit 3460a817fc5e01a6b60eb834c3c59031938388fc
|
Subproject commit 20c4a6c53103d9fa8dec63babc628c9d01f094c0
|
||||||
|
|
@ -10,6 +10,7 @@ using Penumbra.Mods;
|
||||||
using Penumbra.Mods.Editor;
|
using Penumbra.Mods.Editor;
|
||||||
using Penumbra.Mods.Groups;
|
using Penumbra.Mods.Groups;
|
||||||
using Penumbra.Mods.Manager;
|
using Penumbra.Mods.Manager;
|
||||||
|
using Penumbra.Mods.Manager.OptionEditor;
|
||||||
using Penumbra.Mods.Settings;
|
using Penumbra.Mods.Settings;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ using Penumbra.Meta;
|
||||||
using Penumbra.Mods;
|
using Penumbra.Mods;
|
||||||
using Penumbra.Mods.Groups;
|
using Penumbra.Mods.Groups;
|
||||||
using Penumbra.Mods.Manager;
|
using Penumbra.Mods.Manager;
|
||||||
|
using Penumbra.Mods.Manager.OptionEditor;
|
||||||
using Penumbra.Mods.Settings;
|
using Penumbra.Mods.Settings;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ using Penumbra.Mods;
|
||||||
using Penumbra.Mods.Editor;
|
using Penumbra.Mods.Editor;
|
||||||
using Penumbra.Mods.Groups;
|
using Penumbra.Mods.Groups;
|
||||||
using Penumbra.Mods.Manager;
|
using Penumbra.Mods.Manager;
|
||||||
|
using Penumbra.Mods.Manager.OptionEditor;
|
||||||
using Penumbra.Mods.Settings;
|
using Penumbra.Mods.Settings;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using Penumbra.Api.Api;
|
||||||
using Penumbra.Mods;
|
using Penumbra.Mods;
|
||||||
using Penumbra.Mods.Groups;
|
using Penumbra.Mods.Groups;
|
||||||
using Penumbra.Mods.Manager;
|
using Penumbra.Mods.Manager;
|
||||||
|
using Penumbra.Mods.Manager.OptionEditor;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
using static Penumbra.Communication.ModOptionChanged;
|
using static Penumbra.Communication.ModOptionChanged;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ using OtterGui.Classes;
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Communication;
|
using Penumbra.Communication;
|
||||||
using Penumbra.Mods.Manager;
|
using Penumbra.Mods.Manager;
|
||||||
|
using Penumbra.Mods.Manager.OptionEditor;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
using Penumbra.String.Classes;
|
using Penumbra.String.Classes;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using Penumbra.GameData.Data;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
using Penumbra.Meta.Manipulations;
|
using Penumbra.Meta.Manipulations;
|
||||||
using Penumbra.Mods.Groups;
|
using Penumbra.Mods.Groups;
|
||||||
|
using Penumbra.Mods.Manager.OptionEditor;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Penumbra.Communication;
|
using Penumbra.Communication;
|
||||||
using Penumbra.Mods.Editor;
|
using Penumbra.Mods.Editor;
|
||||||
|
using Penumbra.Mods.Manager.OptionEditor;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
||||||
namespace Penumbra.Mods.Manager;
|
namespace Penumbra.Mods.Manager;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using Penumbra.Mods.Settings;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
||||||
namespace Penumbra.Mods.Manager;
|
namespace Penumbra.Mods.Manager.OptionEditor;
|
||||||
|
|
||||||
public sealed class ImcModGroupEditor(CommunicatorService communicator, SaveService saveService, Configuration config)
|
public sealed class ImcModGroupEditor(CommunicatorService communicator, SaveService saveService, Configuration config)
|
||||||
: ModOptionEditor<ImcModGroup, ImcSubMod>(communicator, saveService, config), IService
|
: ModOptionEditor<ImcModGroup, ImcSubMod>(communicator, saveService, config), IService
|
||||||
|
|
@ -14,7 +14,7 @@ public sealed class ImcModGroupEditor(CommunicatorService communicator, SaveServ
|
||||||
protected override ImcModGroup CreateGroup(Mod mod, string newName, ModPriority priority, SaveType saveType = SaveType.ImmediateSync)
|
protected override ImcModGroup CreateGroup(Mod mod, string newName, ModPriority priority, SaveType saveType = SaveType.ImmediateSync)
|
||||||
=> new(mod)
|
=> new(mod)
|
||||||
{
|
{
|
||||||
Name = newName,
|
Name = newName,
|
||||||
Priority = priority,
|
Priority = priority,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using Dalamud.Interface.Internal.Notifications;
|
using Dalamud.Interface.Internal.Notifications;
|
||||||
using OtterGui.Classes;
|
using OtterGui.Classes;
|
||||||
using OtterGui.Filesystem;
|
using OtterGui.Filesystem;
|
||||||
using OtterGui.Services;
|
using OtterGui.Services;
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.GameData.Data;
|
|
||||||
using Penumbra.Meta.Manipulations;
|
using Penumbra.Meta.Manipulations;
|
||||||
using Penumbra.Mods.Groups;
|
using Penumbra.Mods.Groups;
|
||||||
using Penumbra.Mods.Settings;
|
using Penumbra.Mods.Settings;
|
||||||
|
|
@ -12,9 +10,8 @@ using Penumbra.Mods.SubMods;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
using Penumbra.String.Classes;
|
using Penumbra.String.Classes;
|
||||||
using Penumbra.Util;
|
using Penumbra.Util;
|
||||||
using static FFXIVClientStructs.FFXIV.Client.UI.Misc.ConfigModule;
|
|
||||||
|
|
||||||
namespace Penumbra.Mods.Manager;
|
namespace Penumbra.Mods.Manager.OptionEditor;
|
||||||
|
|
||||||
public enum ModOptionChangeType
|
public enum ModOptionChangeType
|
||||||
{
|
{
|
||||||
|
|
@ -91,7 +88,7 @@ public class ModGroupEditor(
|
||||||
/// <summary> Move the index of a given option group. </summary>
|
/// <summary> Move the index of a given option group. </summary>
|
||||||
public void MoveModGroup(IModGroup group, int groupIdxTo)
|
public void MoveModGroup(IModGroup group, int groupIdxTo)
|
||||||
{
|
{
|
||||||
var mod = group.Mod;
|
var mod = group.Mod;
|
||||||
var idxFrom = group.GetIndex();
|
var idxFrom = group.GetIndex();
|
||||||
if (!mod.Groups.Move(idxFrom, groupIdxTo))
|
if (!mod.Groups.Move(idxFrom, groupIdxTo))
|
||||||
return;
|
return;
|
||||||
|
|
@ -230,45 +227,45 @@ public class ModGroupEditor(
|
||||||
=> group switch
|
=> group switch
|
||||||
{
|
{
|
||||||
SingleModGroup s => SingleEditor.AddOption(s, option),
|
SingleModGroup s => SingleEditor.AddOption(s, option),
|
||||||
MultiModGroup m => MultiEditor.AddOption(m, option),
|
MultiModGroup m => MultiEditor.AddOption(m, option),
|
||||||
ImcModGroup i => ImcEditor.AddOption(i, option),
|
ImcModGroup i => ImcEditor.AddOption(i, option),
|
||||||
_ => null,
|
_ => null,
|
||||||
};
|
};
|
||||||
|
|
||||||
public IModOption? AddOption(IModGroup group, string newName)
|
public IModOption? AddOption(IModGroup group, string newName)
|
||||||
=> group switch
|
=> group switch
|
||||||
{
|
{
|
||||||
SingleModGroup s => SingleEditor.AddOption(s, newName),
|
SingleModGroup s => SingleEditor.AddOption(s, newName),
|
||||||
MultiModGroup m => MultiEditor.AddOption(m, newName),
|
MultiModGroup m => MultiEditor.AddOption(m, newName),
|
||||||
ImcModGroup i => ImcEditor.AddOption(i, newName),
|
ImcModGroup i => ImcEditor.AddOption(i, newName),
|
||||||
_ => null,
|
_ => null,
|
||||||
};
|
};
|
||||||
|
|
||||||
public IModGroup? AddModGroup(Mod mod, GroupType type, string newName, SaveType saveType = SaveType.ImmediateSync)
|
public IModGroup? AddModGroup(Mod mod, GroupType type, string newName, SaveType saveType = SaveType.ImmediateSync)
|
||||||
=> type switch
|
=> type switch
|
||||||
{
|
{
|
||||||
GroupType.Single => SingleEditor.AddModGroup(mod, newName, saveType),
|
GroupType.Single => SingleEditor.AddModGroup(mod, newName, saveType),
|
||||||
GroupType.Multi => MultiEditor.AddModGroup(mod, newName, saveType),
|
GroupType.Multi => MultiEditor.AddModGroup(mod, newName, saveType),
|
||||||
GroupType.Imc => ImcEditor.AddModGroup(mod, newName, saveType),
|
GroupType.Imc => ImcEditor.AddModGroup(mod, newName, saveType),
|
||||||
_ => null,
|
_ => null,
|
||||||
};
|
};
|
||||||
|
|
||||||
public (IModGroup?, int, bool) FindOrAddModGroup(Mod mod, GroupType type, string name, SaveType saveType = SaveType.ImmediateSync)
|
public (IModGroup?, int, bool) FindOrAddModGroup(Mod mod, GroupType type, string name, SaveType saveType = SaveType.ImmediateSync)
|
||||||
=> type switch
|
=> type switch
|
||||||
{
|
{
|
||||||
GroupType.Single => SingleEditor.FindOrAddModGroup(mod, name, saveType),
|
GroupType.Single => SingleEditor.FindOrAddModGroup(mod, name, saveType),
|
||||||
GroupType.Multi => MultiEditor.FindOrAddModGroup(mod, name, saveType),
|
GroupType.Multi => MultiEditor.FindOrAddModGroup(mod, name, saveType),
|
||||||
GroupType.Imc => ImcEditor.FindOrAddModGroup(mod, name, saveType),
|
GroupType.Imc => ImcEditor.FindOrAddModGroup(mod, name, saveType),
|
||||||
_ => (null, -1, false),
|
_ => (null, -1, false),
|
||||||
};
|
};
|
||||||
|
|
||||||
public (IModOption?, int, bool) FindOrAddOption(IModGroup group, string name, SaveType saveType = SaveType.ImmediateSync)
|
public (IModOption?, int, bool) FindOrAddOption(IModGroup group, string name, SaveType saveType = SaveType.ImmediateSync)
|
||||||
=> group switch
|
=> group switch
|
||||||
{
|
{
|
||||||
SingleModGroup s => SingleEditor.FindOrAddOption(s, name, saveType),
|
SingleModGroup s => SingleEditor.FindOrAddOption(s, name, saveType),
|
||||||
MultiModGroup m => MultiEditor.FindOrAddOption(m, name, saveType),
|
MultiModGroup m => MultiEditor.FindOrAddOption(m, name, saveType),
|
||||||
ImcModGroup i => ImcEditor.FindOrAddOption(i, name, saveType),
|
ImcModGroup i => ImcEditor.FindOrAddOption(i, name, saveType),
|
||||||
_ => (null, -1, false),
|
_ => (null, -1, false),
|
||||||
};
|
};
|
||||||
|
|
||||||
public void MoveOption(IModOption option, int toIdx)
|
public void MoveOption(IModOption option, int toIdx)
|
||||||
|
|
@ -5,7 +5,7 @@ using Penumbra.Mods.Settings;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
||||||
namespace Penumbra.Mods.Manager;
|
namespace Penumbra.Mods.Manager.OptionEditor;
|
||||||
|
|
||||||
public abstract class ModOptionEditor<TGroup, TOption>(
|
public abstract class ModOptionEditor<TGroup, TOption>(
|
||||||
CommunicatorService communicator,
|
CommunicatorService communicator,
|
||||||
|
|
@ -15,8 +15,8 @@ public abstract class ModOptionEditor<TGroup, TOption>(
|
||||||
where TOption : class, IModOption
|
where TOption : class, IModOption
|
||||||
{
|
{
|
||||||
protected readonly CommunicatorService Communicator = communicator;
|
protected readonly CommunicatorService Communicator = communicator;
|
||||||
protected readonly SaveService SaveService = saveService;
|
protected readonly SaveService SaveService = saveService;
|
||||||
protected readonly Configuration Config = config;
|
protected readonly Configuration Config = config;
|
||||||
|
|
||||||
/// <summary> Add a new, empty option group of the given type and name. </summary>
|
/// <summary> Add a new, empty option group of the given type and name. </summary>
|
||||||
public TGroup? AddModGroup(Mod mod, string newName, SaveType saveType = SaveType.ImmediateSync)
|
public TGroup? AddModGroup(Mod mod, string newName, SaveType saveType = SaveType.ImmediateSync)
|
||||||
|
|
@ -25,7 +25,7 @@ public abstract class ModOptionEditor<TGroup, TOption>(
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var maxPriority = mod.Groups.Count == 0 ? ModPriority.Default : mod.Groups.Max(o => o.Priority) + 1;
|
var maxPriority = mod.Groups.Count == 0 ? ModPriority.Default : mod.Groups.Max(o => o.Priority) + 1;
|
||||||
var group = CreateGroup(mod, newName, maxPriority);
|
var group = CreateGroup(mod, newName, maxPriority);
|
||||||
mod.Groups.Add(group);
|
mod.Groups.Add(group);
|
||||||
SaveService.Save(saveType, new ModSaveGroup(group, Config.ReplaceNonAsciiOnImport));
|
SaveService.Save(saveType, new ModSaveGroup(group, Config.ReplaceNonAsciiOnImport));
|
||||||
Communicator.ModOptionChanged.Invoke(ModOptionChangeType.GroupAdded, mod, group, null, null, -1);
|
Communicator.ModOptionChanged.Invoke(ModOptionChangeType.GroupAdded, mod, group, null, null, -1);
|
||||||
|
|
@ -92,8 +92,8 @@ public abstract class ModOptionEditor<TGroup, TOption>(
|
||||||
/// <summary> Delete the given option from the given group. </summary>
|
/// <summary> Delete the given option from the given group. </summary>
|
||||||
public void DeleteOption(TOption option)
|
public void DeleteOption(TOption option)
|
||||||
{
|
{
|
||||||
var mod = option.Mod;
|
var mod = option.Mod;
|
||||||
var group = option.Group;
|
var group = option.Group;
|
||||||
var optionIdx = option.GetIndex();
|
var optionIdx = option.GetIndex();
|
||||||
Communicator.ModOptionChanged.Invoke(ModOptionChangeType.PrepareChange, mod, group, option, null, -1);
|
Communicator.ModOptionChanged.Invoke(ModOptionChangeType.PrepareChange, mod, group, option, null, -1);
|
||||||
RemoveOption((TGroup)group, optionIdx);
|
RemoveOption((TGroup)group, optionIdx);
|
||||||
|
|
@ -104,7 +104,7 @@ public abstract class ModOptionEditor<TGroup, TOption>(
|
||||||
/// <summary> Move an option inside the given option group. </summary>
|
/// <summary> Move an option inside the given option group. </summary>
|
||||||
public void MoveOption(TOption option, int optionIdxTo)
|
public void MoveOption(TOption option, int optionIdxTo)
|
||||||
{
|
{
|
||||||
var idx = option.GetIndex();
|
var idx = option.GetIndex();
|
||||||
var group = (TGroup)option.Group;
|
var group = (TGroup)option.Group;
|
||||||
if (!MoveOption(group, idx, optionIdxTo))
|
if (!MoveOption(group, idx, optionIdxTo))
|
||||||
return;
|
return;
|
||||||
|
|
@ -113,10 +113,10 @@ public abstract class ModOptionEditor<TGroup, TOption>(
|
||||||
Communicator.ModOptionChanged.Invoke(ModOptionChangeType.OptionMoved, group.Mod, group, option, null, idx);
|
Communicator.ModOptionChanged.Invoke(ModOptionChangeType.OptionMoved, group.Mod, group, option, null, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract TGroup CreateGroup(Mod mod, string newName, ModPriority priority, SaveType saveType = SaveType.ImmediateSync);
|
protected abstract TGroup CreateGroup(Mod mod, string newName, ModPriority priority, SaveType saveType = SaveType.ImmediateSync);
|
||||||
protected abstract TOption? CloneOption(TGroup group, IModOption option);
|
protected abstract TOption? CloneOption(TGroup group, IModOption option);
|
||||||
protected abstract void RemoveOption(TGroup group, int optionIndex);
|
protected abstract void RemoveOption(TGroup group, int optionIndex);
|
||||||
protected abstract bool MoveOption(TGroup group, int optionIdxFrom, int optionIdxTo);
|
protected abstract bool MoveOption(TGroup group, int optionIdxFrom, int optionIdxTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ModOptionChangeTypeExtension
|
public static class ModOptionChangeTypeExtension
|
||||||
|
|
@ -132,22 +132,22 @@ public static class ModOptionChangeTypeExtension
|
||||||
{
|
{
|
||||||
(requiresSaving, requiresReloading, wasPrepared) = type switch
|
(requiresSaving, requiresReloading, wasPrepared) = type switch
|
||||||
{
|
{
|
||||||
ModOptionChangeType.GroupRenamed => (true, false, false),
|
ModOptionChangeType.GroupRenamed => (true, false, false),
|
||||||
ModOptionChangeType.GroupAdded => (true, false, false),
|
ModOptionChangeType.GroupAdded => (true, false, false),
|
||||||
ModOptionChangeType.GroupDeleted => (true, true, false),
|
ModOptionChangeType.GroupDeleted => (true, true, false),
|
||||||
ModOptionChangeType.GroupMoved => (true, false, false),
|
ModOptionChangeType.GroupMoved => (true, false, false),
|
||||||
ModOptionChangeType.GroupTypeChanged => (true, true, true),
|
ModOptionChangeType.GroupTypeChanged => (true, true, true),
|
||||||
ModOptionChangeType.PriorityChanged => (true, true, true),
|
ModOptionChangeType.PriorityChanged => (true, true, true),
|
||||||
ModOptionChangeType.OptionAdded => (true, true, true),
|
ModOptionChangeType.OptionAdded => (true, true, true),
|
||||||
ModOptionChangeType.OptionDeleted => (true, true, false),
|
ModOptionChangeType.OptionDeleted => (true, true, false),
|
||||||
ModOptionChangeType.OptionMoved => (true, false, false),
|
ModOptionChangeType.OptionMoved => (true, false, false),
|
||||||
ModOptionChangeType.OptionFilesChanged => (false, true, false),
|
ModOptionChangeType.OptionFilesChanged => (false, true, false),
|
||||||
ModOptionChangeType.OptionFilesAdded => (false, true, true),
|
ModOptionChangeType.OptionFilesAdded => (false, true, true),
|
||||||
ModOptionChangeType.OptionSwapsChanged => (false, true, false),
|
ModOptionChangeType.OptionSwapsChanged => (false, true, false),
|
||||||
ModOptionChangeType.OptionMetaChanged => (false, true, false),
|
ModOptionChangeType.OptionMetaChanged => (false, true, false),
|
||||||
ModOptionChangeType.DisplayChange => (false, false, false),
|
ModOptionChangeType.DisplayChange => (false, false, false),
|
||||||
ModOptionChangeType.DefaultOptionChanged => (true, false, false),
|
ModOptionChangeType.DefaultOptionChanged => (true, false, false),
|
||||||
_ => (false, false, false),
|
_ => (false, false, false),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6,14 +6,14 @@ using Penumbra.Mods.Settings;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
||||||
namespace Penumbra.Mods.Manager;
|
namespace Penumbra.Mods.Manager.OptionEditor;
|
||||||
|
|
||||||
public sealed class MultiModGroupEditor(CommunicatorService communicator, SaveService saveService, Configuration config)
|
public sealed class MultiModGroupEditor(CommunicatorService communicator, SaveService saveService, Configuration config)
|
||||||
: ModOptionEditor<MultiModGroup, MultiSubMod>(communicator, saveService, config), IService
|
: ModOptionEditor<MultiModGroup, MultiSubMod>(communicator, saveService, config), IService
|
||||||
{
|
{
|
||||||
public void ChangeToSingle(MultiModGroup group)
|
public void ChangeToSingle(MultiModGroup group)
|
||||||
{
|
{
|
||||||
var idx = group.GetIndex();
|
var idx = group.GetIndex();
|
||||||
var singleGroup = group.ConvertToSingle();
|
var singleGroup = group.ConvertToSingle();
|
||||||
group.Mod.Groups[idx] = singleGroup;
|
group.Mod.Groups[idx] = singleGroup;
|
||||||
SaveService.QueueSave(new ModSaveGroup(group, Config.ReplaceNonAsciiOnImport));
|
SaveService.QueueSave(new ModSaveGroup(group, Config.ReplaceNonAsciiOnImport));
|
||||||
|
|
@ -34,7 +34,7 @@ public sealed class MultiModGroupEditor(CommunicatorService communicator, SaveSe
|
||||||
protected override MultiModGroup CreateGroup(Mod mod, string newName, ModPriority priority, SaveType saveType = SaveType.ImmediateSync)
|
protected override MultiModGroup CreateGroup(Mod mod, string newName, ModPriority priority, SaveType saveType = SaveType.ImmediateSync)
|
||||||
=> new(mod)
|
=> new(mod)
|
||||||
{
|
{
|
||||||
Name = newName,
|
Name = newName,
|
||||||
Priority = priority,
|
Priority = priority,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@ public sealed class MultiModGroupEditor(CommunicatorService communicator, SaveSe
|
||||||
|
|
||||||
var newOption = new MultiSubMod(group)
|
var newOption = new MultiSubMod(group)
|
||||||
{
|
{
|
||||||
Name = option.Name,
|
Name = option.Name,
|
||||||
Description = option.Description,
|
Description = option.Description,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -6,14 +6,14 @@ using Penumbra.Mods.Settings;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
||||||
namespace Penumbra.Mods.Manager;
|
namespace Penumbra.Mods.Manager.OptionEditor;
|
||||||
|
|
||||||
public sealed class SingleModGroupEditor(CommunicatorService communicator, SaveService saveService, Configuration config)
|
public sealed class SingleModGroupEditor(CommunicatorService communicator, SaveService saveService, Configuration config)
|
||||||
: ModOptionEditor<SingleModGroup, SingleSubMod>(communicator, saveService, config), IService
|
: ModOptionEditor<SingleModGroup, SingleSubMod>(communicator, saveService, config), IService
|
||||||
{
|
{
|
||||||
public void ChangeToMulti(SingleModGroup group)
|
public void ChangeToMulti(SingleModGroup group)
|
||||||
{
|
{
|
||||||
var idx = group.GetIndex();
|
var idx = group.GetIndex();
|
||||||
var multiGroup = group.ConvertToMulti();
|
var multiGroup = group.ConvertToMulti();
|
||||||
group.Mod.Groups[idx] = multiGroup;
|
group.Mod.Groups[idx] = multiGroup;
|
||||||
SaveService.QueueSave(new ModSaveGroup(group, Config.ReplaceNonAsciiOnImport));
|
SaveService.QueueSave(new ModSaveGroup(group, Config.ReplaceNonAsciiOnImport));
|
||||||
|
|
@ -23,7 +23,7 @@ public sealed class SingleModGroupEditor(CommunicatorService communicator, SaveS
|
||||||
protected override SingleModGroup CreateGroup(Mod mod, string newName, ModPriority priority, SaveType saveType = SaveType.ImmediateSync)
|
protected override SingleModGroup CreateGroup(Mod mod, string newName, ModPriority priority, SaveType saveType = SaveType.ImmediateSync)
|
||||||
=> new(mod)
|
=> new(mod)
|
||||||
{
|
{
|
||||||
Name = newName,
|
Name = newName,
|
||||||
Priority = priority,
|
Priority = priority,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -31,7 +31,7 @@ public sealed class SingleModGroupEditor(CommunicatorService communicator, SaveS
|
||||||
{
|
{
|
||||||
var newOption = new SingleSubMod(group)
|
var newOption = new SingleSubMod(group)
|
||||||
{
|
{
|
||||||
Name = option.Name,
|
Name = option.Name,
|
||||||
Description = option.Description,
|
Description = option.Description,
|
||||||
};
|
};
|
||||||
if (option is IModDataContainer data)
|
if (option is IModDataContainer data)
|
||||||
|
|
@ -3,7 +3,7 @@ using OtterGui.Filesystem;
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Mods.Editor;
|
using Penumbra.Mods.Editor;
|
||||||
using Penumbra.Mods.Groups;
|
using Penumbra.Mods.Groups;
|
||||||
using Penumbra.Mods.Manager;
|
using Penumbra.Mods.Manager.OptionEditor;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
|
|
||||||
namespace Penumbra.Mods.Settings;
|
namespace Penumbra.Mods.Settings;
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="EmbedIO" Version="3.4.3" />
|
<PackageReference Include="EmbedIO" Version="3.4.3" />
|
||||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.3" />
|
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.33.0" />
|
<PackageReference Include="SharpCompress" Version="0.33.0" />
|
||||||
<PackageReference Include="SharpGLTF.Core" Version="1.0.0-alpha0030" />
|
<PackageReference Include="SharpGLTF.Core" Version="1.0.0-alpha0030" />
|
||||||
<PackageReference Include="SharpGLTF.Toolkit" Version="1.0.0-alpha0030" />
|
<PackageReference Include="SharpGLTF.Toolkit" Version="1.0.0-alpha0030" />
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ using Penumbra.Mods;
|
||||||
using Penumbra.Mods.Groups;
|
using Penumbra.Mods.Groups;
|
||||||
using Penumbra.Mods.ItemSwap;
|
using Penumbra.Mods.ItemSwap;
|
||||||
using Penumbra.Mods.Manager;
|
using Penumbra.Mods.Manager;
|
||||||
|
using Penumbra.Mods.Manager.OptionEditor;
|
||||||
using Penumbra.Mods.Settings;
|
using Penumbra.Mods.Settings;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ using Penumbra.UI.AdvancedWindow;
|
||||||
using Penumbra.Mods.Groups;
|
using Penumbra.Mods.Groups;
|
||||||
using Penumbra.Mods.Settings;
|
using Penumbra.Mods.Settings;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
|
using Penumbra.Mods.Manager.OptionEditor;
|
||||||
|
|
||||||
namespace Penumbra.UI.ModsTab;
|
namespace Penumbra.UI.ModsTab;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,14 @@
|
||||||
},
|
},
|
||||||
"SixLabors.ImageSharp": {
|
"SixLabors.ImageSharp": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[3.1.3, )",
|
"requested": "[3.1.4, )",
|
||||||
"resolved": "3.1.3",
|
"resolved": "3.1.4",
|
||||||
"contentHash": "wybtaqZQ1ZRZ4ZeU+9h+PaSeV14nyiGKIy7qRbDfSHzHq4ybqyOcjoifeaYbiKLO1u+PVxLBuy7MF/DMmwwbfg=="
|
"contentHash": "lFIdxgGDA5iYkUMRFOze7BGLcdpoLFbR+a20kc1W7NepvzU7ejtxtWOg9RvgG7kb9tBoJ3ONYOK6kLil/dgF1w=="
|
||||||
|
},
|
||||||
|
"JetBrains.Annotations": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "2023.3.0",
|
||||||
|
"contentHash": "PHfnvdBUdGaTVG9bR/GEfxgTwWM0Z97Y6X3710wiljELBISipSfF5okn/vz+C2gfO+ihoEyVPjaJwn8ZalVukA=="
|
||||||
},
|
},
|
||||||
"Microsoft.Extensions.DependencyInjection": {
|
"Microsoft.Extensions.DependencyInjection": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
|
|
@ -75,6 +80,7 @@
|
||||||
"ottergui": {
|
"ottergui": {
|
||||||
"type": "Project",
|
"type": "Project",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"JetBrains.Annotations": "[2023.3.0, )",
|
||||||
"Microsoft.Extensions.DependencyInjection": "[8.0.0, )"
|
"Microsoft.Extensions.DependencyInjection": "[8.0.0, )"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -88,7 +94,7 @@
|
||||||
"type": "Project",
|
"type": "Project",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"OtterGui": "[1.0.0, )",
|
"OtterGui": "[1.0.0, )",
|
||||||
"Penumbra.Api": "[1.0.15, )",
|
"Penumbra.Api": "[5.0.0, )",
|
||||||
"Penumbra.String": "[1.0.4, )"
|
"Penumbra.String": "[1.0.4, )"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue