protected override void LoadComplete() { base.LoadComplete(); CurrentBeatmap.BindValueChanged(setBeatmap, true); CurrentRuleset.BindValueChanged(setRuleset, true); }
private void load() { Container gameTypeContainer; InternalChild = new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(5f, 0f), LayoutDuration = 100, Children = new[] { rulesetContainer = new Container { AutoSizeAxes = Axes.Both, }, gameTypeContainer = new Container { AutoSizeAxes = Axes.Both, }, }, }; CurrentBeatmap.BindValueChanged(_ => updateBeatmap()); CurrentRuleset.BindValueChanged(_ => updateBeatmap(), true); Type.BindValueChanged(v => gameTypeContainer.Child = new DrawableGameType(v) { Size = new Vector2(height) }, true); }
private bool TryGetOsuFileLocation(CurrentBeatmap memoryBeatmap, out string osuFileLocation) { try { var songsLocation = _settings.GetFullSongsLocation(); osuFileLocation = Path.Combine(songsLocation, memoryBeatmap.FolderName, memoryBeatmap.OsuFileName); return(true); } catch (ArgumentException) { //we have garbage data in either FolderName or OsuFileName osuFileLocation = null; return(false); } }
public static void PauseOrResume() { if (_player.Isplaying) { _player.Pause(); NotifySystem.ClearText(); } else { if (_player.Position == -1.0) { return; } _player.Resume(); NotifySystem.SetText(CurrentBeatmap.NameToString()); } }
private void load() { LinkFlowContainer beatmapAuthor; InternalChild = new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, LayoutDuration = 100, Spacing = new Vector2(5, 0), Children = new Drawable[] { new ModeTypeInfo(), new Container { AutoSizeAxes = Axes.X, Height = 30, Margin = new MarginPadding { Left = 5 }, Children = new Drawable[] { new BeatmapTitle(), beatmapAuthor = new LinkFlowContainer(s => s.TextSize = 14) { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, AutoSizeAxes = Axes.Both }, }, }, } }; CurrentBeatmap.BindValueChanged(v => { beatmapAuthor.Clear(); if (v != null) { beatmapAuthor.AddText("mapped by ", s => s.Colour = OsuColour.Gray(0.8f)); beatmapAuthor.AddLink(v.Metadata.Author.Username, null, LinkAction.OpenUserProfile, v.Metadata.Author.Id.ToString(), "View Profile"); } }, true); }
public static void Play() { if (!CurrentSet.Detailed) { CurrentSet.GetDetail(); } if (!CurrentBeatmap.Detailed) { CurrentBeatmap.GetDetail(); } if (!File.Exists(CurrentBeatmap.Audio)) { NotifySystem.Showtip(1000, LanguageManager.Get("OSUplayer"), LanguageManager.Get("Core_Missing_MP3_Text")); return; } _player.Play(); NotifySystem.Showtip(1000, LanguageManager.Get("OSUplayer"), LanguageManager.Get("Core_Current_Playing_Text") + CurrentBeatmap.NameToString()); NotifySystem.SetText(CurrentBeatmap.NameToString()); }
private void load() { CurrentBeatmap.BindValueChanged(v => updateText(), true); }