mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-19 22:37:46 +01:00
This commit is contained in:
parent
9aa1121410
commit
fec7819bf2
118 changed files with 4849 additions and 4283 deletions
|
|
@ -1,25 +0,0 @@
|
|||
using ImSharp;
|
||||
using Luna;
|
||||
using Penumbra.Mods.Editor;
|
||||
|
||||
namespace Penumbra.Mods.Manager;
|
||||
|
||||
public class ModCombo(ModStorage modStorage) : SimpleFilterCombo<Mod>(SimpleFilterType.Regex), IUiService
|
||||
{
|
||||
protected readonly ModStorage ModStorage = modStorage;
|
||||
|
||||
public override StringU8 DisplayString(in Mod value)
|
||||
=> new(value.Name);
|
||||
|
||||
public override string FilterString(in Mod value)
|
||||
=> value.Name;
|
||||
|
||||
public override IEnumerable<Mod> GetBaseItems()
|
||||
=> ModStorage;
|
||||
}
|
||||
|
||||
public sealed class ModComboWithoutCurrent(ModStorage modStorage, ModMerger modMerger) : ModCombo(modStorage)
|
||||
{
|
||||
public override IEnumerable<Mod> GetBaseItems()
|
||||
=> ModStorage.Where(m => m != modMerger.MergeFromMod);
|
||||
}
|
||||
|
|
@ -1,12 +1,50 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using ImSharp;
|
||||
using Luna;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.UI.Classes;
|
||||
using Penumbra.UI.ModsTab;
|
||||
using Penumbra.UI.ModsTab.Selector;
|
||||
using FileSystemChangeType = OtterGui.Filesystem.FileSystemChangeType;
|
||||
|
||||
namespace Penumbra.Mods.Manager;
|
||||
|
||||
public sealed class ModTab : TwoPanelLayout, ITab<TabType>
|
||||
{
|
||||
public override ReadOnlySpan<byte> Label
|
||||
=> "Mods2"u8;
|
||||
|
||||
public ModTab(ModFileSystemDrawer drawer, ModPanel panel, CollectionSelectHeader collectionHeader)
|
||||
{
|
||||
LeftHeader = drawer.Header;
|
||||
LeftFooter = drawer.Footer;
|
||||
LeftPanel = drawer;
|
||||
RightPanel = panel;
|
||||
RightHeader = collectionHeader;
|
||||
}
|
||||
|
||||
public void DrawContent()
|
||||
=> Draw();
|
||||
|
||||
public TabType Identifier
|
||||
=> TabType.Mods;
|
||||
|
||||
protected override void SetSize(Vector2 newSize)
|
||||
{
|
||||
base.SetSize(newSize);
|
||||
((ModFileSystemDrawer)LeftPanel).Config.Ephemeral.CurrentModSelectorWidth = newSize.X / Im.Style.GlobalScale;
|
||||
}
|
||||
|
||||
protected override float MinimumWidth
|
||||
=> ((ModFileSystemDrawer)LeftPanel).Footer.Buttons.Count * Im.Style.FrameHeight;
|
||||
|
||||
protected override float MaximumWidth
|
||||
=> Im.Window.Width - 500 * Im.Style.GlobalScale;
|
||||
}
|
||||
|
||||
public sealed class ModFileSystem2 : BaseFileSystem, IDisposable, IRequiredService
|
||||
{
|
||||
private readonly Configuration _config;
|
||||
|
|
@ -14,7 +52,7 @@ public sealed class ModFileSystem2 : BaseFileSystem, IDisposable, IRequiredServi
|
|||
private readonly ModFileSystemSaver _saver;
|
||||
|
||||
public ModFileSystem2(Configuration config, CommunicatorService communicator, SaveService saveService, Logger log, ModStorage modStorage)
|
||||
: base("ModFileSystem", log)
|
||||
: base("ModFileSystem", log, true)
|
||||
{
|
||||
_config = config;
|
||||
_communicator = communicator;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ public sealed class ModFileSystemSaver(Logger log, BaseFileSystem fileSystem, Sa
|
|||
protected override string EmptyFoldersFile(FilenameService provider)
|
||||
=> provider.FileSystemEmptyFolders;
|
||||
|
||||
protected override string SelectionFile(FilenameService provider)
|
||||
=> provider.FileSystemSelectedNodes;
|
||||
|
||||
protected override string MigrationFile(FilenameService provider)
|
||||
=> provider.OldFilesystemFile;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
using Luna;
|
||||
|
||||
namespace Penumbra.Mods.Manager;
|
||||
|
||||
public readonly struct ImportDate : ISortMode
|
||||
{
|
||||
public ReadOnlySpan<byte> Name
|
||||
=> "Import Date (Older First)"u8;
|
||||
|
||||
public ReadOnlySpan<byte> Description
|
||||
=> "In each folder, sort all subfolders lexicographically, then sort all leaves using their import date."u8;
|
||||
|
||||
public IEnumerable<IFileSystemNode> GetChildren(IFileSystemFolder f)
|
||||
=> f.GetSubFolders().Cast<IFileSystemNode>().Concat(f.GetLeaves().OfType<IFileSystemData<Mod>>().OrderBy(l => l.Value.ImportDate));
|
||||
}
|
||||
|
||||
public readonly struct InverseImportDate : ISortMode
|
||||
{
|
||||
public ReadOnlySpan<byte> Name
|
||||
=> "Import Date (Newer First)"u8;
|
||||
|
||||
public ReadOnlySpan<byte> Description
|
||||
=> "In each folder, sort all subfolders lexicographically, then sort all leaves using their inverse import date."u8;
|
||||
|
||||
public IEnumerable<IFileSystemNode> GetChildren(IFileSystemFolder f)
|
||||
=> f.GetSubFolders().Cast<IFileSystemNode>()
|
||||
.Concat(f.GetLeaves().OfType<IFileSystemData<Mod>>().OrderByDescending(l => l.Value.ImportDate));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue