mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 21:23:04 +08:00
Merge branch 'master' into remove-comments-page
This commit is contained in:
commit
3f113640a1
@ -52,6 +52,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.622.1" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.622.1" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.710.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.714.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
|
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
|
||||||
<PackageReference Include="nunit" Version="3.12.0" />
|
<PackageReference Include="nunit" Version="3.12.0" />
|
||||||
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
|
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
|
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
|
||||||
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
|
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
|
||||||
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
|
@ -2,9 +2,12 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Pooling;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||||
@ -16,14 +19,46 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
public TestSceneDrawableJudgement()
|
public TestSceneDrawableJudgement()
|
||||||
{
|
{
|
||||||
|
var pools = new List<DrawablePool<DrawableOsuJudgement>>();
|
||||||
|
|
||||||
foreach (HitResult result in Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Skip(1))
|
foreach (HitResult result in Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Skip(1))
|
||||||
{
|
{
|
||||||
AddStep("Show " + result.GetDescription(), () => SetContents(() =>
|
AddStep("Show " + result.GetDescription(), () =>
|
||||||
new DrawableOsuJudgement(new JudgementResult(new HitObject(), new Judgement()) { Type = result }, null)
|
{
|
||||||
|
int poolIndex = 0;
|
||||||
|
|
||||||
|
SetContents(() =>
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
DrawablePool<DrawableOsuJudgement> pool;
|
||||||
Origin = Anchor.Centre,
|
|
||||||
}));
|
if (poolIndex >= pools.Count)
|
||||||
|
pools.Add(pool = new DrawablePool<DrawableOsuJudgement>(1));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pool = pools[poolIndex];
|
||||||
|
|
||||||
|
// We need to make sure neither the pool nor the judgement get disposed when new content is set, and they both share the same parent.
|
||||||
|
((Container)pool.Parent).Clear(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
var container = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
pool,
|
||||||
|
pool.Get(j => j.Apply(new JudgementResult(new HitObject(), new Judgement()) { Type = result }, null)).With(j =>
|
||||||
|
{
|
||||||
|
j.Anchor = Anchor.Centre;
|
||||||
|
j.Origin = Anchor.Centre;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
poolIndex++;
|
||||||
|
return container;
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
|
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
|
||||||
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
|
@ -62,6 +62,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
if (lighting != null)
|
if (lighting != null)
|
||||||
{
|
{
|
||||||
|
lighting.ResetAnimation();
|
||||||
|
|
||||||
if (JudgedObject != null)
|
if (JudgedObject != null)
|
||||||
{
|
{
|
||||||
lightingColour = JudgedObject.AccentColour.GetBoundCopy();
|
lightingColour = JudgedObject.AccentColour.GetBoundCopy();
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
|
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
|
||||||
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
|
@ -80,9 +80,9 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestRecommendedSelection()
|
public void TestRecommendedSelection()
|
||||||
{
|
{
|
||||||
loadBeatmaps();
|
loadBeatmaps(carouselAdjust: carousel => carousel.GetRecommendedBeatmap = beatmaps => beatmaps.LastOrDefault());
|
||||||
|
|
||||||
AddStep("set recommendation function", () => carousel.GetRecommendedBeatmap = beatmaps => beatmaps.LastOrDefault());
|
AddStep("select last", () => carousel.SelectBeatmap(carousel.BeatmapSets.Last().Beatmaps.Last()));
|
||||||
|
|
||||||
// check recommended was selected
|
// check recommended was selected
|
||||||
advanceSelection(direction: 1, diff: false);
|
advanceSelection(direction: 1, diff: false);
|
||||||
@ -114,7 +114,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
{
|
{
|
||||||
loadBeatmaps();
|
loadBeatmaps();
|
||||||
|
|
||||||
advanceSelection(direction: 1, diff: false);
|
AddStep("select first", () => carousel.SelectBeatmap(carousel.BeatmapSets.First().Beatmaps.First()));
|
||||||
waitForSelection(1, 1);
|
waitForSelection(1, 1);
|
||||||
|
|
||||||
advanceSelection(direction: 1, diff: true);
|
advanceSelection(direction: 1, diff: true);
|
||||||
@ -707,9 +707,9 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
checkVisibleItemCount(true, 15);
|
checkVisibleItemCount(true, 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadBeatmaps(List<BeatmapSetInfo> beatmapSets = null, Func<FilterCriteria> initialCriteria = null)
|
private void loadBeatmaps(List<BeatmapSetInfo> beatmapSets = null, Func<FilterCriteria> initialCriteria = null, Action<BeatmapCarousel> carouselAdjust = null)
|
||||||
{
|
{
|
||||||
createCarousel();
|
createCarousel(carouselAdjust);
|
||||||
|
|
||||||
if (beatmapSets == null)
|
if (beatmapSets == null)
|
||||||
{
|
{
|
||||||
@ -730,17 +730,21 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
AddUntilStep("Wait for load", () => changed);
|
AddUntilStep("Wait for load", () => changed);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createCarousel(Container target = null)
|
private void createCarousel(Action<BeatmapCarousel> carouselAdjust = null, Container target = null)
|
||||||
{
|
{
|
||||||
AddStep("Create carousel", () =>
|
AddStep("Create carousel", () =>
|
||||||
{
|
{
|
||||||
selectedSets.Clear();
|
selectedSets.Clear();
|
||||||
eagerSelectedIDs.Clear();
|
eagerSelectedIDs.Clear();
|
||||||
|
|
||||||
(target ?? this).Child = carousel = new TestBeatmapCarousel
|
carousel = new TestBeatmapCarousel
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
carouselAdjust?.Invoke(carousel);
|
||||||
|
|
||||||
|
(target ?? this).Child = carousel;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Overlays.Rankings;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Visual.UserInterface
|
||||||
|
{
|
||||||
|
public class TestSceneRankingsSortTabControl : OsuTestScene
|
||||||
|
{
|
||||||
|
[Cached]
|
||||||
|
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Green);
|
||||||
|
|
||||||
|
public TestSceneRankingsSortTabControl()
|
||||||
|
{
|
||||||
|
Child = new RankingsSortTabControl
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,7 +5,7 @@
|
|||||||
<PackageReference Include="DeepEqual" Version="2.0.0" />
|
<PackageReference Include="DeepEqual" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
|
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
|
||||||
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
|
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Project">
|
<PropertyGroup Label="Project">
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
|
@ -21,7 +21,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
private readonly Box box;
|
private readonly Box box;
|
||||||
private readonly SpriteText text;
|
private readonly SpriteText text;
|
||||||
private readonly SpriteIcon icon;
|
|
||||||
|
|
||||||
private Color4? accentColour;
|
private Color4? accentColour;
|
||||||
|
|
||||||
@ -32,12 +31,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
accentColour = value;
|
accentColour = value;
|
||||||
|
|
||||||
if (Current.Value)
|
|
||||||
{
|
|
||||||
text.Colour = AccentColour;
|
|
||||||
icon.Colour = AccentColour;
|
|
||||||
}
|
|
||||||
|
|
||||||
updateFade();
|
updateFade();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -52,6 +45,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
public OsuTabControlCheckbox()
|
public OsuTabControlCheckbox()
|
||||||
{
|
{
|
||||||
|
SpriteIcon icon;
|
||||||
|
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -89,6 +84,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
icon.Icon = selected.NewValue ? FontAwesome.Regular.CheckCircle : FontAwesome.Regular.Circle;
|
icon.Icon = selected.NewValue ? FontAwesome.Regular.CheckCircle : FontAwesome.Regular.Circle;
|
||||||
text.Font = text.Font.With(weight: selected.NewValue ? FontWeight.Bold : FontWeight.Medium);
|
text.Font = text.Font.With(weight: selected.NewValue ? FontWeight.Bold : FontWeight.Medium);
|
||||||
|
|
||||||
|
updateFade();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,8 +112,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
private void updateFade()
|
private void updateFade()
|
||||||
{
|
{
|
||||||
box.FadeTo(IsHovered ? 1 : 0, transition_length, Easing.OutQuint);
|
box.FadeTo(Current.Value || IsHovered ? 1 : 0, transition_length, Easing.OutQuint);
|
||||||
text.FadeColour(IsHovered ? Color4.White : AccentColour, transition_length, Easing.OutQuint);
|
text.FadeColour(Current.Value || IsHovered ? Color4.White : AccentColour, transition_length, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ namespace osu.Game.Input.Bindings
|
|||||||
new KeyBinding(new[] { InputKey.Control, InputKey.T }, GlobalAction.ToggleToolbar),
|
new KeyBinding(new[] { InputKey.Control, InputKey.T }, GlobalAction.ToggleToolbar),
|
||||||
new KeyBinding(new[] { InputKey.Control, InputKey.O }, GlobalAction.ToggleSettings),
|
new KeyBinding(new[] { InputKey.Control, InputKey.O }, GlobalAction.ToggleSettings),
|
||||||
new KeyBinding(new[] { InputKey.Control, InputKey.D }, GlobalAction.ToggleDirect),
|
new KeyBinding(new[] { InputKey.Control, InputKey.D }, GlobalAction.ToggleDirect),
|
||||||
|
new KeyBinding(new[] { InputKey.Control, InputKey.N }, GlobalAction.ToggleNotifications),
|
||||||
|
|
||||||
new KeyBinding(InputKey.Escape, GlobalAction.Back),
|
new KeyBinding(InputKey.Escape, GlobalAction.Back),
|
||||||
new KeyBinding(InputKey.ExtraMouseButton1, GlobalAction.Back),
|
new KeyBinding(InputKey.ExtraMouseButton1, GlobalAction.Back),
|
||||||
@ -157,5 +158,8 @@ namespace osu.Game.Input.Bindings
|
|||||||
|
|
||||||
[Description("Home")]
|
[Description("Home")]
|
||||||
Home,
|
Home,
|
||||||
|
|
||||||
|
[Description("Toggle notifications")]
|
||||||
|
ToggleNotifications
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,36 +170,37 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
{
|
{
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new GridContainer
|
new OsuContextMenuContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
RowDimensions = new[]
|
Masking = true,
|
||||||
|
Child = new GridContainer
|
||||||
{
|
{
|
||||||
new Dimension(),
|
RelativeSizeAxes = Axes.Both,
|
||||||
new Dimension(GridSizeMode.AutoSize),
|
RowDimensions = new[]
|
||||||
},
|
|
||||||
Content = new[]
|
|
||||||
{
|
|
||||||
new Drawable[]
|
|
||||||
{
|
{
|
||||||
new OsuContextMenuContainer
|
new Dimension(),
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
},
|
||||||
|
Content = new[]
|
||||||
|
{
|
||||||
|
new Drawable[]
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
scrollContainer = new OsuScrollContainer
|
||||||
Child = scrollContainer = new OsuScrollContainer
|
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
ScrollbarVisible = false,
|
ScrollbarVisible = false,
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
new Drawable[]
|
||||||
|
{
|
||||||
|
content = new Container
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Drawable[]
|
|
||||||
{
|
|
||||||
content = new Container
|
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
loading = new LoadingSpinner(),
|
loading = new LoadingSpinner(),
|
||||||
|
@ -58,6 +58,9 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
[Resolved(CanBeNull = true)]
|
[Resolved(CanBeNull = true)]
|
||||||
private DialogOverlay dialogOverlay { get; set; }
|
private DialogOverlay dialogOverlay { get; set; }
|
||||||
|
|
||||||
|
[Resolved(CanBeNull = true)]
|
||||||
|
private SongSelect songSelect { get; set; }
|
||||||
|
|
||||||
public LeaderboardScore(ScoreInfo score, int? rank, bool allowHighlight = true)
|
public LeaderboardScore(ScoreInfo score, int? rank, bool allowHighlight = true)
|
||||||
{
|
{
|
||||||
this.score = score;
|
this.score = score;
|
||||||
@ -373,6 +376,9 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
{
|
{
|
||||||
List<MenuItem> items = new List<MenuItem>();
|
List<MenuItem> items = new List<MenuItem>();
|
||||||
|
|
||||||
|
if (score.Mods.Length > 0 && modsContainer.Any(s => s.IsHovered) && songSelect != null)
|
||||||
|
items.Add(new OsuMenuItem("Use these mods", MenuItemType.Highlighted, () => songSelect.Mods.Value = score.Mods));
|
||||||
|
|
||||||
if (score.ID != 0)
|
if (score.ID != 0)
|
||||||
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => dialogOverlay?.Push(new LocalScoreDeleteDialog(score))));
|
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => dialogOverlay?.Push(new LocalScoreDeleteDialog(score))));
|
||||||
|
|
||||||
|
@ -890,6 +890,10 @@ namespace osu.Game
|
|||||||
beatmapListing.ToggleVisibility();
|
beatmapListing.ToggleVisibility();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case GlobalAction.ToggleNotifications:
|
||||||
|
notifications.ToggleVisibility();
|
||||||
|
return true;
|
||||||
|
|
||||||
case GlobalAction.ToggleGameplayMouseButtons:
|
case GlobalAction.ToggleGameplayMouseButtons:
|
||||||
LocalConfig.Set(OsuSetting.MouseDisableButtons, !LocalConfig.Get<bool>(OsuSetting.MouseDisableButtons));
|
LocalConfig.Set(OsuSetting.MouseDisableButtons, !LocalConfig.Get<bool>(OsuSetting.MouseDisableButtons));
|
||||||
return true;
|
return true;
|
||||||
|
@ -86,7 +86,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Font = OsuFont.GetFont(size: 12),
|
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold),
|
||||||
Text = @"Show deleted"
|
Text = @"Show deleted"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -149,7 +149,7 @@ namespace osu.Game.Overlays
|
|||||||
if (beatmap.Disabled)
|
if (beatmap.Disabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
next();
|
NextTrack();
|
||||||
}
|
}
|
||||||
else if (!IsPlaying)
|
else if (!IsPlaying)
|
||||||
{
|
{
|
||||||
@ -217,6 +217,9 @@ namespace osu.Game.Overlays
|
|||||||
/// <returns>The <see cref="PreviousTrackResult"/> that indicate the decided action.</returns>
|
/// <returns>The <see cref="PreviousTrackResult"/> that indicate the decided action.</returns>
|
||||||
private PreviousTrackResult prev()
|
private PreviousTrackResult prev()
|
||||||
{
|
{
|
||||||
|
if (beatmap.Disabled)
|
||||||
|
return PreviousTrackResult.None;
|
||||||
|
|
||||||
var currentTrackPosition = current?.Track.CurrentTime;
|
var currentTrackPosition = current?.Track.CurrentTime;
|
||||||
|
|
||||||
if (currentTrackPosition >= restart_cutoff_point)
|
if (currentTrackPosition >= restart_cutoff_point)
|
||||||
@ -248,6 +251,9 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private bool next()
|
private bool next()
|
||||||
{
|
{
|
||||||
|
if (beatmap.Disabled)
|
||||||
|
return false;
|
||||||
|
|
||||||
queuedDirection = TrackChangeDirection.Next;
|
queuedDirection = TrackChangeDirection.Next;
|
||||||
|
|
||||||
var playable = BeatmapSets.SkipWhile(i => i.ID != current.BeatmapSetInfo.ID).ElementAtOrDefault(1) ?? BeatmapSets.FirstOrDefault();
|
var playable = BeatmapSets.SkipWhile(i => i.ID != current.BeatmapSetInfo.ID).ElementAtOrDefault(1) ?? BeatmapSets.FirstOrDefault();
|
||||||
|
@ -30,6 +30,14 @@ namespace osu.Game.Overlays
|
|||||||
set => current.Current = value;
|
set => current.Current = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string Title
|
||||||
|
{
|
||||||
|
get => text.Text;
|
||||||
|
set => text.Text = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly OsuSpriteText text;
|
||||||
|
|
||||||
public OverlaySortTabControl()
|
public OverlaySortTabControl()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
@ -40,11 +48,11 @@ namespace osu.Game.Overlays
|
|||||||
Spacing = new Vector2(10, 0),
|
Spacing = new Vector2(10, 0),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
text = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Font = OsuFont.GetFont(size: 12),
|
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold),
|
||||||
Text = @"Sort by"
|
Text = @"Sort by"
|
||||||
},
|
},
|
||||||
CreateControl().With(c =>
|
CreateControl().With(c =>
|
||||||
@ -133,7 +141,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Font = OsuFont.GetFont(size: 12),
|
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold),
|
||||||
Text = (value as Enum)?.GetDescription() ?? value.ToString()
|
Text = (value as Enum)?.GetDescription() ?? value.ToString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -163,7 +171,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
ContentColour = Active.Value && !IsHovered ? colourProvider.Light1 : Color4.White;
|
ContentColour = Active.Value && !IsHovered ? colourProvider.Light1 : Color4.White;
|
||||||
|
|
||||||
text.Font = text.Font.With(weight: Active.Value ? FontWeight.Bold : FontWeight.Medium);
|
text.Font = text.Font.With(weight: Active.Value ? FontWeight.Bold : FontWeight.SemiBold);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
19
osu.Game/Overlays/Rankings/RankingsSortTabControl.cs
Normal file
19
osu.Game/Overlays/Rankings/RankingsSortTabControl.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.Rankings
|
||||||
|
{
|
||||||
|
public class RankingsSortTabControl : OverlaySortTabControl<RankingsSortCriteria>
|
||||||
|
{
|
||||||
|
public RankingsSortTabControl()
|
||||||
|
{
|
||||||
|
Title = "Show";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum RankingsSortCriteria
|
||||||
|
{
|
||||||
|
All,
|
||||||
|
Friends
|
||||||
|
}
|
||||||
|
}
|
@ -31,8 +31,10 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
public JudgementResult Result { get; private set; }
|
public JudgementResult Result { get; private set; }
|
||||||
public DrawableHitObject JudgedObject { get; private set; }
|
public DrawableHitObject JudgedObject { get; private set; }
|
||||||
|
|
||||||
protected Container JudgementBody;
|
protected Container JudgementBody { get; private set; }
|
||||||
protected SpriteText JudgementText;
|
protected SpriteText JudgementText { get; private set; }
|
||||||
|
|
||||||
|
private SkinnableDrawable bodyDrawable;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Duration of initial fade in.
|
/// Duration of initial fade in.
|
||||||
@ -89,6 +91,8 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
|
|
||||||
prepareDrawables();
|
prepareDrawables();
|
||||||
|
|
||||||
|
bodyDrawable.ResetAnimation();
|
||||||
|
|
||||||
this.FadeInFromZero(FadeInDuration, Easing.OutQuint);
|
this.FadeInFromZero(FadeInDuration, Easing.OutQuint);
|
||||||
JudgementBody.ScaleTo(1);
|
JudgementBody.ScaleTo(1);
|
||||||
JudgementBody.RotateTo(0);
|
JudgementBody.RotateTo(0);
|
||||||
@ -131,7 +135,7 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = new SkinnableDrawable(new GameplaySkinComponent<HitResult>(type), _ => JudgementText = new OsuSpriteText
|
Child = bodyDrawable = new SkinnableDrawable(new GameplaySkinComponent<HitResult>(type), _ => JudgementText = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = type.GetDescription().ToUpperInvariant(),
|
Text = type.GetDescription().ToUpperInvariant(),
|
||||||
Font = OsuFont.Numeric.With(size: 20),
|
Font = OsuFont.Numeric.With(size: 20),
|
||||||
|
@ -219,6 +219,8 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
Alpha = 0;
|
Alpha = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool ShouldBeConsideredForInput(Drawable child) => state == SelectionState.Selected;
|
||||||
|
|
||||||
private class RoomName : OsuSpriteText
|
private class RoomName : OsuSpriteText
|
||||||
{
|
{
|
||||||
[Resolved(typeof(Room), nameof(Online.Multiplayer.Room.Name))]
|
[Resolved(typeof(Room), nameof(Online.Multiplayer.Room.Name))]
|
||||||
|
@ -4,9 +4,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Screens.Multi.Components;
|
using osu.Game.Screens.Multi.Components;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -15,7 +14,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
public class RoomInfo : MultiplayerComposite
|
public class RoomInfo : MultiplayerComposite
|
||||||
{
|
{
|
||||||
private readonly List<Drawable> statusElements = new List<Drawable>();
|
private readonly List<Drawable> statusElements = new List<Drawable>();
|
||||||
private readonly SpriteText roomName;
|
private readonly OsuTextFlowContainer roomName;
|
||||||
|
|
||||||
public RoomInfo()
|
public RoomInfo()
|
||||||
{
|
{
|
||||||
@ -43,18 +42,23 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
AutoSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
roomName = new OsuSpriteText { Font = OsuFont.GetFont(size: 30) },
|
roomName = new OsuTextFlowContainer(t => t.Font = OsuFont.GetFont(size: 30))
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
},
|
||||||
statusInfo = new RoomStatusInfo(),
|
statusInfo = new RoomStatusInfo(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
typeInfo = new ModeTypeInfo
|
typeInfo = new ModeTypeInfo
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreRight,
|
Anchor = Anchor.BottomRight,
|
||||||
Origin = Anchor.CentreRight
|
Origin = Anchor.BottomRight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -95,7 +95,6 @@ namespace osu.Game.Screens.Select
|
|||||||
CarouselRoot newRoot = new CarouselRoot(this);
|
CarouselRoot newRoot = new CarouselRoot(this);
|
||||||
|
|
||||||
beatmapSets.Select(createCarouselSet).Where(g => g != null).ForEach(newRoot.AddChild);
|
beatmapSets.Select(createCarouselSet).Where(g => g != null).ForEach(newRoot.AddChild);
|
||||||
newRoot.Filter(activeCriteria);
|
|
||||||
|
|
||||||
// preload drawables as the ctor overhead is quite high currently.
|
// preload drawables as the ctor overhead is quite high currently.
|
||||||
_ = newRoot.Drawables;
|
_ = newRoot.Drawables;
|
||||||
@ -108,6 +107,9 @@ namespace osu.Game.Screens.Select
|
|||||||
itemsCache.Invalidate();
|
itemsCache.Invalidate();
|
||||||
scrollPositionCache.Invalidate();
|
scrollPositionCache.Invalidate();
|
||||||
|
|
||||||
|
// apply any pending filter operation that may have been delayed (see applyActiveCriteria's scheduling behaviour when BeatmapSetsLoaded is false).
|
||||||
|
FlushPendingFilterOperations();
|
||||||
|
|
||||||
// Run on late scheduler want to ensure this runs after all pending UpdateBeatmapSet / RemoveBeatmapSet operations are run.
|
// Run on late scheduler want to ensure this runs after all pending UpdateBeatmapSet / RemoveBeatmapSet operations are run.
|
||||||
SchedulerAfterChildren.Add(() =>
|
SchedulerAfterChildren.Add(() =>
|
||||||
{
|
{
|
||||||
@ -321,6 +323,9 @@ namespace osu.Game.Screens.Select
|
|||||||
/// <returns>True if a selection could be made, else False.</returns>
|
/// <returns>True if a selection could be made, else False.</returns>
|
||||||
public bool SelectNextRandom()
|
public bool SelectNextRandom()
|
||||||
{
|
{
|
||||||
|
if (!AllowSelection)
|
||||||
|
return false;
|
||||||
|
|
||||||
var visibleSets = beatmapSets.Where(s => !s.Filtered.Value).ToList();
|
var visibleSets = beatmapSets.Where(s => !s.Filtered.Value).ToList();
|
||||||
if (!visibleSets.Any())
|
if (!visibleSets.Any())
|
||||||
return false;
|
return false;
|
||||||
@ -427,7 +432,19 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private void applyActiveCriteria(bool debounce, bool alwaysResetScrollPosition = true)
|
private void applyActiveCriteria(bool debounce, bool alwaysResetScrollPosition = true)
|
||||||
{
|
{
|
||||||
if (root.Children.Any() != true) return;
|
PendingFilter?.Cancel();
|
||||||
|
PendingFilter = null;
|
||||||
|
|
||||||
|
if (debounce)
|
||||||
|
PendingFilter = Scheduler.AddDelayed(perform, 250);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// if initial load is not yet finished, this will be run inline in loadBeatmapSets to ensure correct order of operation.
|
||||||
|
if (!BeatmapSetsLoaded)
|
||||||
|
PendingFilter = Schedule(perform);
|
||||||
|
else
|
||||||
|
perform();
|
||||||
|
}
|
||||||
|
|
||||||
void perform()
|
void perform()
|
||||||
{
|
{
|
||||||
@ -439,14 +456,6 @@ namespace osu.Game.Screens.Select
|
|||||||
if (alwaysResetScrollPosition || !scroll.UserScrolling)
|
if (alwaysResetScrollPosition || !scroll.UserScrolling)
|
||||||
ScrollToSelected();
|
ScrollToSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
PendingFilter?.Cancel();
|
|
||||||
PendingFilter = null;
|
|
||||||
|
|
||||||
if (debounce)
|
|
||||||
PendingFilter = Scheduler.AddDelayed(perform, 250);
|
|
||||||
else
|
|
||||||
perform();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private float? scrollTarget;
|
private float? scrollTarget;
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using osu.Framework.Caching;
|
using osu.Framework.Caching;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Animations;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Skinning
|
namespace osu.Game.Skinning
|
||||||
@ -50,6 +51,11 @@ namespace osu.Game.Skinning
|
|||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Seeks to the 0-th frame if the content of this <see cref="SkinnableDrawable"/> is an <see cref="IFramedAnimation"/>.
|
||||||
|
/// </summary>
|
||||||
|
public void ResetAnimation() => (Drawable as IFramedAnimation)?.GotoFrame(0);
|
||||||
|
|
||||||
private readonly Func<ISkinComponent, Drawable> createDefault;
|
private readonly Func<ISkinComponent, Drawable> createDefault;
|
||||||
|
|
||||||
private readonly Cached scaling = new Cached();
|
private readonly Cached scaling = new Cached();
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.710.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.714.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.622.1" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.622.1" />
|
||||||
<PackageReference Include="Sentry" Version="2.1.4" />
|
<PackageReference Include="Sentry" Version="2.1.4" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.25.1" />
|
<PackageReference Include="SharpCompress" Version="0.25.1" />
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.710.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.714.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.622.1" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.622.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||||
@ -80,7 +80,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.710.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.714.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.25.1" />
|
<PackageReference Include="SharpCompress" Version="0.25.1" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user