mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Merge branch 'master' into MissingSource
This commit is contained in:
@ -13,9 +13,9 @@ using osu.Framework.MathUtils;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Caching;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Beatmaps;
|
||||
@ -37,7 +37,7 @@ namespace osu.Game.Screens.Select
|
||||
/// </summary>
|
||||
public BeatmapInfo SelectedBeatmap => selectedBeatmap?.Beatmap;
|
||||
|
||||
private CarouselBeatmap selectedBeatmap => selectedBeatmapSet?.Beatmaps.FirstOrDefault(s => s.State == CarouselItemState.Selected);
|
||||
private CarouselBeatmap selectedBeatmap => selectedBeatmapSet?.Beatmaps.FirstOrDefault(s => s.State.Value == CarouselItemState.Selected);
|
||||
|
||||
/// <summary>
|
||||
/// The currently selected beatmap set.
|
||||
@ -130,7 +130,7 @@ namespace osu.Game.Screens.Select
|
||||
config.BindWith(OsuSetting.RandomSelectAlgorithm, RandomAlgorithm);
|
||||
config.BindWith(OsuSetting.SongSelectRightMouseScroll, RightClickScrollingEnabled);
|
||||
|
||||
RightClickScrollingEnabled.ValueChanged += v => RightMouseScrollbar = v;
|
||||
RightClickScrollingEnabled.ValueChanged += enabled => RightMouseScrollbar = enabled.NewValue;
|
||||
RightClickScrollingEnabled.TriggerChange();
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
foreach (CarouselBeatmapSet set in beatmapSets)
|
||||
{
|
||||
if (!bypassFilters && set.Filtered)
|
||||
if (!bypassFilters && set.Filtered.Value)
|
||||
continue;
|
||||
|
||||
var item = set.Beatmaps.FirstOrDefault(p => p.Beatmap.Equals(beatmap));
|
||||
@ -205,9 +205,9 @@ namespace osu.Game.Screens.Select
|
||||
// The beatmap that needs to be selected doesn't exist in this set
|
||||
continue;
|
||||
|
||||
if (!bypassFilters && item.Filtered)
|
||||
if (!bypassFilters && item.Filtered.Value)
|
||||
// The beatmap exists in this set but is filtered, so look for the first unfiltered map in the set
|
||||
item = set.Beatmaps.FirstOrDefault(b => !b.Filtered);
|
||||
item = set.Beatmaps.FirstOrDefault(b => !b.Filtered.Value);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
@ -226,7 +226,7 @@ namespace osu.Game.Screens.Select
|
||||
/// <param name="skipDifficulties">Whether to skip individual difficulties and only increment over full groups.</param>
|
||||
public void SelectNext(int direction = 1, bool skipDifficulties = true)
|
||||
{
|
||||
var visibleItems = Items.Where(s => !s.Item.Filtered).ToList();
|
||||
var visibleItems = Items.Where(s => !s.Item.Filtered.Value).ToList();
|
||||
|
||||
if (!visibleItems.Any())
|
||||
return;
|
||||
@ -248,7 +248,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
var item = visibleItems[currentIndex].Item;
|
||||
|
||||
if (item.Filtered || item.State == CarouselItemState.Selected) continue;
|
||||
if (item.Filtered.Value || item.State.Value == CarouselItemState.Selected) continue;
|
||||
|
||||
switch (item)
|
||||
{
|
||||
@ -260,7 +260,7 @@ namespace osu.Game.Screens.Select
|
||||
if (skipDifficulties)
|
||||
select(set);
|
||||
else
|
||||
select(direction > 0 ? set.Beatmaps.First(b => !b.Filtered) : set.Beatmaps.Last(b => !b.Filtered));
|
||||
select(direction > 0 ? set.Beatmaps.First(b => !b.Filtered.Value) : set.Beatmaps.Last(b => !b.Filtered.Value));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -272,7 +272,7 @@ namespace osu.Game.Screens.Select
|
||||
/// <returns>True if a selection could be made, else False.</returns>
|
||||
public bool SelectNextRandom()
|
||||
{
|
||||
var visibleSets = beatmapSets.Where(s => !s.Filtered).ToList();
|
||||
var visibleSets = beatmapSets.Where(s => !s.Filtered.Value).ToList();
|
||||
if (!visibleSets.Any())
|
||||
return false;
|
||||
|
||||
@ -288,7 +288,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
CarouselBeatmapSet set;
|
||||
|
||||
if (RandomAlgorithm == RandomSelectAlgorithm.RandomPermutation)
|
||||
if (RandomAlgorithm.Value == RandomSelectAlgorithm.RandomPermutation)
|
||||
{
|
||||
var notYetVisitedSets = visibleSets.Except(previouslyVisitedRandomSets).ToList();
|
||||
if (!notYetVisitedSets.Any())
|
||||
@ -303,7 +303,7 @@ namespace osu.Game.Screens.Select
|
||||
else
|
||||
set = visibleSets.ElementAt(RNG.Next(visibleSets.Count));
|
||||
|
||||
var visibleBeatmaps = set.Beatmaps.Where(s => !s.Filtered).ToList();
|
||||
var visibleBeatmaps = set.Beatmaps.Where(s => !s.Filtered.Value).ToList();
|
||||
select(visibleBeatmaps[RNG.Next(visibleBeatmaps.Count)]);
|
||||
return true;
|
||||
}
|
||||
@ -314,9 +314,9 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
var beatmap = randomSelectedBeatmaps.Pop();
|
||||
|
||||
if (!beatmap.Filtered)
|
||||
if (!beatmap.Filtered.Value)
|
||||
{
|
||||
if (RandomAlgorithm == RandomSelectAlgorithm.RandomPermutation)
|
||||
if (RandomAlgorithm.Value == RandomSelectAlgorithm.RandomPermutation)
|
||||
previouslyVisitedRandomSets.Remove(selectedBeatmapSet);
|
||||
select(beatmap);
|
||||
break;
|
||||
@ -509,9 +509,9 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
foreach (var c in set.Beatmaps)
|
||||
{
|
||||
c.State.ValueChanged += v =>
|
||||
c.State.ValueChanged += state =>
|
||||
{
|
||||
if (v == CarouselItemState.Selected)
|
||||
if (state.NewValue == CarouselItemState.Selected)
|
||||
{
|
||||
selectedBeatmapSet = set;
|
||||
SelectionChanged?.Invoke(c.Beatmap);
|
||||
@ -549,7 +549,7 @@ namespace osu.Game.Screens.Select
|
||||
case DrawableCarouselBeatmapSet set:
|
||||
lastSet = set;
|
||||
|
||||
set.MoveToX(set.Item.State == CarouselItemState.Selected ? -100 : 0, 500, Easing.OutExpo);
|
||||
set.MoveToX(set.Item.State.Value == CarouselItemState.Selected ? -100 : 0, 500, Easing.OutExpo);
|
||||
set.MoveToY(currentY, 750, Easing.OutExpo);
|
||||
break;
|
||||
case DrawableCarouselBeatmap beatmap:
|
||||
@ -559,7 +559,7 @@ namespace osu.Game.Screens.Select
|
||||
void performMove(float y, float? startY = null)
|
||||
{
|
||||
if (startY != null) beatmap.MoveTo(new Vector2(0, startY.Value));
|
||||
beatmap.MoveToX(beatmap.Item.State == CarouselItemState.Selected ? -50 : 0, 500, Easing.OutExpo);
|
||||
beatmap.MoveToX(beatmap.Item.State.Value == CarouselItemState.Selected ? -50 : 0, 500, Easing.OutExpo);
|
||||
beatmap.MoveToY(y, 750, Easing.OutExpo);
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -27,7 +27,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private void invokeOnFilter()
|
||||
{
|
||||
OnFilter?.Invoke(tabs.Current, modsCheckbox.Current);
|
||||
OnFilter?.Invoke(tabs.Current.Value, modsCheckbox.Current.Value);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -69,8 +69,8 @@ namespace osu.Game.Screens.Select
|
||||
},
|
||||
};
|
||||
|
||||
tabs.Current.ValueChanged += item => invokeOnFilter();
|
||||
modsCheckbox.Current.ValueChanged += item => invokeOnFilter();
|
||||
tabs.Current.ValueChanged += _ => invokeOnFilter();
|
||||
modsCheckbox.Current.ValueChanged += _ => invokeOnFilter();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@ using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Game.Screens.Select.Details;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
@ -137,8 +138,7 @@ namespace osu.Game.Screens.Select
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = "Points of Failure",
|
||||
Font = @"Exo2.0-Bold",
|
||||
TextSize = 14,
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 14),
|
||||
},
|
||||
failRetryGraph = new FailRetryGraph
|
||||
{
|
||||
@ -325,8 +325,7 @@ namespace osu.Game.Screens.Select
|
||||
Child = new OsuSpriteText
|
||||
{
|
||||
Text = title,
|
||||
Font = @"Exo2.0-Bold",
|
||||
TextSize = 14,
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 14),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -353,7 +352,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private void setTextAsync(string text)
|
||||
{
|
||||
LoadComponentAsync(new OsuTextFlowContainer(s => s.TextSize = 14)
|
||||
LoadComponentAsync(new OsuTextFlowContainer(s => s.Font = s.Font.With(size: 14))
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
|
@ -8,7 +8,7 @@ using JetBrains.Annotations;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
@ -203,9 +203,8 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
VersionLabel = new OsuSpriteText
|
||||
{
|
||||
Font = @"Exo2.0-MediumItalic",
|
||||
Text = beatmapInfo.Version,
|
||||
TextSize = 24,
|
||||
Font = OsuFont.GetFont(size: 24, italics: true),
|
||||
},
|
||||
}
|
||||
},
|
||||
@ -240,13 +239,11 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
TitleLabel = new OsuSpriteText
|
||||
{
|
||||
Font = @"Exo2.0-MediumItalic",
|
||||
TextSize = 28,
|
||||
Font = OsuFont.GetFont(size: 28, italics: true),
|
||||
},
|
||||
ArtistLabel = new OsuSpriteText
|
||||
{
|
||||
Font = @"Exo2.0-MediumItalic",
|
||||
TextSize = 17,
|
||||
Font = OsuFont.GetFont(size: 17, italics: true),
|
||||
},
|
||||
MapperContainer = new FillFlowContainer
|
||||
{
|
||||
@ -266,8 +263,8 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
};
|
||||
|
||||
titleBinding.BindValueChanged(value => setMetadata(metadata.Source));
|
||||
artistBinding.BindValueChanged(value => setMetadata(metadata.Source), true);
|
||||
titleBinding.BindValueChanged(_ => setMetadata(metadata.Source));
|
||||
artistBinding.BindValueChanged(_ => setMetadata(metadata.Source), true);
|
||||
|
||||
// no difficulty means it can't have a status to show
|
||||
if (beatmapInfo.Version == null)
|
||||
@ -345,16 +342,13 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Font = @"Exo2.0-Medium",
|
||||
Text = "mapped by ",
|
||||
TextSize = 15,
|
||||
Font = OsuFont.GetFont(size: 15),
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Font = @"Exo2.0-Bold",
|
||||
// ReSharper disable once PossibleNullReferenceException (resharper broken?)
|
||||
Text = metadata.Author.Username,
|
||||
TextSize = 15,
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 15),
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -402,10 +396,9 @@ namespace osu.Game.Screens.Select
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Colour = new Color4(255, 221, 85, 255),
|
||||
Font = @"Exo2.0-Bold",
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 17),
|
||||
Margin = new MarginPadding { Left = 30 },
|
||||
Text = statistic.Content,
|
||||
TextSize = 17,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
public override void Filter(FilterCriteria criteria)
|
||||
{
|
||||
base.Filter(criteria);
|
||||
Filtered.Value = InternalChildren.All(i => i.Filtered);
|
||||
Filtered.Value = InternalChildren.All(i => i.Filtered.Value);
|
||||
}
|
||||
|
||||
public override string ToString() => BeatmapSet.ToString();
|
||||
|
@ -49,7 +49,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
|
||||
public virtual void AddChild(CarouselItem i)
|
||||
{
|
||||
i.State.ValueChanged += v => ChildItemStateChanged(i, v);
|
||||
i.State.ValueChanged += state => ChildItemStateChanged(i, state.NewValue);
|
||||
i.ChildID = ++currentChildID;
|
||||
InternalChildren.Add(i);
|
||||
}
|
||||
@ -58,9 +58,9 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
if (items != null) InternalChildren = items;
|
||||
|
||||
State.ValueChanged += v =>
|
||||
State.ValueChanged += state =>
|
||||
{
|
||||
switch (v)
|
||||
switch (state.NewValue)
|
||||
{
|
||||
case CarouselItemState.Collapsed:
|
||||
case CarouselItemState.NotSelected:
|
||||
@ -69,7 +69,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
case CarouselItemState.Selected:
|
||||
InternalChildren.ForEach(c =>
|
||||
{
|
||||
if (c.State == CarouselItemState.Collapsed) c.State.Value = CarouselItemState.NotSelected;
|
||||
if (c.State.Value == CarouselItemState.Collapsed) c.State.Value = CarouselItemState.NotSelected;
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
@ -13,9 +13,9 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
public CarouselGroupEagerSelect()
|
||||
{
|
||||
State.ValueChanged += v =>
|
||||
State.ValueChanged += state =>
|
||||
{
|
||||
if (v == CarouselItemState.Selected)
|
||||
if (state.NewValue == CarouselItemState.Selected)
|
||||
attemptSelection();
|
||||
};
|
||||
}
|
||||
@ -81,10 +81,10 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
if (filteringChildren) return;
|
||||
|
||||
// we only perform eager selection if we are a currently selected group.
|
||||
if (State != CarouselItemState.Selected) return;
|
||||
if (State.Value != CarouselItemState.Selected) return;
|
||||
|
||||
// we only perform eager selection if none of our children are in a selected state already.
|
||||
if (Children.Any(i => i.State == CarouselItemState.Selected)) return;
|
||||
if (Children.Any(i => i.State.Value == CarouselItemState.Selected)) return;
|
||||
|
||||
PerformSelection();
|
||||
}
|
||||
@ -92,8 +92,8 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
protected virtual void PerformSelection()
|
||||
{
|
||||
CarouselItem nextToSelect =
|
||||
Children.Skip(lastSelectedIndex).FirstOrDefault(i => !i.Filtered) ??
|
||||
Children.Reverse().Skip(InternalChildren.Count - lastSelectedIndex).FirstOrDefault(i => !i.Filtered);
|
||||
Children.Skip(lastSelectedIndex).FirstOrDefault(i => !i.Filtered.Value) ??
|
||||
Children.Reverse().Skip(InternalChildren.Count - lastSelectedIndex).FirstOrDefault(i => !i.Filtered.Value);
|
||||
|
||||
if (nextToSelect != null)
|
||||
nextToSelect.State.Value = CarouselItemState.Selected;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
|
||||
namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
@ -16,7 +16,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
/// <summary>
|
||||
/// This item is not in a hidden state.
|
||||
/// </summary>
|
||||
public bool Visible => State.Value != CarouselItemState.Collapsed && !Filtered;
|
||||
public bool Visible => State.Value != CarouselItemState.Collapsed && !Filtered.Value;
|
||||
|
||||
public virtual List<DrawableCarouselItem> Drawables
|
||||
{
|
||||
@ -37,9 +37,9 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
DrawableRepresentation = new Lazy<DrawableCarouselItem>(CreateDrawableRepresentation);
|
||||
|
||||
Filtered.ValueChanged += v =>
|
||||
Filtered.ValueChanged += filtered =>
|
||||
{
|
||||
if (v && State == CarouselItemState.Selected)
|
||||
if (filtered.NewValue && State.Value == CarouselItemState.Selected)
|
||||
State.Value = CarouselItemState.NotSelected;
|
||||
};
|
||||
}
|
||||
|
@ -100,25 +100,21 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Font = @"Exo2.0-Medium",
|
||||
Text = beatmap.Version,
|
||||
TextSize = 20,
|
||||
Font = OsuFont.GetFont(size: 20),
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Font = @"Exo2.0-Medium",
|
||||
Text = "mapped by",
|
||||
TextSize = 16,
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Font = @"Exo2.0-MediumItalic",
|
||||
Text = $"{(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author.Username}",
|
||||
TextSize = 16,
|
||||
Font = OsuFont.GetFont(italics: true),
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft
|
||||
},
|
||||
@ -157,7 +153,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
|
||||
protected override bool OnClick(ClickEvent e)
|
||||
{
|
||||
if (Item.State == CarouselItemState.Selected)
|
||||
if (Item.State.Value == CarouselItemState.Selected)
|
||||
startRequested?.Invoke(beatmap);
|
||||
|
||||
return base.OnClick(e);
|
||||
|
@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -15,6 +15,7 @@ using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Overlays;
|
||||
@ -63,16 +64,14 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Font = @"Exo2.0-BoldItalic",
|
||||
Text = new LocalisedString((beatmapSet.Metadata.TitleUnicode, beatmapSet.Metadata.Title)),
|
||||
TextSize = 22,
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 22, italics: true),
|
||||
Shadow = true,
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Font = @"Exo2.0-SemiBoldItalic",
|
||||
Text = new LocalisedString((beatmapSet.Metadata.ArtistUnicode, beatmapSet.Metadata.Artist)),
|
||||
TextSize = 17,
|
||||
Font = OsuFont.GetFont(weight: FontWeight.SemiBold, size: 17, italics: true),
|
||||
Shadow = true,
|
||||
},
|
||||
new FillFlowContainer
|
||||
@ -109,7 +108,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
List<MenuItem> items = new List<MenuItem>();
|
||||
|
||||
if (Item.State == CarouselItemState.NotSelected)
|
||||
if (Item.State.Value == CarouselItemState.NotSelected)
|
||||
items.Add(new OsuMenuItem("Expand", MenuItemType.Highlighted, () => Item.State.Value = CarouselItemState.Selected));
|
||||
|
||||
if (beatmapSet.OnlineBeatmapSetID != null)
|
||||
@ -189,7 +188,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
: base(item.Beatmap)
|
||||
{
|
||||
filtered.BindTo(item.Filtered);
|
||||
filtered.ValueChanged += v => Schedule(() => this.FadeTo(v ? 0.1f : 1, 100));
|
||||
filtered.ValueChanged += isFiltered => Schedule(() => this.FadeTo(isFiltered.NewValue ? 0.1f : 1, 100));
|
||||
filtered.TriggerChange();
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ namespace osu.Game.Screens.Select.Details
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Child = name = new OsuSpriteText
|
||||
{
|
||||
TextSize = 13,
|
||||
Font = OsuFont.GetFont(size: 13)
|
||||
},
|
||||
},
|
||||
bar = new Bar
|
||||
@ -142,7 +142,7 @@ namespace osu.Game.Screens.Select.Details
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
TextSize = 13,
|
||||
Font = OsuFont.GetFont(size: 13)
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Screens.Select.Details
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Text = "User Rating",
|
||||
TextSize = 13,
|
||||
Font = OsuFont.GetFont(size: 13)
|
||||
},
|
||||
ratingsBar = new Bar
|
||||
{
|
||||
@ -87,14 +87,14 @@ namespace osu.Game.Screens.Select.Details
|
||||
negativeRatings = new OsuSpriteText
|
||||
{
|
||||
Text = "0",
|
||||
TextSize = 13,
|
||||
Font = OsuFont.GetFont(size: 13)
|
||||
},
|
||||
positiveRatings = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
Text = @"0",
|
||||
TextSize = 13,
|
||||
Font = OsuFont.GetFont(size: 13)
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -103,7 +103,7 @@ namespace osu.Game.Screens.Select.Details
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Text = "Rating Spread",
|
||||
TextSize = 13,
|
||||
Font = OsuFont.GetFont(size: 13),
|
||||
Margin = new MarginPadding { Top = 10, Bottom = 5 },
|
||||
},
|
||||
},
|
||||
|
@ -5,7 +5,7 @@ using System;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
@ -63,7 +63,7 @@ namespace osu.Game.Screens.Select
|
||||
Group = group,
|
||||
Sort = sort,
|
||||
SearchText = searchTextBox.Text,
|
||||
AllowConvertedBeatmaps = showConverted,
|
||||
AllowConvertedBeatmaps = showConverted.Value,
|
||||
Ruleset = ruleset.Value
|
||||
};
|
||||
|
||||
@ -146,12 +146,12 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
};
|
||||
|
||||
searchTextBox.Current.ValueChanged += t => FilterChanged?.Invoke(CreateCriteria());
|
||||
searchTextBox.Current.ValueChanged += _ => FilterChanged?.Invoke(CreateCriteria());
|
||||
|
||||
groupTabs.PinItem(GroupMode.All);
|
||||
groupTabs.PinItem(GroupMode.RecentlyPlayed);
|
||||
groupTabs.Current.ValueChanged += val => Group = val;
|
||||
sortTabs.Current.ValueChanged += val => Sort = val;
|
||||
groupTabs.Current.ValueChanged += group => Group = group.NewValue;
|
||||
sortTabs.Current.ValueChanged += sort => Sort = sort.NewValue;
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
@ -178,7 +178,7 @@ namespace osu.Game.Screens.Select
|
||||
sortTabs.AccentColour = colours.GreenLight;
|
||||
|
||||
showConverted = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps);
|
||||
showConverted.ValueChanged += val => updateCriteria();
|
||||
showConverted.ValueChanged += _ => updateCriteria();
|
||||
|
||||
ruleset.BindTo(parentRuleset);
|
||||
ruleset.BindValueChanged(_ => updateCriteria(), true);
|
||||
|
@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
|
@ -150,14 +150,14 @@ namespace osu.Game.Screens.Select.Options
|
||||
{
|
||||
Origin = Anchor.TopCentre,
|
||||
Anchor = Anchor.TopCentre,
|
||||
Font = @"Exo2.0-Bold",
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Bold),
|
||||
Text = @"",
|
||||
},
|
||||
secondLine = new OsuSpriteText
|
||||
{
|
||||
Origin = Anchor.TopCentre,
|
||||
Anchor = Anchor.TopCentre,
|
||||
Font = @"Exo2.0-Bold",
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Bold),
|
||||
Text = @"",
|
||||
},
|
||||
},
|
||||
|
@ -10,7 +10,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Logging;
|
||||
@ -285,7 +285,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public void Edit(BeatmapInfo beatmap = null)
|
||||
{
|
||||
Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap ?? beatmapNoDebounce);
|
||||
Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap ?? beatmapNoDebounce);
|
||||
this.Push(new Editor());
|
||||
}
|
||||
|
||||
@ -326,16 +326,16 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private ScheduledDelegate selectionChangedDebounce;
|
||||
|
||||
private void workingBeatmapChanged(WorkingBeatmap beatmap)
|
||||
private void workingBeatmapChanged(ValueChangedEvent<WorkingBeatmap> e)
|
||||
{
|
||||
if (beatmap is DummyWorkingBeatmap) return;
|
||||
if (e.NewValue is DummyWorkingBeatmap) return;
|
||||
|
||||
if (this.IsCurrentScreen() && !Carousel.SelectBeatmap(beatmap?.BeatmapInfo, false))
|
||||
if (this.IsCurrentScreen() && !Carousel.SelectBeatmap(e.NewValue?.BeatmapInfo, false))
|
||||
// If selecting new beatmap without bypassing filters failed, there's possibly a ruleset mismatch
|
||||
if (beatmap?.BeatmapInfo?.Ruleset != null && beatmap.BeatmapInfo.Ruleset != decoupledRuleset.Value)
|
||||
if (e.NewValue?.BeatmapInfo?.Ruleset != null && e.NewValue.BeatmapInfo.Ruleset != decoupledRuleset.Value)
|
||||
{
|
||||
Ruleset.Value = beatmap.BeatmapInfo.Ruleset;
|
||||
Carousel.SelectBeatmap(beatmap.BeatmapInfo);
|
||||
Ruleset.Value = e.NewValue.BeatmapInfo.Ruleset;
|
||||
Carousel.SelectBeatmap(e.NewValue.BeatmapInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -444,7 +444,6 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
base.LogoArriving(logo, resuming);
|
||||
|
||||
logo.RelativePositionAxes = Axes.Both;
|
||||
Vector2 position = new Vector2(0.95f, 0.96f);
|
||||
|
||||
if (logo.Alpha > 0.8f)
|
||||
@ -510,14 +509,15 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public override bool OnExiting(IScreen next)
|
||||
{
|
||||
if (base.OnExiting(next))
|
||||
return true;
|
||||
|
||||
if (ModSelect.State == Visibility.Visible)
|
||||
{
|
||||
ModSelect.Hide();
|
||||
return true;
|
||||
}
|
||||
|
||||
FinaliseSelection(performStartAction: false);
|
||||
|
||||
beatmapInfoWedge.State = Visibility.Hidden;
|
||||
|
||||
this.FadeOut(100);
|
||||
@ -530,7 +530,7 @@ namespace osu.Game.Screens.Select
|
||||
SelectedMods.UnbindAll();
|
||||
Beatmap.Value.Mods.Value = new Mod[] { };
|
||||
|
||||
return base.OnExiting(next);
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
@ -599,9 +599,9 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
// manual binding to parent ruleset to allow for delayed load in the incoming direction.
|
||||
rulesetNoDebounce = decoupledRuleset.Value = Ruleset.Value;
|
||||
Ruleset.ValueChanged += updateSelectedRuleset;
|
||||
Ruleset.ValueChanged += r => updateSelectedRuleset(r.NewValue);
|
||||
|
||||
decoupledRuleset.ValueChanged += r => Ruleset.Value = r;
|
||||
decoupledRuleset.ValueChanged += r => Ruleset.Value = r.NewValue;
|
||||
decoupledRuleset.DisabledChanged += r => Ruleset.Disabled = r;
|
||||
|
||||
Beatmap.BindDisabledChanged(disabled => Carousel.AllowSelection = !disabled, true);
|
||||
|
Reference in New Issue
Block a user