mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 15:23:14 +08:00
Add background behind editor toolbox groups
This commit is contained in:
parent
0f4a2a6059
commit
4d99c7002b
@ -8,6 +8,8 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.Extensions.LocalisationExtensions;
|
using osu.Framework.Extensions.LocalisationExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
@ -52,20 +54,33 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[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,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = 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 },
|
Colour = colourProvider.Background5,
|
||||||
KeyboardStep = adjust_step,
|
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,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -12,10 +12,12 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Extensions.EnumExtensions;
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Rulesets.Configuration;
|
using osu.Game.Rulesets.Configuration;
|
||||||
using osu.Game.Rulesets.Edit.Tools;
|
using osu.Game.Rulesets.Edit.Tools;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
@ -80,7 +82,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load(OverlayColourProvider colourProvider)
|
||||||
{
|
{
|
||||||
Config = Dependencies.Get<IRulesetConfigCache>().GetConfigFor(Ruleset);
|
Config = Dependencies.Get<IRulesetConfigCache>().GetConfigFor(Ruleset);
|
||||||
|
|
||||||
@ -116,25 +118,37 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
.WithChild(BlueprintContainer = CreateBlueprintContainer())
|
.WithChild(BlueprintContainer = CreateBlueprintContainer())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new ExpandingToolboxContainer(90, 200)
|
new Container
|
||||||
{
|
{
|
||||||
Padding = new MarginPadding(10),
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
AutoSizeAxes = Axes.X,
|
||||||
Children = new Drawable[]
|
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,
|
new EditorToolboxGroup("toolbox (1-9)")
|
||||||
AutoSizeAxes = Axes.Y,
|
{
|
||||||
Direction = FillDirection.Vertical,
|
Child = toolboxCollection = new EditorRadioButtonCollection { RelativeSizeAxes = Axes.X }
|
||||||
Spacing = new Vector2(0, 5),
|
},
|
||||||
},
|
new EditorToolboxGroup("toggles (Q~P)")
|
||||||
}
|
{
|
||||||
|
Child = togglesCollection = new FillFlowContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
Spacing = new Vector2(0, 5),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user