mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-30 04:13:43 +01:00
Make identically named options selectable, fix crash after deleting options.
This commit is contained in:
parent
f15c20a999
commit
e9b12da97e
3 changed files with 20 additions and 5 deletions
|
|
@ -168,10 +168,13 @@ public partial class ConfigWindow
|
|||
{
|
||||
for( var idx2 = 0; idx2 < group.Count; ++idx2 )
|
||||
{
|
||||
id.Push( idx2 );
|
||||
if( ImGui.Selectable( group[ idx2 ].Name, idx2 == selectedOption ) )
|
||||
{
|
||||
Penumbra.CollectionManager.Current.SetModSetting( _mod.Index, groupIdx, ( uint )idx2 );
|
||||
}
|
||||
|
||||
id.Pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -201,6 +204,7 @@ public partial class ConfigWindow
|
|||
Widget.BeginFramedGroup( group.Name, group.Description );
|
||||
for( var idx2 = 0; idx2 < group.Count; ++idx2 )
|
||||
{
|
||||
id.Push( idx2 );
|
||||
var flag = 1u << idx2;
|
||||
var setting = ( flags & flag ) != 0;
|
||||
if( ImGui.Checkbox( group[ idx2 ].Name, ref setting ) )
|
||||
|
|
@ -208,6 +212,8 @@ public partial class ConfigWindow
|
|||
flags = setting ? flags | flag : flags & ~flag;
|
||||
Penumbra.CollectionManager.Current.SetModSetting( _mod.Index, groupIdx, flags );
|
||||
}
|
||||
|
||||
id.Pop();
|
||||
}
|
||||
|
||||
Widget.EndFramedGroup();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue