mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 15:12:57 +08:00
Improve song select display on ultrawide displays (or when UI scale is set low)
This commit is contained in:
parent
f5b280971f
commit
f8cb898516
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
private const float shear_width = 36.75f;
|
private const float shear_width = 36.75f;
|
||||||
|
|
||||||
private static readonly Vector2 wedged_container_shear = new Vector2(shear_width / SongSelect.WEDGED_CONTAINER_SIZE.Y, 0);
|
private static readonly Vector2 wedged_container_shear = new Vector2(shear_width / SongSelect.WEDGE_HEIGHT, 0);
|
||||||
|
|
||||||
private readonly IBindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
private readonly IBindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
public abstract class SongSelect : OsuScreen, IKeyBindingHandler<GlobalAction>
|
public abstract class SongSelect : OsuScreen, IKeyBindingHandler<GlobalAction>
|
||||||
{
|
{
|
||||||
public static readonly Vector2 WEDGED_CONTAINER_SIZE = new Vector2(0.5f, 245);
|
public static readonly float WEDGE_HEIGHT = 245;
|
||||||
|
|
||||||
protected const float BACKGROUND_BLUR = 20;
|
protected const float BACKGROUND_BLUR = 20;
|
||||||
private const float left_area_padding = 20;
|
private const float left_area_padding = 20;
|
||||||
@ -88,13 +88,15 @@ namespace osu.Game.Screens.Select
|
|||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
private MusicController music { get; set; }
|
private MusicController music { get; set; }
|
||||||
|
|
||||||
|
private const float panel_overflow = 1.2f;
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuColour colours, SkinManager skins, ScoreManager scores)
|
private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuColour colours, SkinManager skins, ScoreManager scores)
|
||||||
{
|
{
|
||||||
// initial value transfer is required for FilterControl (it uses our re-cached bindables in its async load for the initial filter).
|
// initial value transfer is required for FilterControl (it uses our re-cached bindables in its async load for the initial filter).
|
||||||
transferRulesetValue();
|
transferRulesetValue();
|
||||||
|
|
||||||
AddRangeInternal(new Drawable[]
|
AddRangeInternal(new[]
|
||||||
{
|
{
|
||||||
new ParallaxContainer
|
new ParallaxContainer
|
||||||
{
|
{
|
||||||
@ -107,27 +109,61 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Padding = new MarginPadding { Right = -150 },
|
Padding = new MarginPadding { Right = -150 },
|
||||||
Size = new Vector2(WEDGED_CONTAINER_SIZE.X, 1),
|
Size = new Vector2(0.5f, 1),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Container
|
new GridContainer // used for max width implementation
|
||||||
{
|
{
|
||||||
Origin = Anchor.BottomLeft,
|
|
||||||
Anchor = Anchor.BottomLeft,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Size = new Vector2(WEDGED_CONTAINER_SIZE.X, 1),
|
ColumnDimensions = new[]
|
||||||
Padding = new MarginPadding
|
|
||||||
{
|
{
|
||||||
Bottom = Footer.HEIGHT,
|
new Dimension(GridSizeMode.Relative, 0.5f, maxSize: 650),
|
||||||
Top = WEDGED_CONTAINER_SIZE.Y + left_area_padding,
|
|
||||||
Left = left_area_padding,
|
|
||||||
Right = left_area_padding * 2,
|
|
||||||
},
|
},
|
||||||
Child = BeatmapDetails = new BeatmapDetailArea
|
Content = new[]
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
new Drawable[]
|
||||||
Padding = new MarginPadding { Top = 10, Right = 5 },
|
{
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
beatmapInfoWedge = new BeatmapInfoWedge
|
||||||
|
{
|
||||||
|
Height = WEDGE_HEIGHT,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Margin = new MarginPadding
|
||||||
|
{
|
||||||
|
Top = left_area_padding,
|
||||||
|
Right = left_area_padding,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Padding = new MarginPadding
|
||||||
|
{
|
||||||
|
Bottom = Footer.HEIGHT,
|
||||||
|
Top = WEDGE_HEIGHT + left_area_padding,
|
||||||
|
Left = left_area_padding,
|
||||||
|
Right = left_area_padding * 2,
|
||||||
|
},
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
BeatmapDetails = new BeatmapDetailArea
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Padding = new MarginPadding { Top = 10, Right = 5 },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
@ -136,13 +172,13 @@ namespace osu.Game.Screens.Select
|
|||||||
Masking = true,
|
Masking = true,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Width = 2, //avoid horizontal masking so the panels don't clip when screen stack is pushed.
|
Width = panel_overflow, //avoid horizontal masking so the panels don't clip when screen stack is pushed.
|
||||||
Child = new Container
|
Child = new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Width = 0.5f,
|
Width = 1 / panel_overflow,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
@ -153,15 +189,33 @@ namespace osu.Game.Screens.Select
|
|||||||
Top = FilterControl.HEIGHT,
|
Top = FilterControl.HEIGHT,
|
||||||
Bottom = Footer.HEIGHT
|
Bottom = Footer.HEIGHT
|
||||||
},
|
},
|
||||||
Child = Carousel = new BeatmapCarousel
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
new GridContainer // used for max width implementation
|
||||||
Size = new Vector2(1 - WEDGED_CONTAINER_SIZE.X, 1),
|
{
|
||||||
Anchor = Anchor.CentreRight,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Origin = Anchor.CentreRight,
|
ColumnDimensions = new[]
|
||||||
SelectionChanged = updateSelectedBeatmap,
|
{
|
||||||
BeatmapSetsChanged = carouselBeatmapsLoaded,
|
new Dimension(),
|
||||||
},
|
new Dimension(GridSizeMode.Relative, 0.5f, maxSize: 850),
|
||||||
|
},
|
||||||
|
Content = new[]
|
||||||
|
{
|
||||||
|
new Drawable[]
|
||||||
|
{
|
||||||
|
null,
|
||||||
|
Carousel = new BeatmapCarousel
|
||||||
|
{
|
||||||
|
Anchor = Anchor.CentreRight,
|
||||||
|
Origin = Anchor.CentreRight,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
SelectionChanged = updateSelectedBeatmap,
|
||||||
|
BeatmapSetsChanged = carouselBeatmapsLoaded,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
FilterControl = new FilterControl
|
FilterControl = new FilterControl
|
||||||
{
|
{
|
||||||
@ -173,21 +227,12 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
beatmapInfoWedge = new BeatmapInfoWedge
|
|
||||||
{
|
|
||||||
Size = WEDGED_CONTAINER_SIZE,
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Margin = new MarginPadding
|
|
||||||
{
|
|
||||||
Top = left_area_padding,
|
|
||||||
Right = left_area_padding,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
new ResetScrollContainer(() => Carousel.ScrollToSelected())
|
new ResetScrollContainer(() => Carousel.ScrollToSelected())
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = 250,
|
Width = 250,
|
||||||
}
|
},
|
||||||
|
beatmapInfoWedge.CreateProxy()
|
||||||
});
|
});
|
||||||
|
|
||||||
if (ShowFooter)
|
if (ShowFooter)
|
||||||
|
Loading…
Reference in New Issue
Block a user