mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-21 15:27:51 +01:00
Make everything services.
This commit is contained in:
parent
cf1dcfcb7c
commit
e05dbe9885
81 changed files with 220 additions and 317 deletions
|
|
@ -3,6 +3,7 @@ using ImGuiNET;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
|
|
@ -24,7 +25,7 @@ using Penumbra.UI.Classes;
|
|||
|
||||
namespace Penumbra.UI.AdvancedWindow;
|
||||
|
||||
public class ItemSwapTab : IDisposable, ITab
|
||||
public class ItemSwapTab : IDisposable, ITab, IUiService
|
||||
{
|
||||
private readonly Configuration _config;
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using Dalamud.Plugin.Services;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.Communication;
|
||||
|
|
@ -32,7 +33,7 @@ using MdlMaterialEditor = Penumbra.Mods.Editor.MdlMaterialEditor;
|
|||
|
||||
namespace Penumbra.UI.AdvancedWindow;
|
||||
|
||||
public partial class ModEditWindow : Window, IDisposable
|
||||
public partial class ModEditWindow : Window, IDisposable, IUiService
|
||||
{
|
||||
private const string WindowBaseLabel = "###SubModEdit";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface.Utility;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Mods.SubMods;
|
||||
|
|
@ -9,7 +10,7 @@ using Penumbra.UI.Classes;
|
|||
|
||||
namespace Penumbra.UI.AdvancedWindow;
|
||||
|
||||
public class ModMergeTab(ModMerger modMerger)
|
||||
public class ModMergeTab(ModMerger modMerger) : IUiService
|
||||
{
|
||||
private readonly ModCombo _modCombo = new(() => modMerger.ModsWithoutCurrent.ToList());
|
||||
private string _newModName = string.Empty;
|
||||
|
|
@ -183,7 +184,7 @@ public class ModMergeTab(ModMerger modMerger)
|
|||
else
|
||||
{
|
||||
ImGuiUtil.DrawTableColumn(option.GetName());
|
||||
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
ImGui.Selectable(group.Name, false);
|
||||
if (ImGui.BeginPopupContextItem("##groupContext"))
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ using Lumina.Excel.GeneratedSheets;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
|
@ -19,7 +20,7 @@ using ApiChangedItemIcon = Penumbra.Api.Enums.ChangedItemIcon;
|
|||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
public class ChangedItemDrawer : IDisposable
|
||||
public class ChangedItemDrawer : IDisposable, IUiService
|
||||
{
|
||||
[Flags]
|
||||
public enum ChangedItemIcon : uint
|
||||
|
|
@ -99,8 +100,10 @@ public class ChangedItemDrawer : IDisposable
|
|||
|
||||
slot = 0;
|
||||
foreach (var (item, flag) in LowerNames.Zip(Order))
|
||||
{
|
||||
if (item.Contains(lowerInput, StringComparison.Ordinal))
|
||||
slot |= flag;
|
||||
}
|
||||
|
||||
return slot != 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
public class PenumbraChangelog
|
||||
public class PenumbraChangelog : IUiService
|
||||
{
|
||||
public const int LastChangelogVersion = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using ImGuiNET;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.Interop.PathResolving;
|
||||
|
|
@ -9,7 +10,7 @@ using Penumbra.UI.ModsTab;
|
|||
|
||||
namespace Penumbra.UI.Classes;
|
||||
|
||||
public class CollectionSelectHeader
|
||||
public class CollectionSelectHeader : IUiService
|
||||
{
|
||||
private readonly CollectionCombo _collectionCombo;
|
||||
private readonly ActiveCollections _activeCollections;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using ImGuiNET;
|
|||
using OtterGui;
|
||||
using OtterGui.Custom;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Services;
|
||||
|
|
@ -13,7 +14,7 @@ using Penumbra.Util;
|
|||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
public sealed class ConfigWindow : Window
|
||||
public sealed class ConfigWindow : Window, IUiService
|
||||
{
|
||||
private readonly DalamudPluginInterface _pluginInterface;
|
||||
private readonly Configuration _config;
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@ using Dalamud.Interface.ImGuiFileDialog;
|
|||
using Dalamud.Utility;
|
||||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Services;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
public class FileDialogService : IDisposable
|
||||
public class FileDialogService : IDisposable, IUiService
|
||||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly FileDialogManager _manager;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
using Dalamud.Interface.Windowing;
|
||||
using ImGuiNET;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Import.Structs;
|
||||
using Penumbra.Mods.Manager;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
/// <summary> Draw the progress information for import. </summary>
|
||||
public sealed class ImportPopup : Window
|
||||
public sealed class ImportPopup : Window, IUiService
|
||||
{
|
||||
public const string WindowLabel = "Penumbra Import Status";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface;
|
|||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Services;
|
||||
using OtterGui.Services;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
|
|
@ -9,7 +10,7 @@ namespace Penumbra.UI;
|
|||
/// A Launch Button used in the title screen of the game,
|
||||
/// using the Dalamud-provided collapsible submenu.
|
||||
/// </summary>
|
||||
public class LaunchButton : IDisposable
|
||||
public class LaunchButton : IDisposable, IUiService
|
||||
{
|
||||
private readonly ConfigWindow _configWindow;
|
||||
private readonly UiBuilder _uiBuilder;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using OtterGui.Classes;
|
|||
using OtterGui.Filesystem;
|
||||
using OtterGui.FileSystem.Selector;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
|
|
@ -21,7 +22,7 @@ using MessageService = Penumbra.Services.MessageService;
|
|||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSystemSelector.ModState>
|
||||
public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSystemSelector.ModState>, IUiService
|
||||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly MessageService _messager;
|
||||
|
|
@ -33,9 +34,9 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
|||
private readonly ModImportManager _modImportManager;
|
||||
private readonly IDragDropManager _dragDrop;
|
||||
private readonly ModSearchStringSplitter Filter = new();
|
||||
|
||||
public ModSettings SelectedSettings { get; private set; } = ModSettings.Empty;
|
||||
public ModCollection SelectedSettingCollection { get; private set; } = ModCollection.Empty;
|
||||
|
||||
public ModSettings SelectedSettings { get; private set; } = ModSettings.Empty;
|
||||
public ModCollection SelectedSettingCollection { get; private set; } = ModCollection.Empty;
|
||||
|
||||
|
||||
public ModFileSystemSelector(IKeyState keyState, CommunicatorService communicator, ModFileSystem fileSystem, ModManager modManager,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Plugin;
|
||||
using ImGuiNET;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.UI.AdvancedWindow;
|
||||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public class ModPanel : IDisposable
|
||||
public class ModPanel : IDisposable, IUiService
|
||||
{
|
||||
private readonly MultiModPanel _multiModPanel;
|
||||
private readonly ModFileSystemSelector _selector;
|
||||
|
|
|
|||
|
|
@ -2,39 +2,29 @@ using ImGuiNET;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public class ModPanelChangedItemsTab : ITab
|
||||
public class ModPanelChangedItemsTab(ModFileSystemSelector selector, ChangedItemDrawer drawer) : ITab, IUiService
|
||||
{
|
||||
private readonly ModFileSystemSelector _selector;
|
||||
private readonly ChangedItemDrawer _drawer;
|
||||
|
||||
private ChangedItemDrawer.ChangedItemIcon _filter = Enum.GetValues<ChangedItemDrawer.ChangedItemIcon>().Aggregate((a, b) => a | b);
|
||||
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Changed Items"u8;
|
||||
|
||||
public ModPanelChangedItemsTab(ModFileSystemSelector selector, ChangedItemDrawer drawer)
|
||||
{
|
||||
_selector = selector;
|
||||
_drawer = drawer;
|
||||
}
|
||||
|
||||
public bool IsVisible
|
||||
=> _selector.Selected!.ChangedItems.Count > 0;
|
||||
=> selector.Selected!.ChangedItems.Count > 0;
|
||||
|
||||
public void DrawContent()
|
||||
{
|
||||
_drawer.DrawTypeFilter();
|
||||
drawer.DrawTypeFilter();
|
||||
ImGui.Separator();
|
||||
using var table = ImRaii.Table("##changedItems", 1, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY,
|
||||
new Vector2(ImGui.GetContentRegionAvail().X, -1));
|
||||
if (!table)
|
||||
return;
|
||||
|
||||
var zipList = ZipList.FromSortedList((SortedList<string, object?>)_selector.Selected!.ChangedItems);
|
||||
var zipList = ZipList.FromSortedList((SortedList<string, object?>)selector.Selected!.ChangedItems);
|
||||
var height = ImGui.GetFrameHeightWithSpacing();
|
||||
ImGui.TableNextColumn();
|
||||
var skips = ImGuiClip.GetNecessarySkips(height);
|
||||
|
|
@ -43,14 +33,14 @@ public class ModPanelChangedItemsTab : ITab
|
|||
}
|
||||
|
||||
private bool CheckFilter((string Name, object? Data) kvp)
|
||||
=> _drawer.FilterChangedItem(kvp.Name, kvp.Data, LowerString.Empty);
|
||||
=> drawer.FilterChangedItem(kvp.Name, kvp.Data, LowerString.Empty);
|
||||
|
||||
private void DrawChangedItem((string Name, object? Data) kvp)
|
||||
{
|
||||
ImGui.TableNextColumn();
|
||||
_drawer.DrawCategoryIcon(kvp.Name, kvp.Data);
|
||||
drawer.DrawCategoryIcon(kvp.Name, kvp.Data);
|
||||
ImGui.SameLine();
|
||||
_drawer.DrawChangedItem(kvp.Name, kvp.Data);
|
||||
_drawer.DrawModelData(kvp.Data);
|
||||
drawer.DrawChangedItem(kvp.Name, kvp.Data);
|
||||
drawer.DrawModelData(kvp.Data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface.Utility;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
|
|
@ -10,25 +11,16 @@ using Penumbra.UI.Classes;
|
|||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public class ModPanelCollectionsTab : ITab
|
||||
public class ModPanelCollectionsTab(CollectionStorage storage, ModFileSystemSelector selector) : ITab, IUiService
|
||||
{
|
||||
private readonly ModFileSystemSelector _selector;
|
||||
private readonly CollectionStorage _collections;
|
||||
|
||||
private readonly List<(ModCollection, ModCollection, uint, string)> _cache = new();
|
||||
|
||||
public ModPanelCollectionsTab(CollectionStorage storage, ModFileSystemSelector selector)
|
||||
{
|
||||
_collections = storage;
|
||||
_selector = selector;
|
||||
}
|
||||
private readonly List<(ModCollection, ModCollection, uint, string)> _cache = [];
|
||||
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Collections"u8;
|
||||
|
||||
public void DrawContent()
|
||||
{
|
||||
var (direct, inherited) = CountUsage(_selector.Selected!);
|
||||
var (direct, inherited) = CountUsage(selector.Selected!);
|
||||
ImGui.NewLine();
|
||||
if (direct == 1)
|
||||
ImGui.TextUnformatted("This Mod is directly configured in 1 collection.");
|
||||
|
|
@ -80,7 +72,7 @@ public class ModPanelCollectionsTab : ITab
|
|||
var disInherited = ColorId.InheritedDisabledMod.Value();
|
||||
var directCount = 0;
|
||||
var inheritedCount = 0;
|
||||
foreach (var collection in _collections)
|
||||
foreach (var collection in storage)
|
||||
{
|
||||
var (settings, parent) = collection[mod.Index];
|
||||
var (color, text) = settings == null
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using Dalamud.Interface.Utility;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Text;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Collections.Cache;
|
||||
|
|
@ -16,7 +17,7 @@ using Penumbra.UI.Classes;
|
|||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSystemSelector selector) : ITab
|
||||
public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSystemSelector selector) : ITab, IUiService
|
||||
{
|
||||
private int? _currentPriority;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface.Utility;
|
|||
using ImGuiNET;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Mods.Manager;
|
||||
|
||||
|
|
@ -12,7 +13,7 @@ public class ModPanelDescriptionTab(
|
|||
TutorialService tutorial,
|
||||
ModManager modManager,
|
||||
PredefinedTagManager predefinedTagsConfig)
|
||||
: ITab
|
||||
: ITab, IUiService
|
||||
{
|
||||
private readonly TagButtons _localTags = new();
|
||||
private readonly TagButtons _modTags = new();
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ using OtterGui;
|
|||
using OtterGui.Raii;
|
||||
using OtterGui.Widgets;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.UI.AdvancedWindow;
|
||||
using Penumbra.Mods.Settings;
|
||||
using Penumbra.Mods.Manager.OptionEditor;
|
||||
using Penumbra.UI.ModsTab.Groups;
|
||||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
|
@ -31,7 +31,7 @@ public class ModPanelEditTab(
|
|||
ModGroupEditDrawer groupEditDrawer,
|
||||
DescriptionEditPopup descriptionPopup,
|
||||
AddGroupDrawer addGroupDrawer)
|
||||
: ITab
|
||||
: ITab, IUiService
|
||||
{
|
||||
private readonly TagButtons _modTags = new();
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Mods.Manager;
|
||||
|
|
@ -9,7 +10,7 @@ using Penumbra.UI.AdvancedWindow;
|
|||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public class ModPanelTabBar
|
||||
public class ModPanelTabBar : IUiService
|
||||
{
|
||||
private enum ModPanelTabType
|
||||
{
|
||||
|
|
@ -33,7 +34,7 @@ public class ModPanelTabBar
|
|||
|
||||
public readonly ITab[] Tabs;
|
||||
private ModPanelTabType _preferredTab = ModPanelTabType.Settings;
|
||||
private Mod? _lastMod = null;
|
||||
private Mod? _lastMod;
|
||||
|
||||
public ModPanelTabBar(ModEditWindow modEditWindow, ModPanelSettingsTab settings, ModPanelDescriptionTab description,
|
||||
ModPanelConflictsTab conflicts, ModPanelChangedItemsTab changedItems, ModPanelEditTab edit, ModManager modManager,
|
||||
|
|
@ -49,15 +50,15 @@ public class ModPanelTabBar
|
|||
_tutorial = tutorial;
|
||||
Collections = collections;
|
||||
|
||||
Tabs = new ITab[]
|
||||
{
|
||||
Tabs =
|
||||
[
|
||||
Settings,
|
||||
Description,
|
||||
Conflicts,
|
||||
ChangedItems,
|
||||
Collections,
|
||||
Edit,
|
||||
};
|
||||
];
|
||||
}
|
||||
|
||||
public void Draw(Mod mod)
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@ using Dalamud.Interface.Utility;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Mods.Manager;
|
||||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public class MultiModPanel(ModFileSystemSelector _selector, ModDataEditor _editor)
|
||||
public class MultiModPanel(ModFileSystemSelector _selector, ModDataEditor _editor) : IUiService
|
||||
{
|
||||
public void Draw()
|
||||
{
|
||||
|
|
@ -65,8 +66,8 @@ public class MultiModPanel(ModFileSystemSelector _selector, ModDataEditor _edito
|
|||
}
|
||||
|
||||
private string _tag = string.Empty;
|
||||
private readonly List<Mod> _addMods = [];
|
||||
private readonly List<(Mod, int)> _removeMods = [];
|
||||
private readonly List<Mod> _addMods = [];
|
||||
private readonly List<(Mod, int)> _removeMods = [];
|
||||
|
||||
private void DrawMultiTagger()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@ using Newtonsoft.Json.Linq;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.UI.Classes;
|
||||
using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
public sealed class PredefinedTagManager : ISavable, IReadOnlyList<string>
|
||||
public sealed class PredefinedTagManager : ISavable, IReadOnlyList<string>, IService
|
||||
{
|
||||
public const int Version = 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
|||
using FFXIVClientStructs.FFXIV.Client.System.Resource;
|
||||
using ImGuiNET;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
|
|
@ -15,7 +16,7 @@ using Penumbra.UI.Classes;
|
|||
|
||||
namespace Penumbra.UI.ResourceWatcher;
|
||||
|
||||
public sealed class ResourceWatcher : IDisposable, ITab
|
||||
public sealed class ResourceWatcher : IDisposable, ITab, IUiService
|
||||
{
|
||||
public const int DefaultMaxEntries = 1024;
|
||||
public const RecordType AllRecords = RecordType.Request | RecordType.ResourceLoad | RecordType.FileLoad | RecordType.Destruction;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using ImGuiNET;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections.Manager;
|
||||
|
|
@ -17,7 +18,7 @@ public class ChangedItemsTab(
|
|||
CollectionSelectHeader collectionHeader,
|
||||
ChangedItemDrawer drawer,
|
||||
CommunicatorService communicator)
|
||||
: ITab
|
||||
: ITab, IUiService
|
||||
{
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Changed Items"u8;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Game.ClientState.Objects;
|
|||
using Dalamud.Plugin;
|
||||
using ImGuiNET;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.GameData.Actors;
|
||||
|
|
@ -11,7 +12,7 @@ using Penumbra.UI.CollectionTab;
|
|||
|
||||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public sealed class CollectionsTab : IDisposable, ITab
|
||||
public sealed class CollectionsTab : IDisposable, ITab, IUiService
|
||||
{
|
||||
private readonly EphemeralConfig _config;
|
||||
private readonly CollectionSelector _selector;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using ImGuiNET;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Mods;
|
||||
|
|
@ -8,7 +9,7 @@ using Watcher = Penumbra.UI.ResourceWatcher.ResourceWatcher;
|
|||
|
||||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public class ConfigTabBar : IDisposable
|
||||
public class ConfigTabBar : IDisposable, IUiService
|
||||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ using Penumbra.Api.IpcTester;
|
|||
|
||||
namespace Penumbra.UI.Tabs.Debug;
|
||||
|
||||
public class Diagnostics(IServiceProvider provider)
|
||||
public class Diagnostics(ServiceManager provider) : IUiService
|
||||
{
|
||||
public void DrawDiagnostics()
|
||||
{
|
||||
|
|
@ -55,7 +55,7 @@ public class Diagnostics(IServiceProvider provider)
|
|||
foreach (var type in typeof(ActorManager).Assembly.GetTypes()
|
||||
.Where(t => t is { IsAbstract: false, IsInterface: false } && t.IsAssignableTo(typeof(IAsyncDataContainer))))
|
||||
{
|
||||
var container = (IAsyncDataContainer)provider.GetRequiredService(type);
|
||||
var container = (IAsyncDataContainer)provider.Provider!.GetRequiredService(type);
|
||||
ImGuiUtil.DrawTableColumn(container.Name);
|
||||
ImGuiUtil.DrawTableColumn(container.Time.ToString());
|
||||
ImGuiUtil.DrawTableColumn(Functions.HumanReadableSize(container.Memory));
|
||||
|
|
@ -64,7 +64,7 @@ public class Diagnostics(IServiceProvider provider)
|
|||
}
|
||||
}
|
||||
|
||||
public class DebugTab : Window, ITab
|
||||
public class DebugTab : Window, ITab, IUiService
|
||||
{
|
||||
private readonly PerformanceTracker _performance;
|
||||
private readonly Configuration _config;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using ImGuiNET;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Cache;
|
||||
|
|
@ -15,7 +16,7 @@ using Penumbra.UI.Classes;
|
|||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public class EffectiveTab(CollectionManager collectionManager, CollectionSelectHeader collectionHeader)
|
||||
: ITab
|
||||
: ITab, IUiService
|
||||
{
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Effective Changes"u8;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Services;
|
||||
|
||||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public class MessagesTab(MessageService messages) : ITab
|
||||
public class MessagesTab(MessageService messages) : ITab, IUiService
|
||||
{
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Messages"u8;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using Penumbra.UI.Classes;
|
|||
using Dalamud.Interface;
|
||||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Housing;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Interop.Services;
|
||||
|
|
@ -30,7 +31,7 @@ public class ModsTab(
|
|||
CollectionSelectHeader collectionHeader,
|
||||
ITargetManager targets,
|
||||
ObjectManager objects)
|
||||
: ITab
|
||||
: ITab, IUiService
|
||||
{
|
||||
private readonly ActiveCollections _activeCollections = collectionManager.Active;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.UI.AdvancedWindow;
|
||||
|
||||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public class OnScreenTab : ITab
|
||||
public class OnScreenTab(ResourceTreeViewerFactory resourceTreeViewerFactory) : ITab, IUiService
|
||||
{
|
||||
private readonly ResourceTreeViewer _viewer;
|
||||
|
||||
public OnScreenTab(ResourceTreeViewerFactory resourceTreeViewerFactory)
|
||||
{
|
||||
_viewer = resourceTreeViewerFactory.Create(0, delegate { }, delegate { });
|
||||
}
|
||||
private readonly ResourceTreeViewer _viewer = resourceTreeViewerFactory.Create(0, delegate { }, delegate { });
|
||||
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "On-Screen"u8;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using FFXIVClientStructs.STD;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Interop.ResourceLoading;
|
||||
using Penumbra.String.Classes;
|
||||
|
|
@ -13,7 +14,7 @@ using Penumbra.String.Classes;
|
|||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public class ResourceTab(Configuration config, ResourceManagerService resourceManager, ISigScanner sigScanner)
|
||||
: ITab
|
||||
: ITab, IUiService
|
||||
{
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Resource Manager"u8;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ using OtterGui;
|
|||
using OtterGui.Compression;
|
||||
using OtterGui.Custom;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Api;
|
||||
using Penumbra.Interop.Services;
|
||||
|
|
@ -19,7 +20,7 @@ using Penumbra.UI.ModsTab;
|
|||
|
||||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public class SettingsTab : ITab
|
||||
public class SettingsTab : ITab, IUiService
|
||||
{
|
||||
public const int RootDirectoryMaxLength = 64;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
|
|
@ -40,7 +41,7 @@ public enum BasicTutorialSteps
|
|||
}
|
||||
|
||||
/// <summary> Service for the in-game tutorial. </summary>
|
||||
public class TutorialService
|
||||
public class TutorialService : IUiService
|
||||
{
|
||||
public const string SelectedCollection = "Selected Collection";
|
||||
public const string DefaultCollection = "Base Collection";
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Plugin;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.UI.AdvancedWindow;
|
||||
using Penumbra.UI.Tabs.Debug;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
public class PenumbraWindowSystem : IDisposable
|
||||
public class PenumbraWindowSystem : IDisposable, IUiService
|
||||
{
|
||||
private readonly UiBuilder _uiBuilder;
|
||||
private readonly WindowSystem _windowSystem;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue