Better handling of sub-objects, better headers

This commit is contained in:
Exter-N 2023-03-23 13:47:36 +01:00
parent 045c84512f
commit 14eddac6f7
4 changed files with 109 additions and 46 deletions

View file

@ -64,11 +64,17 @@ public partial class ModEditWindow
_quickImportTrees ??= Array.Empty<ResourceTree>();
}
var textColorNonPlayer = ImGui.GetColorU32( ImGuiCol.Text );
var textColorPlayer = ( textColorNonPlayer & 0xFF000000u ) | ( ( textColorNonPlayer & 0x00FEFEFE ) >> 1 ) | 0x8000u; // Half green
foreach( var (tree, index) in _quickImportTrees.WithIndex() )
{
if( !ImGui.CollapsingHeader( $"{tree.Name}##{index}", ( index == 0 ) ? ImGuiTreeNodeFlags.DefaultOpen : 0 ) )
using( var c = ImRaii.PushColor( ImGuiCol.Text, tree.PlayerRelated ? textColorPlayer : textColorNonPlayer ) )
{
continue;
if( !ImGui.CollapsingHeader( $"{tree.Name}##{index}", ( index == 0 ) ? ImGuiTreeNodeFlags.DefaultOpen : 0 ) )
{
continue;
}
}
using var id = ImRaii.PushId( index );