Fix missing updates for OtterGui.

This commit is contained in:
Ottermandias 2025-08-02 00:13:35 +02:00
parent baca3cdec2
commit 8527bfa29c
3 changed files with 11 additions and 13 deletions

View file

@ -37,11 +37,11 @@ public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable, ISer
public struct ImportDate : ISortMode<Mod> public struct ImportDate : ISortMode<Mod>
{ {
public string Name public ReadOnlySpan<byte> Name
=> "Import Date (Older First)"; => "Import Date (Older First)"u8;
public string Description public ReadOnlySpan<byte> Description
=> "In each folder, sort all subfolders lexicographically, then sort all leaves using their import date."; => "In each folder, sort all subfolders lexicographically, then sort all leaves using their import date."u8;
public IEnumerable<IPath> GetChildren(Folder f) public IEnumerable<IPath> GetChildren(Folder f)
=> f.GetSubFolders().Cast<IPath>().Concat(f.GetLeaves().OrderBy(l => l.Value.ImportDate)); => f.GetSubFolders().Cast<IPath>().Concat(f.GetLeaves().OrderBy(l => l.Value.ImportDate));
@ -49,11 +49,11 @@ public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable, ISer
public struct InverseImportDate : ISortMode<Mod> public struct InverseImportDate : ISortMode<Mod>
{ {
public string Name public ReadOnlySpan<byte> Name
=> "Import Date (Newer First)"; => "Import Date (Newer First)"u8;
public string Description public ReadOnlySpan<byte> Description
=> "In each folder, sort all subfolders lexicographically, then sort all leaves using their inverse import date."; => "In each folder, sort all subfolders lexicographically, then sort all leaves using their inverse import date."u8;
public IEnumerable<IPath> GetChildren(Folder f) public IEnumerable<IPath> GetChildren(Folder f)
=> f.GetSubFolders().Cast<IPath>().Concat(f.GetLeaves().OrderByDescending(l => l.Value.ImportDate)); => f.GetSubFolders().Cast<IPath>().Concat(f.GetLeaves().OrderByDescending(l => l.Value.ImportDate));

View file

@ -1,8 +1,6 @@
using ImSharp;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using OtterGui.Extensions; using OtterGui.Extensions;
using Penumbra.Mods.Groups; using Penumbra.Mods.Groups;
using Penumbra.Mods.Settings;
namespace Penumbra.Mods.SubMods; namespace Penumbra.Mods.SubMods;

View file

@ -509,19 +509,19 @@ public class SettingsTab : ITab, IUiService
{ {
var sortMode = _config.SortMode; var sortMode = _config.SortMode;
ImGui.SetNextItemWidth(UiHelpers.InputTextWidth.X); ImGui.SetNextItemWidth(UiHelpers.InputTextWidth.X);
using (var combo = ImRaii.Combo("##sortMode", sortMode.Name)) using (var combo = ImUtf8.Combo("##sortMode", sortMode.Name))
{ {
if (combo) if (combo)
foreach (var val in Configuration.Constants.ValidSortModes) foreach (var val in Configuration.Constants.ValidSortModes)
{ {
if (ImGui.Selectable(val.Name, val.GetType() == sortMode.GetType()) && val.GetType() != sortMode.GetType()) if (ImUtf8.Selectable(val.Name, val.GetType() == sortMode.GetType()) && val.GetType() != sortMode.GetType())
{ {
_config.SortMode = val; _config.SortMode = val;
_selector.SetFilterDirty(); _selector.SetFilterDirty();
_config.Save(); _config.Save();
} }
ImGuiUtil.HoverTooltip(val.Description); ImUtf8.HoverTooltip(val.Description);
} }
} }