mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-01-03 06:13:45 +01:00
Add option to pop out unlocks tab, add setting to stop hiding UI in cutscenes.
This commit is contained in:
parent
5d41b97831
commit
e2252066f1
4 changed files with 44 additions and 7 deletions
|
|
@ -27,8 +27,9 @@ public class Configuration : IPluginConfiguration, ISavable
|
|||
public bool HideApplyCheckmarks { get; set; } = false;
|
||||
public bool SmallEquip { get; set; } = false;
|
||||
public bool UnlockedItemMode { get; set; } = false;
|
||||
public byte DisableFestivals { get; set; } = 1;
|
||||
public byte DisableFestivals { get; set; } = 1;
|
||||
public bool EnableGameContextMenu { get; set; } = true;
|
||||
public bool HideWindowInCutscene { get; set; } = false;
|
||||
public MainWindow.TabType SelectedTab { get; set; } = MainWindow.TabType.Settings;
|
||||
public DoubleModifier DeleteDesignModifier { get; set; } = new(ModifierHotkey.Control, ModifierHotkey.Shift);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Glamourer.Gui.Tabs.UnlocksTab;
|
||||
|
||||
namespace Glamourer.Gui;
|
||||
|
||||
|
|
@ -11,15 +12,18 @@ public class GlamourerWindowSystem : IDisposable
|
|||
private readonly MainWindow _ui;
|
||||
private readonly PenumbraChangedItemTooltip _penumbraTooltip;
|
||||
|
||||
public GlamourerWindowSystem(UiBuilder uiBuilder, MainWindow ui, GenericPopupWindow popups, PenumbraChangedItemTooltip penumbraTooltip)
|
||||
public GlamourerWindowSystem(UiBuilder uiBuilder, MainWindow ui, GenericPopupWindow popups, PenumbraChangedItemTooltip penumbraTooltip,
|
||||
Configuration config, UnlocksTab unlocksTab)
|
||||
{
|
||||
_uiBuilder = uiBuilder;
|
||||
_ui = ui;
|
||||
_penumbraTooltip = penumbraTooltip;
|
||||
_windowSystem.AddWindow(ui);
|
||||
_windowSystem.AddWindow(popups);
|
||||
_uiBuilder.Draw += _windowSystem.Draw;
|
||||
_uiBuilder.OpenConfigUi += _ui.Toggle;
|
||||
_windowSystem.AddWindow(unlocksTab);
|
||||
_uiBuilder.Draw += _windowSystem.Draw;
|
||||
_uiBuilder.OpenConfigUi += _ui.Toggle;
|
||||
_uiBuilder.DisableCutsceneUiHide = !config.HideWindowInCutscene;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
@ -27,4 +31,4 @@ public class GlamourerWindowSystem : IDisposable
|
|||
_uiBuilder.Draw -= _windowSystem.Draw;
|
||||
_uiBuilder.OpenConfigUi -= _ui.Toggle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,10 @@ public class SettingsTab : ITab
|
|||
private readonly CodeService _codeService;
|
||||
private readonly PenumbraAutoRedraw _autoRedraw;
|
||||
private readonly ContextMenuService _contextMenuService;
|
||||
private readonly UiBuilder _uiBuilder;
|
||||
|
||||
public SettingsTab(Configuration config, DesignFileSystemSelector selector, StateListener stateListener,
|
||||
CodeService codeService, PenumbraAutoRedraw autoRedraw, ContextMenuService contextMenuService)
|
||||
CodeService codeService, PenumbraAutoRedraw autoRedraw, ContextMenuService contextMenuService, UiBuilder uiBuilder)
|
||||
{
|
||||
_config = config;
|
||||
_selector = selector;
|
||||
|
|
@ -32,6 +33,7 @@ public class SettingsTab : ITab
|
|||
_codeService = codeService;
|
||||
_autoRedraw = autoRedraw;
|
||||
_contextMenuService = contextMenuService;
|
||||
_uiBuilder = uiBuilder;
|
||||
}
|
||||
|
||||
public ReadOnlySpan<byte> Label
|
||||
|
|
@ -75,6 +77,13 @@ public class SettingsTab : ITab
|
|||
else
|
||||
_contextMenuService.Disable();
|
||||
});
|
||||
Checkbox("Hide Window in Cutscenes", "Whether the main Glamourer window should automatically be hidden when entering cutscenes or not.",
|
||||
_config.HideWindowInCutscene,
|
||||
v =>
|
||||
{
|
||||
_config.HideWindowInCutscene = v;
|
||||
_uiBuilder.DisableCutsceneUiHide = !v;
|
||||
});
|
||||
if (Widget.DoubleModifierSelector("Design Deletion Modifier",
|
||||
"A modifier you need to hold while clicking the Delete Design button for it to take effect.", 100 * ImGuiHelpers.GlobalScale,
|
||||
_config.DeleteDesignModifier, v => _config.DeleteDesignModifier = v))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Numerics;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using ImGuiNET;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui;
|
||||
|
|
@ -8,17 +9,25 @@ using OtterGui.Widgets;
|
|||
|
||||
namespace Glamourer.Gui.Tabs.UnlocksTab;
|
||||
|
||||
public class UnlocksTab : ITab
|
||||
public class UnlocksTab : Window, ITab
|
||||
{
|
||||
private readonly Configuration _config;
|
||||
private readonly UnlockOverview _overview;
|
||||
private readonly UnlockTable _table;
|
||||
|
||||
public UnlocksTab(Configuration config, UnlockOverview overview, UnlockTable table)
|
||||
: base("Unlocked Equipment")
|
||||
{
|
||||
_config = config;
|
||||
_overview = overview;
|
||||
_table = table;
|
||||
|
||||
IsOpen = false;
|
||||
SizeConstraints = new WindowSizeConstraints()
|
||||
{
|
||||
MinimumSize = new Vector2(700, 675),
|
||||
MaximumSize = ImGui.GetIO().DisplaySize,
|
||||
};
|
||||
}
|
||||
|
||||
private bool DetailMode
|
||||
|
|
@ -43,11 +52,18 @@ public class UnlocksTab : ITab
|
|||
_overview.Draw();
|
||||
}
|
||||
|
||||
public override void Draw()
|
||||
{
|
||||
DrawContent();
|
||||
}
|
||||
|
||||
private void DrawTypeSelection()
|
||||
{
|
||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero)
|
||||
.Push(ImGuiStyleVar.FrameRounding, 0);
|
||||
var buttonSize = new Vector2(ImGui.GetContentRegionAvail().X / 2, ImGui.GetFrameHeight());
|
||||
if (!IsOpen)
|
||||
buttonSize.X -= ImGui.GetFrameHeight() / 2;
|
||||
|
||||
if (ImGuiUtil.DrawDisabledButton("Overview Mode", buttonSize, "Show tinted icons of sets of unlocks.", !DetailMode))
|
||||
DetailMode = false;
|
||||
|
|
@ -56,5 +72,12 @@ public class UnlocksTab : ITab
|
|||
if (ImGuiUtil.DrawDisabledButton("Detailed Mode", buttonSize, "Show all unlockable data as a combined filterable and sortable table.",
|
||||
DetailMode))
|
||||
DetailMode = true;
|
||||
if (!IsOpen)
|
||||
{
|
||||
ImGui.SameLine();
|
||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.SquareArrowUpRight.ToIconString(), new Vector2(ImGui.GetFrameHeight()),
|
||||
"Pop the unlocks tab out into its own window.", false, true))
|
||||
IsOpen = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue