Convert top level skin editor layout to use grid container

Fix `SkinEditor`'s initial target not being a `Screen`
This commit is contained in:
Dean Herbert 2022-03-15 16:57:39 +09:00
parent 4525ed645c
commit 54e351efe9
1 changed files with 95 additions and 85 deletions

View File

@ -17,7 +17,6 @@
using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays;
using osu.Game.Rulesets.Edit;
using osu.Game.Screens.Edit.Components;
using osu.Game.Screens.Edit.Components.Menus;
@ -51,7 +50,7 @@ public class SkinEditor : VisibilityContainer
private Container content;
private EditorToolboxGroup settingsToolbox;
private EditorSidebarSection settingsToolbox;
public SkinEditor()
{
@ -72,7 +71,19 @@ private void load()
InternalChild = new OsuContextMenuContainer
{
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
Child = new GridContainer
{
RelativeSizeAxes = Axes.Both,
RowDimensions = new[]
{
new Dimension(GridSizeMode.AutoSize),
new Dimension(GridSizeMode.AutoSize),
new Dimension(),
},
Content = new[]
{
new Drawable[]
{
new Container
{
@ -112,12 +123,16 @@ private void load()
},
},
},
},
new Drawable[]
{
new SkinEditorSceneLibrary
{
RelativeSizeAxes = Axes.X,
Y = menu_height,
},
},
new Drawable[]
{
new GridContainer
{
RelativeSizeAxes = Axes.Both,
@ -143,6 +158,7 @@ private void load()
},
content = new Container
{
Depth = float.MaxValue,
RelativeSizeAxes = Axes.Both,
},
new EditorSidebar
@ -159,6 +175,8 @@ private void load()
}
}
}
},
}
}
};
}
@ -191,17 +209,9 @@ public void UpdateTargetScreen(Drawable targetScreen)
SelectedComponents.Clear();
Scheduler.AddOnce(loadBlueprintContainer);
Scheduler.AddOnce(populateSettings);
void loadBlueprintContainer()
{
content.Children = new Drawable[]
{
new SkinBlueprintContainer(targetScreen)
{
Margin = new MarginPadding { Top = 100 },
}
};
}
void loadBlueprintContainer() => content.Child = new SkinBlueprintContainer(targetScreen);
}
private void skinChanged()