mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-20 06:47:46 +01:00
Fix dummy situation for group settings.
This commit is contained in:
parent
76fc235cb7
commit
e6fce32975
2 changed files with 14 additions and 18 deletions
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
||||||
Subproject commit 77ecf97a620e20a1bd65d2e76c784f6f569f4643
|
Subproject commit 79237e1ed87dbad96bc6b7bd259b59c99975355d
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Linq;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
|
|
@ -61,19 +62,24 @@ public partial class ConfigWindow
|
||||||
|
|
||||||
if( _mod.Groups.Count > 0 )
|
if( _mod.Groups.Count > 0 )
|
||||||
{
|
{
|
||||||
ImGui.Dummy( _window._defaultSpace );
|
var useDummy = true;
|
||||||
for( var idx = 0; idx < _mod.Groups.Count; ++idx )
|
foreach(var (group, idx) in _mod.Groups.WithIndex().Where(g => g.Value.Type == GroupType.Single && g.Value.IsOption ))
|
||||||
{
|
{
|
||||||
DrawSingleGroup( _mod.Groups[ idx ], idx );
|
ImGuiUtil.Dummy( _window._defaultSpace, useDummy );
|
||||||
|
useDummy = false;
|
||||||
|
DrawSingleGroup( group, idx );
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Dummy( _window._defaultSpace );
|
useDummy = true;
|
||||||
for( var idx = 0; idx < _mod.Groups.Count; ++idx )
|
foreach( var (group, idx) in _mod.Groups.WithIndex().Where( g => g.Value.Type == GroupType.Multi && g.Value.IsOption ) )
|
||||||
{
|
{
|
||||||
DrawMultiGroup( _mod.Groups[ idx ], idx );
|
ImGuiUtil.Dummy( _window._defaultSpace, useDummy );
|
||||||
|
useDummy = false;
|
||||||
|
DrawMultiGroup( group, idx );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui.Dummy( _window._defaultSpace );
|
||||||
_window._penumbra.Api.InvokePostSettingsPanel( _mod.ModPath.Name );
|
_window._penumbra.Api.InvokePostSettingsPanel( _mod.ModPath.Name );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -159,13 +165,8 @@ public partial class ConfigWindow
|
||||||
// If a description is provided, add a help marker besides it.
|
// If a description is provided, add a help marker besides it.
|
||||||
private void DrawSingleGroup( IModGroup group, int groupIdx )
|
private void DrawSingleGroup( IModGroup group, int groupIdx )
|
||||||
{
|
{
|
||||||
if( group.Type != GroupType.Single || !group.IsOption )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using var id = ImRaii.PushId( groupIdx );
|
using var id = ImRaii.PushId( groupIdx );
|
||||||
var selectedOption = _emptySetting ? (int) group.DefaultSettings : ( int )_settings.Settings[ groupIdx ];
|
var selectedOption = _emptySetting ? ( int )group.DefaultSettings : ( int )_settings.Settings[ groupIdx ];
|
||||||
ImGui.SetNextItemWidth( _window._inputTextWidth.X * 3 / 4 );
|
ImGui.SetNextItemWidth( _window._inputTextWidth.X * 3 / 4 );
|
||||||
using var combo = ImRaii.Combo( string.Empty, group[ selectedOption ].Name );
|
using var combo = ImRaii.Combo( string.Empty, group[ selectedOption ].Name );
|
||||||
if( combo )
|
if( combo )
|
||||||
|
|
@ -198,11 +199,6 @@ public partial class ConfigWindow
|
||||||
// If a description is provided, add a help marker in the title.
|
// If a description is provided, add a help marker in the title.
|
||||||
private void DrawMultiGroup( IModGroup group, int groupIdx )
|
private void DrawMultiGroup( IModGroup group, int groupIdx )
|
||||||
{
|
{
|
||||||
if( group.Type != GroupType.Multi || !group.IsOption )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using var id = ImRaii.PushId( groupIdx );
|
using var id = ImRaii.PushId( groupIdx );
|
||||||
var flags = _emptySetting ? group.DefaultSettings : _settings.Settings[ groupIdx ];
|
var flags = _emptySetting ? group.DefaultSettings : _settings.Settings[ groupIdx ];
|
||||||
Widget.BeginFramedGroup( group.Name, group.Description );
|
Widget.BeginFramedGroup( group.Name, group.Description );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue