mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Set focus on detached advanced dyes when opening or toggling with buttons.
This commit is contained in:
parent
ab771fd010
commit
ad79d9cc07
1 changed files with 8 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ public sealed unsafe class AdvancedDyePopup(
|
||||||
private Actor _actor;
|
private Actor _actor;
|
||||||
private byte _selectedMaterial = byte.MaxValue;
|
private byte _selectedMaterial = byte.MaxValue;
|
||||||
private bool _anyChanged;
|
private bool _anyChanged;
|
||||||
|
private bool _forceFocus;
|
||||||
|
|
||||||
private const int RowsPerPage = 16;
|
private const int RowsPerPage = 16;
|
||||||
private int _rowOffset;
|
private int _rowOffset;
|
||||||
|
|
@ -70,6 +71,7 @@ public sealed unsafe class AdvancedDyePopup(
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Palette.ToIconString(), new Vector2(ImGui.GetFrameHeight()),
|
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Palette.ToIconString(), new Vector2(ImGui.GetFrameHeight()),
|
||||||
string.Empty, false, true))
|
string.Empty, false, true))
|
||||||
{
|
{
|
||||||
|
_forceFocus = true;
|
||||||
_selectedMaterial = byte.MaxValue;
|
_selectedMaterial = byte.MaxValue;
|
||||||
_drawIndex = isOpen ? null : index;
|
_drawIndex = isOpen ? null : index;
|
||||||
}
|
}
|
||||||
|
|
@ -195,6 +197,12 @@ public sealed unsafe class AdvancedDyePopup(
|
||||||
ImGui.SetNextWindowSize(new Vector2(width, height));
|
ImGui.SetNextWindowSize(new Vector2(width, height));
|
||||||
|
|
||||||
var window = ImGui.Begin("###Glamourer Advanced Dyes", flags);
|
var window = ImGui.Begin("###Glamourer Advanced Dyes", flags);
|
||||||
|
if (ImGui.IsWindowAppearing() || _forceFocus)
|
||||||
|
{
|
||||||
|
ImGui.SetWindowFocus();
|
||||||
|
_forceFocus = false;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (window)
|
if (window)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue