mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 09:37:23 +08:00
Merge remote-tracking branch 'upstream/master' into panel-hover-effect
This commit is contained in:
commit
c555867aaf
@ -16,6 +16,7 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuSetting.Ruleset, 0, 0, int.MaxValue);
|
Set(OsuSetting.Ruleset, 0, 0, int.MaxValue);
|
||||||
Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details);
|
Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details);
|
||||||
|
|
||||||
|
Set(OsuSetting.ShowConvertedBeatmaps, true);
|
||||||
Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10, 0.1);
|
Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10, 0.1);
|
||||||
Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10, 0.1);
|
Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10, 0.1);
|
||||||
|
|
||||||
@ -112,6 +113,7 @@ namespace osu.Game.Configuration
|
|||||||
SnakingOutSliders,
|
SnakingOutSliders,
|
||||||
ShowFpsDisplay,
|
ShowFpsDisplay,
|
||||||
ChatDisplayHeight,
|
ChatDisplayHeight,
|
||||||
Version
|
Version,
|
||||||
|
ShowConvertedBeatmaps
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,19 +57,31 @@ namespace osu.Game.Graphics
|
|||||||
private void load(FontStore store)
|
private void load(FontStore store)
|
||||||
{
|
{
|
||||||
this.store = store;
|
this.store = store;
|
||||||
|
|
||||||
updateTexture();
|
updateTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
updateTexture();
|
||||||
|
}
|
||||||
|
|
||||||
|
private FontAwesome loadedIcon;
|
||||||
private void updateTexture()
|
private void updateTexture()
|
||||||
{
|
{
|
||||||
var texture = store?.Get(((char)icon).ToString());
|
var loadableIcon = icon;
|
||||||
|
|
||||||
|
if (loadableIcon == loadedIcon) return;
|
||||||
|
|
||||||
|
var texture = store?.Get(((char)loadableIcon).ToString());
|
||||||
|
|
||||||
spriteMain.Texture = texture;
|
spriteMain.Texture = texture;
|
||||||
spriteShadow.Texture = texture;
|
spriteShadow.Texture = texture;
|
||||||
|
|
||||||
if (Size == Vector2.Zero)
|
if (Size == Vector2.Zero)
|
||||||
Size = new Vector2(texture?.DisplayWidth ?? 0, texture?.DisplayHeight ?? 0);
|
Size = new Vector2(texture?.DisplayWidth ?? 0, texture?.DisplayHeight ?? 0);
|
||||||
|
|
||||||
|
loadedIcon = loadableIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true)
|
public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true)
|
||||||
|
@ -17,6 +17,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
|||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
new SettingsCheckbox
|
||||||
|
{
|
||||||
|
LabelText = "Show converted beatmaps",
|
||||||
|
Bindable = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps),
|
||||||
|
},
|
||||||
new SettingsSlider<double, StarSlider>
|
new SettingsSlider<double, StarSlider>
|
||||||
{
|
{
|
||||||
LabelText = "Display beatmaps from",
|
LabelText = "Display beatmaps from",
|
||||||
@ -33,7 +38,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
|||||||
{
|
{
|
||||||
LabelText = "Random beatmap selection",
|
LabelText = "Random beatmap selection",
|
||||||
Bindable = config.GetBindable<SelectionRandomType>(OsuSetting.SelectionRandomType),
|
Bindable = config.GetBindable<SelectionRandomType>(OsuSetting.SelectionRandomType),
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,15 +31,15 @@ namespace osu.Game.Screens.Select.Details
|
|||||||
|
|
||||||
const int rating_range = 10;
|
const int rating_range = 10;
|
||||||
|
|
||||||
var ratings = Metrics.Ratings.ToList().GetRange(1, rating_range); // adjust for API returning weird empty data at 0.
|
var ratings = Metrics.Ratings.Skip(1).Take(rating_range); // adjust for API returning weird empty data at 0.
|
||||||
|
|
||||||
var negativeCount = ratings.GetRange(0, rating_range / 2).Sum();
|
var negativeCount = ratings.Take(rating_range / 2).Sum();
|
||||||
var totalCount = ratings.Sum();
|
var totalCount = ratings.Sum();
|
||||||
|
|
||||||
negativeRatings.Text = negativeCount.ToString();
|
negativeRatings.Text = negativeCount.ToString();
|
||||||
positiveRatings.Text = (totalCount - negativeCount).ToString();
|
positiveRatings.Text = (totalCount - negativeCount).ToString();
|
||||||
ratingsBar.Length = totalCount == 0 ? 0 : (float)negativeCount / totalCount;
|
ratingsBar.Length = totalCount == 0 ? 0 : (float)negativeCount / totalCount;
|
||||||
graph.Values = ratings.GetRange(0, rating_range).Select(r => (float)r);
|
graph.Values = ratings.Take(rating_range).Select(r => (float)r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ using osu.Game.Screens.Select.Filter;
|
|||||||
using Container = osu.Framework.Graphics.Containers.Container;
|
using Container = osu.Framework.Graphics.Containers.Container;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
@ -60,6 +61,7 @@ namespace osu.Game.Screens.Select
|
|||||||
Group = group,
|
Group = group,
|
||||||
Sort = sort,
|
Sort = sort,
|
||||||
SearchText = searchTextBox.Text,
|
SearchText = searchTextBox.Text,
|
||||||
|
AllowConvertedBeatmaps = showConverted,
|
||||||
Ruleset = ruleset
|
Ruleset = ruleset
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -163,17 +165,24 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||||
|
|
||||||
|
private Bindable<bool> showConverted;
|
||||||
|
|
||||||
[BackgroundDependencyLoader(permitNulls: true)]
|
[BackgroundDependencyLoader(permitNulls: true)]
|
||||||
private void load(OsuColour colours, OsuGame osu)
|
private void load(OsuColour colours, OsuGame osu, OsuConfigManager config)
|
||||||
{
|
{
|
||||||
sortTabs.AccentColour = colours.GreenLight;
|
sortTabs.AccentColour = colours.GreenLight;
|
||||||
|
|
||||||
|
showConverted = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps);
|
||||||
|
showConverted.ValueChanged += val => updateCriteria();
|
||||||
|
|
||||||
if (osu != null)
|
if (osu != null)
|
||||||
ruleset.BindTo(osu.Ruleset);
|
ruleset.BindTo(osu.Ruleset);
|
||||||
ruleset.ValueChanged += val => FilterChanged?.Invoke(CreateCriteria());
|
ruleset.ValueChanged += val => updateCriteria();
|
||||||
ruleset.TriggerChange();
|
ruleset.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateCriteria() => FilterChanged?.Invoke(CreateCriteria());
|
||||||
|
|
||||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
||||||
|
|
||||||
protected override bool OnMouseMove(InputState state) => true;
|
protected override bool OnMouseMove(InputState state) => true;
|
||||||
@ -182,4 +191,4 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
protected override bool OnDragStart(InputState state) => true;
|
protected override bool OnDragStart(InputState state) => true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ namespace osu.Game.Screens.Select
|
|||||||
public SortMode Sort;
|
public SortMode Sort;
|
||||||
public string SearchText;
|
public string SearchText;
|
||||||
public RulesetInfo Ruleset;
|
public RulesetInfo Ruleset;
|
||||||
|
public bool AllowConvertedBeatmaps;
|
||||||
|
|
||||||
public void Filter(List<BeatmapGroup> groups)
|
public void Filter(List<BeatmapGroup> groups)
|
||||||
{
|
{
|
||||||
@ -23,7 +24,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
var set = g.BeatmapSet;
|
var set = g.BeatmapSet;
|
||||||
|
|
||||||
bool hasCurrentMode = set.Beatmaps.Any(bm => bm.RulesetID == (Ruleset?.ID ?? 0));
|
bool hasCurrentMode = AllowConvertedBeatmaps || set.Beatmaps.Any(bm => bm.RulesetID == (Ruleset?.ID ?? 0));
|
||||||
|
|
||||||
bool match = hasCurrentMode;
|
bool match = hasCurrentMode;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user