private void load() { normalPathColour = Color4Extensions.FromHex("#66D1FF"); losersPathColour = Color4Extensions.FromHex("#FFC700"); RelativeSizeAxes = Axes.Both; InternalChild = Content = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new TourneyVideo("ladder") { RelativeSizeAxes = Axes.Both, Loop = true, }, new DrawableTournamentHeaderText { Y = 100, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, }, ScrollContent = new LadderDragContainer { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { paths = new Container <Path> { RelativeSizeAxes = Axes.Both }, headings = new Container { RelativeSizeAxes = Axes.Both }, MatchesContainer = new Container <DrawableTournamentMatch> { RelativeSizeAxes = Axes.Both }, } }, } }; void addMatch(TournamentMatch match) => MatchesContainer.Add(new DrawableTournamentMatch(match, this is LadderEditorScreen) { Changed = () => layout.Invalidate() }); foreach (var match in LadderInfo.Matches) { addMatch(match); } LadderInfo.Rounds.CollectionChanged += (_, __) => layout.Invalidate(); LadderInfo.Matches.CollectionChanged += (_, args) => { switch (args.Action) { case NotifyCollectionChangedAction.Add: foreach (var p in args.NewItems.Cast <TournamentMatch>()) { addMatch(p); } break; case NotifyCollectionChangedAction.Remove: foreach (var p in args.OldItems.Cast <TournamentMatch>()) { foreach (var d in MatchesContainer.Where(d => d.Match == p)) { d.Expire(); } } break; } layout.Invalidate(); }; }
private void load(OsuColour colours, Storage storage) { normalPathColour = colours.BlueDarker.Darken(2); losersPathColour = colours.YellowDarker.Darken(2); RelativeSizeAxes = Axes.Both; InternalChild = Content = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new TourneyVideo(storage.GetStream(@"BG Side Logo - OWC.m4v")) { RelativeSizeAxes = Axes.Both, Loop = true, }, ScrollContent = new LadderDragContainer { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { paths = new Container <Path> { RelativeSizeAxes = Axes.Both }, headings = new Container { RelativeSizeAxes = Axes.Both }, MatchesContainer = new Container <DrawableTournamentMatch> { RelativeSizeAxes = Axes.Both }, } }, } }; void addMatch(TournamentMatch match) => MatchesContainer.Add(new DrawableTournamentMatch(match, this is LadderEditorScreen) { Changed = () => layout.Invalidate() }); foreach (var match in LadderInfo.Matches) { addMatch(match); } LadderInfo.Rounds.ItemsAdded += _ => layout.Invalidate(); LadderInfo.Rounds.ItemsRemoved += _ => layout.Invalidate(); LadderInfo.Matches.ItemsAdded += matches => { foreach (var p in matches) { addMatch(p); } layout.Invalidate(); }; LadderInfo.Matches.ItemsRemoved += matches => { foreach (var p in matches) { foreach (var d in MatchesContainer.Where(d => d.Match == p)) { d.Expire(); } } layout.Invalidate(); }; }
private void load(OsuColour colours, Storage storage) { normalPathColour = colours.BlueDarker.Darken(2); losersPathColour = colours.YellowDarker.Darken(2); RelativeSizeAxes = Axes.Both; InternalChild = Content = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new TourneyVideo(storage.GetStream(@"videos/ladder.m4v")) { RelativeSizeAxes = Axes.Both, Loop = true, }, ScrollContent = new LadderDragContainer { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { paths = new Container <Path> { RelativeSizeAxes = Axes.Both }, headings = new Container { RelativeSizeAxes = Axes.Both }, MatchesContainer = new Container <DrawableTournamentMatch> { RelativeSizeAxes = Axes.Both }, } }, } }; void addMatch(TournamentMatch match) => MatchesContainer.Add(new DrawableTournamentMatch(match, this is LadderEditorScreen) { Changed = () => layout.Invalidate() }); foreach (var match in LadderInfo.Matches) { addMatch(match); } LadderInfo.Rounds.CollectionChanged += (_, __) => layout.Invalidate(); LadderInfo.Matches.CollectionChanged += (_, args) => { switch (args.Action) { case NotifyCollectionChangedAction.Add: foreach (var p in args.NewItems.Cast <TournamentMatch>()) { addMatch(p); } break; case NotifyCollectionChangedAction.Remove: foreach (var p in args.OldItems.Cast <TournamentMatch>()) { foreach (var d in MatchesContainer.Where(d => d.Match == p)) { d.Expire(); } } break; } layout.Invalidate(); }; }