mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-30 04:13:43 +01:00
60 lines
No EOL
1.7 KiB
C#
60 lines
No EOL
1.7 KiB
C#
using System;
|
|
using System.Numerics;
|
|
|
|
namespace Penumbra.UI;
|
|
|
|
public partial class SettingsInterface : IDisposable
|
|
{
|
|
private const float DefaultVerticalSpace = 20f;
|
|
|
|
private static readonly Vector2 AutoFillSize = new(-1, -1);
|
|
private static readonly Vector2 ZeroVector = new(0, 0);
|
|
|
|
private readonly Penumbra _penumbra;
|
|
|
|
private readonly ManageModsButton _manageModsButton;
|
|
private readonly SettingsMenu _menu;
|
|
|
|
public SettingsInterface( Penumbra penumbra )
|
|
{
|
|
_penumbra = penumbra;
|
|
_manageModsButton = new ManageModsButton( this );
|
|
_menu = new SettingsMenu( this );
|
|
|
|
Dalamud.PluginInterface.UiBuilder.DisableGposeUiHide = true;
|
|
Dalamud.PluginInterface.UiBuilder.Draw += Draw;
|
|
Dalamud.PluginInterface.UiBuilder.OpenConfigUi += OpenConfig;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
_manageModsButton.Dispose();
|
|
_menu.InstalledTab.Selector.Cache.Dispose();
|
|
Dalamud.PluginInterface.UiBuilder.Draw -= Draw;
|
|
Dalamud.PluginInterface.UiBuilder.OpenConfigUi -= OpenConfig;
|
|
}
|
|
|
|
private void OpenConfig()
|
|
=> _menu.Visible = true;
|
|
|
|
public void FlipVisibility()
|
|
=> _menu.Visible = !_menu.Visible;
|
|
|
|
public void MakeDebugTabVisible()
|
|
=> _menu.DebugTabVisible = true;
|
|
|
|
public void Draw()
|
|
{
|
|
_menu.Draw();
|
|
}
|
|
|
|
private void ReloadMods()
|
|
{
|
|
_menu.InstalledTab.Selector.ClearSelection();
|
|
Penumbra.ModManager.DiscoverMods( Penumbra.Config.ModDirectory );
|
|
_menu.InstalledTab.Selector.Cache.TriggerListReset();
|
|
}
|
|
|
|
public void ResetDefaultCollection()
|
|
=> _menu.CollectionsTab.UpdateDefaultIndex();
|
|
} |