Reorder collections tab.

This commit is contained in:
Ottermandias 2022-06-12 15:15:03 +02:00
parent 46c5d52a92
commit 1f46b4951e
2 changed files with 31 additions and 37 deletions

@ -1 +1 @@
Subproject commit 0bd85ed72057b1941579d20a6f622cc2cd9c58ac Subproject commit f48a4eccc654ec1ab1b72aa23324bdce13615f97

View file

@ -27,8 +27,8 @@ public partial class ConfigWindow
return; return;
} }
DrawMainSelectors();
DrawCharacterCollectionSelectors(); DrawCharacterCollectionSelectors();
DrawMainSelectors();
} }
@ -139,52 +139,46 @@ public partial class ConfigWindow
private void DrawCharacterCollectionSelectors() private void DrawCharacterCollectionSelectors()
{ {
using var child = ImRaii.Child( "##Collections", -Vector2.One, true ); ImGui.Dummy( _window._defaultSpace );
if( !child ) if( ImGui.CollapsingHeader( "Active Collections", ImGuiTreeNodeFlags.DefaultOpen ) )
{ {
return; ImGui.Dummy( _window._defaultSpace );
} DrawDefaultCollectionSelector();
ImGui.Dummy( _window._defaultSpace );
DrawDefaultCollectionSelector(); foreach( var name in Penumbra.CollectionManager.Characters.Keys.OrderBy( k => k ).ToArray() )
foreach( var name in Penumbra.CollectionManager.Characters.Keys.OrderBy( k => k ).ToArray() )
{
using var id = ImRaii.PushId( name );
DrawCollectionSelector( string.Empty, _window._inputTextWidth.X, ModCollection.Type.Character, true, name );
ImGui.SameLine();
if( ImGuiUtil.DrawDisabledButton( FontAwesomeIcon.Trash.ToIconString(), _window._iconButtonSize, string.Empty,
false,
true ) )
{ {
Penumbra.CollectionManager.RemoveCharacterCollection( name ); using var id = ImRaii.PushId( name );
DrawCollectionSelector( string.Empty, _window._inputTextWidth.X, ModCollection.Type.Character, true, name );
ImGui.SameLine();
if( ImGuiUtil.DrawDisabledButton( FontAwesomeIcon.Trash.ToIconString(), _window._iconButtonSize, string.Empty,
false,
true ) )
{
Penumbra.CollectionManager.RemoveCharacterCollection( name );
}
ImGui.SameLine();
ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted( name );
} }
ImGui.SameLine(); DrawNewCharacterCollection();
ImGui.AlignTextToFramePadding(); ImGui.NewLine();
ImGui.TextUnformatted( name );
} }
DrawNewCharacterCollection();
} }
private void DrawMainSelectors() private void DrawMainSelectors()
{ {
var size = new Vector2( -1, ImGui.Dummy( _window._defaultSpace );
ImGui.GetTextLineHeightWithSpacing() * (InheritedCollectionHeight + 1) if( ImGui.CollapsingHeader( "Collection Settings", ImGuiTreeNodeFlags.DefaultOpen ) )
+ _window._defaultSpace.Y * 2
+ ImGui.GetFrameHeightWithSpacing() * 4
+ ImGui.GetStyle().ItemSpacing.Y * 6 );
using var main = ImRaii.Child( "##CollectionsMain", size, true );
if( !main )
{ {
return; ImGui.Dummy( _window._defaultSpace );
DrawCurrentCollectionSelector();
ImGui.Dummy( _window._defaultSpace );
DrawNewCollectionInput();
ImGui.Dummy( _window._defaultSpace );
DrawInheritanceBlock();
} }
DrawCurrentCollectionSelector();
ImGui.Dummy( _window._defaultSpace );
DrawNewCollectionInput();
ImGui.Dummy( _window._defaultSpace );
DrawInheritanceBlock();
} }
} }
} }