1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

Add background behind editor toolbox groups

This commit is contained in:
Dean Herbert 2022-10-13 16:33:01 +09:00
parent 0f4a2a6059
commit 4d99c7002b
2 changed files with 50 additions and 21 deletions

View File

@ -8,6 +8,8 @@ using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
@ -52,20 +54,33 @@ namespace osu.Game.Rulesets.Edit
}
[BackgroundDependencyLoader]
private void load()
private void load(OverlayColourProvider colourProvider)
{
AddInternal(RightSideToolboxContainer = new ExpandingToolboxContainer(130, 250)
AddInternal(new Container
{
Padding = new MarginPadding(10),
Alpha = DistanceSpacingMultiplier.Disabled ? 0 : 1,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Child = new EditorToolboxGroup("snapping")
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Children = new Drawable[]
{
Child = distanceSpacingSlider = new ExpandableSlider<double, SizeSlider<double>>
new Box
{
Current = { BindTarget = DistanceSpacingMultiplier },
KeyboardStep = adjust_step,
Colour = colourProvider.Background5,
RelativeSizeAxes = Axes.Both,
},
RightSideToolboxContainer = new ExpandingToolboxContainer(130, 250)
{
Padding = new MarginPadding(10),
Alpha = DistanceSpacingMultiplier.Disabled ? 0 : 1,
Child = new EditorToolboxGroup("snapping")
{
Child = distanceSpacingSlider = new ExpandableSlider<double, SizeSlider<double>>
{
Current = { BindTarget = DistanceSpacingMultiplier },
KeyboardStep = adjust_step,
}
}
}
}
});

View File

@ -12,10 +12,12 @@ using osu.Framework.Bindables;
using osu.Framework.Extensions.EnumExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Framework.Logging;
using osu.Game.Beatmaps;
using osu.Game.Overlays;
using osu.Game.Rulesets.Configuration;
using osu.Game.Rulesets.Edit.Tools;
using osu.Game.Rulesets.Mods;
@ -80,7 +82,7 @@ namespace osu.Game.Rulesets.Edit
dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
[BackgroundDependencyLoader]
private void load()
private void load(OverlayColourProvider colourProvider)
{
Config = Dependencies.Get<IRulesetConfigCache>().GetConfigFor(Ruleset);
@ -116,25 +118,37 @@ namespace osu.Game.Rulesets.Edit
.WithChild(BlueprintContainer = CreateBlueprintContainer())
}
},
new ExpandingToolboxContainer(90, 200)
new Container
{
Padding = new MarginPadding(10),
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Children = new Drawable[]
{
new EditorToolboxGroup("toolbox (1-9)")
new Box
{
Child = toolboxCollection = new EditorRadioButtonCollection { RelativeSizeAxes = Axes.X }
Colour = colourProvider.Background5,
RelativeSizeAxes = Axes.Both,
},
new EditorToolboxGroup("toggles (Q~P)")
new ExpandingToolboxContainer(60, 200)
{
Child = togglesCollection = new FillFlowContainer
Children = new Drawable[]
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5),
},
}
new EditorToolboxGroup("toolbox (1-9)")
{
Child = toolboxCollection = new EditorRadioButtonCollection { RelativeSizeAxes = Axes.X }
},
new EditorToolboxGroup("toggles (Q~P)")
{
Child = togglesCollection = new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5),
},
}
}
},
}
},
};