private void load(BindableBeatmap beatmap, OsuGame osu, AudioManager audio, Bindable <RulesetInfo> ruleset) { Beatmap.BindTo(beatmap); Ruleset.BindTo(ruleset); sampleExit = audio.Sample.Get(@"UI/screen-back"); }
private void load(BindableBeatmap beatmap, OsuGame osu, AudioManager audio, Bindable <RulesetInfo> ruleset) { if (beatmap != null) { Beatmap.BindTo(beatmap); } if (ruleset != null) { Ruleset.BindTo(ruleset); } if (osu != null) { OverlayActivationMode.BindTo(osu.OverlayActivationMode); updateOverlayStates = () => { if (HideOverlaysOnEnter) { osu.CloseAllOverlays(); } else { osu.Toolbar.State = Visibility.Visible; } }; } sampleExit = audio.Sample.Get(@"UI/screen-back"); }
private void load(OsuColour colours, BindableBeatmap beatmap, BeatmapManager beatmaps) { this.beatmap.BindTo(beatmap); this.beatmaps = beatmaps; Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, CornerRadius = 5, Masking = true, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Colour = Color4.Black.Opacity(40), Radius = 5, }, Children = new Drawable[] { new Box { Colour = colours.Gray3, RelativeSizeAxes = Axes.Both, }, list = new PlaylistList { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = 95, Bottom = 10, Right = 10 }, Selected = itemSelected, OrderChanged = (s, i) => OrderChanged?.Invoke(s, i) }, filter = new FilterControl { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, ExitRequested = () => State = Visibility.Hidden, FilterChanged = search => list.Filter(search), Padding = new MarginPadding(10), }, }, }, }; filter.Search.OnCommit = (sender, newText) => { BeatmapInfo toSelect = list.FirstVisibleSet?.Beatmaps?.FirstOrDefault(); if (toSelect != null) { beatmap.Value = beatmaps.GetWorkingBeatmap(toSelect); beatmap.Value.Track.Restart(); } }; }
public BeatmapDisplay(BeatmapInfo beatmap, BindableBeatmap beatmapBindable) { this.beatmap = beatmap; this.beatmapBindable = beatmapBindable; AutoSizeAxes = Axes.Both; InternalChild = text = new OsuSpriteText(); this.beatmapBindable.ValueChanged += beatmapChanged; }
public BeatmapList(Ruleset ruleset, BindableBeatmap beatmapBindable) { this.ruleset = ruleset; this.beatmapBindable = beatmapBindable; RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; InternalChild = beatmapDisplays = new FillFlowContainer <BeatmapDisplay> { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Spacing = new Vector2(0, 4) }; }
private async Task load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game, BindableBeatmap beatmap) { this.beatmap.BindTo(beatmap); menuVoice = config.GetBindable <bool>(OsuSetting.MenuVoice); menuMusic = config.GetBindable <bool>(OsuSetting.MenuMusic); BeatmapSetInfo setInfo = null; if (!menuMusic) { var sets = beatmaps.GetAllUsableBeatmapSets(); if (sets.Count > 0) { setInfo = beatmaps.QueryBeatmapSet(s => s.ID == sets[RNG.Next(0, sets.Count - 1)].ID); } } if (setInfo == null) { setInfo = beatmaps.QueryBeatmapSet(b => b.Hash == menu_music_beatmap_hash); if (setInfo == null) { // we need to import the default menu background beatmap setInfo = beatmaps.Import(new ZipArchiveReader(game.Resources.GetStream(@"Tracks/circles.osz"), "circles.osz")); setInfo.Protected = true; beatmaps.Update(setInfo); } } introBeatmap = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]); track = introBeatmap.Track; welcome = await audio.Sample.GetAsync(@"welcome"); seeya = await audio.Sample.GetAsync(@"seeya"); }
private void load(BindableBeatmap beatmap, BeatmapManager beatmaps, OsuColour colours, LocalisationEngine localisation) { this.beatmap.BindTo(beatmap); this.beatmaps = beatmaps; this.localisation = localisation; Children = new Drawable[] { dragContainer = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] { playlist = new PlaylistOverlay { RelativeSizeAxes = Axes.X, Y = player_height + 10, OrderChanged = playlistOrderChanged }, playerContainer = new Container { RelativeSizeAxes = Axes.X, Height = player_height, Masking = true, CornerRadius = 5, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Colour = Color4.Black.Opacity(40), Radius = 5, }, Children = new[] { background = new Background(), title = new OsuSpriteText { Origin = Anchor.BottomCentre, Anchor = Anchor.TopCentre, Position = new Vector2(0, 40), TextSize = 25, Colour = Color4.White, Text = @"Nothing to play", Font = @"Exo2.0-MediumItalic" }, artist = new OsuSpriteText { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Position = new Vector2(0, 45), TextSize = 15, Colour = Color4.White, Text = @"Nothing to play", Font = @"Exo2.0-BoldItalic" }, new Container { Padding = new MarginPadding { Bottom = progress_height }, Height = bottom_black_area_height, RelativeSizeAxes = Axes.X, Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, Children = new Drawable[] { new FillFlowContainer <IconButton> { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(5), Origin = Anchor.Centre, Anchor = Anchor.Centre, Children = new[] { prevButton = new IconButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, Action = prev, Icon = FontAwesome.fa_step_backward, }, playButton = new IconButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, Scale = new Vector2(1.4f), IconScale = new Vector2(1.4f), Action = play, Icon = FontAwesome.fa_play_circle_o, }, nextButton = new IconButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, Action = () => next(), Icon = FontAwesome.fa_step_forward, }, } }, playlistButton = new IconButton { Origin = Anchor.Centre, Anchor = Anchor.CentreRight, Position = new Vector2(-bottom_black_area_height / 2, 0), Icon = FontAwesome.fa_bars, Action = () => playlist.ToggleVisibility(), }, } }, progressBar = new ProgressBar { Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, Height = progress_height, FillColour = colours.Yellow, OnSeek = progress => current?.Track.Seek(progress) } }, }, } } }; beatmapSets = beatmaps.GetAllUsableBeatmapSets(); beatmaps.ItemAdded += handleBeatmapAdded; beatmaps.ItemRemoved += handleBeatmapRemoved; playlist.StateChanged += s => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, Easing.OutQuint); }