mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-25 01:49:19 +01:00
Add enable all for option groups
This commit is contained in:
parent
f37ad11ab8
commit
ff5e72e979
3 changed files with 23 additions and 3 deletions
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using Dalamud.Logging;
|
||||
using OtterGui.Classes;
|
||||
|
|
|
|||
|
|
@ -210,6 +210,28 @@ public partial class ConfigWindow
|
|||
}
|
||||
|
||||
Widget.EndFramedGroup();
|
||||
var label = $"##multi{groupIdx}";
|
||||
if( ImGui.IsItemClicked( ImGuiMouseButton.Right ) )
|
||||
{
|
||||
ImGui.OpenPopup( $"##multi{groupIdx}" );
|
||||
}
|
||||
|
||||
using var style = ImRaii.PushStyle( ImGuiStyleVar.PopupBorderSize, 1 );
|
||||
using var popup = ImRaii.Popup( label );
|
||||
if( popup )
|
||||
{
|
||||
ImGui.TextUnformatted( group.Name );
|
||||
ImGui.Separator();
|
||||
if( ImGui.Selectable( "Enable All" ) )
|
||||
{
|
||||
Penumbra.CollectionManager.Current.SetModSetting( _mod.Index, groupIdx, ( 1u << group.Count ) - 1u );
|
||||
}
|
||||
|
||||
if( ImGui.Selectable( "Disable All" ) )
|
||||
{
|
||||
Penumbra.CollectionManager.Current.SetModSetting( _mod.Index, groupIdx, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -78,7 +78,6 @@ public partial class ConfigWindow
|
|||
{
|
||||
using var color = ImRaii.PushColor( ImGuiCol.Button, Colors.PressEnterWarningBg );
|
||||
var w = new Vector2( width, 0 );
|
||||
var symbol = '\0';
|
||||
var (text, valid) = CheckPath( newName, old );
|
||||
|
||||
return ( ImGui.Button( text, w ) || saved ) && valid;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue