mirror of
https://github.com/ppy/osu.git
synced 2026-05-15 14:52:53 +08:00
Compare commits
124 Commits
2020.221.0
...
2020.229.0
@@ -1,8 +0,0 @@
|
||||
---
|
||||
name: Mobile Report
|
||||
about: ⚠ Due to current development priorities we are not accepting mobile reports at this time (unless you're willing to fix them yourself!)
|
||||
---
|
||||
|
||||
⚠ **PLEASE READ** ⚠: Due to prioritising finishing the client for desktop first we are not accepting reports related to mobile platforms for the time being, unless you're willing to fix them.
|
||||
If you'd like to report a problem or suggest a feature and then work on it, feel free to open an issue and highlight that you'd like to address it yourself in the issue body; mobile pull requests are also welcome.
|
||||
Otherwise, please check back in the future when the focus of development shifts towards mobile!
|
||||
@@ -8,4 +8,7 @@ about: Issues regarding encountered bugs.
|
||||
|
||||
**osu!lazer version:**
|
||||
|
||||
**Logs:**
|
||||
**Logs:**
|
||||
*please attach logs here, which are located at:*
|
||||
- `%AppData%/osu/logs` *(on Windows),*
|
||||
- `~/.local/share/osu/logs` *(on Linux & macOS).*
|
||||
|
||||
@@ -8,6 +8,9 @@ about: Issues regarding crashes or permanent freezes.
|
||||
|
||||
**osu!lazer version:**
|
||||
|
||||
**Logs:**
|
||||
**Logs:**
|
||||
*please attach logs here, which are located at:*
|
||||
- `%AppData%/osu/logs` *(on Windows),*
|
||||
- `~/.local/share/osu/logs` *(on Linux & macOS).*
|
||||
|
||||
**Computer Specifications:**
|
||||
|
||||
@@ -15,7 +15,7 @@ Rhythm is just a *click* away. The future of [osu!](https://osu.ppy.sh) and the
|
||||
|
||||
This project is under heavy development, but is in a stable state. Users are encouraged to try it out and keep it installed alongside the stable *osu!* client. It will continue to evolve to the point of eventually replacing the existing stable client as an update.
|
||||
|
||||
We are accepting bug reports (please report with as much detail as possible). Feature requests are also welcome, but understand that our focus is on completing the game to feature parity before adding new features. A few resources are available as starting points to getting involved and understanding the project:
|
||||
We are accepting bug reports (please report with as much detail as possible and follow the existing issue templates). Feature requests are also welcome, but understand that our focus is on completing the game to feature parity before adding new features. A few resources are available as starting points to getting involved and understanding the project:
|
||||
|
||||
- Detailed release changelogs are available on the [official osu! site](https://osu.ppy.sh/home/changelog/lazer).
|
||||
- You can learn more about our approach to [project management](https://github.com/ppy/osu/wiki/Project-management).
|
||||
@@ -27,10 +27,9 @@ If you are looking to install or test osu! without setting up a development envi
|
||||
|
||||
**Latest build:**
|
||||
|
||||
| [Windows (x64)](https://github.com/ppy/osu/releases/latest/download/install.exe) | [macOS 10.12+](https://github.com/ppy/osu/releases/latest/download/osu.app.zip) | [iOS(iOS 10+)](https://osu.ppy.sh/home/testflight) | [Android (5+)](https://github.com/ppy/osu/releases/latest/download/sh.ppy.osulazer.apk)
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| [Windows (x64)](https://github.com/ppy/osu/releases/latest/download/install.exe) | [macOS 10.12+](https://github.com/ppy/osu/releases/latest/download/osu.app.zip) | [Linux (x64)](https://github.com/ppy/osu/releases/latest/download/osu.x86_64.AppImage) | [iOS(iOS 10+)](https://osu.ppy.sh/home/testflight) | [Android (5+)](https://github.com/ppy/osu/releases/latest/download/sh.ppy.osulazer.apk)
|
||||
| ------------- | ------------- | ------------- | ------------- | ------------- |
|
||||
|
||||
- **Linux** users are recommended to self-compile until we have official deployment in place.
|
||||
- When running on Windows 7 or 8.1, **[additional prerequisites](https://docs.microsoft.com/en-us/dotnet/core/install/dependencies?tabs=netcore31&pivots=os-windows)** may be required to correctly run .NET Core applications if your operating system is not up-to-date with the latest service packs.
|
||||
|
||||
If your platform is not listed above, there is still a chance you can manually build it by following the instructions below.
|
||||
|
||||
+1
-3
@@ -25,7 +25,6 @@
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>False</Optimize>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<EnableLLVM>false</EnableLLVM>
|
||||
<AndroidManagedSymbols>false</AndroidManagedSymbols>
|
||||
<AndroidUseSharedRuntime>true</AndroidUseSharedRuntime>
|
||||
<EmbedAssembliesIntoApk>false</EmbedAssembliesIntoApk>
|
||||
@@ -34,7 +33,6 @@
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<DebugType>None</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<EnableLLVM>true</EnableLLVM>
|
||||
<AndroidManagedSymbols>false</AndroidManagedSymbols>
|
||||
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
|
||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
||||
@@ -54,6 +52,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.221.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.221.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.229.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<AssemblyName>osu.Android</AssemblyName>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a</AndroidSupportedAbis>
|
||||
<EnableLLVM>false</EnableLLVM> <!-- This currently causes random lockups during gameplay. https://github.com/mono/mono/issues/18973 -->
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<MandroidI18n>cjk;mideast;other;rare;west</MandroidI18n>
|
||||
@@ -52,4 +53,4 @@
|
||||
<AndroidResource Include="Resources\drawable\lazer.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -29,6 +29,12 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestBananaShower()
|
||||
{
|
||||
AddUntilStep("player is done", () => !Player.ValidForResume);
|
||||
}
|
||||
|
||||
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset)
|
||||
{
|
||||
var beatmap = new Beatmap
|
||||
@@ -40,7 +46,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
}
|
||||
};
|
||||
|
||||
beatmap.HitObjects.Add(new BananaShower { StartTime = 200, Duration = 5000, NewCombo = true });
|
||||
beatmap.HitObjects.Add(new BananaShower { StartTime = 200, Duration = 3000, NewCombo = true });
|
||||
|
||||
return beatmap;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
AddStep("show droplet", () => SetContents(createDrawableDroplet));
|
||||
|
||||
AddStep("show tiny droplet", () => SetContents(createDrawableTinyDroplet));
|
||||
|
||||
foreach (FruitVisualRepresentation rep in Enum.GetValues(typeof(FruitVisualRepresentation)))
|
||||
AddStep($"show hyperdash {rep}", () => SetContents(() => createDrawable(rep, true)));
|
||||
}
|
||||
|
||||
private Drawable createDrawableTinyDroplet()
|
||||
@@ -82,9 +85,13 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
};
|
||||
}
|
||||
|
||||
private Drawable createDrawable(FruitVisualRepresentation rep)
|
||||
private Drawable createDrawable(FruitVisualRepresentation rep, bool hyperdash = false)
|
||||
{
|
||||
Fruit fruit = new TestCatchFruit(rep) { Scale = 1.5f };
|
||||
Fruit fruit = new TestCatchFruit(rep)
|
||||
{
|
||||
Scale = 1.5f,
|
||||
HyperDashTarget = hyperdash ? new Banana() : null
|
||||
};
|
||||
|
||||
return new DrawableFruit(fruit)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
// 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 System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Catch.Objects;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Tests.Visual;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
public class TestSceneJuiceStream : PlayerTestScene
|
||||
{
|
||||
public TestSceneJuiceStream()
|
||||
: base(new CatchRuleset())
|
||||
{
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestJuiceStreamEndingCombo()
|
||||
{
|
||||
AddUntilStep("player is done", () => !Player.ValidForResume);
|
||||
}
|
||||
|
||||
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) => new Beatmap
|
||||
{
|
||||
BeatmapInfo = new BeatmapInfo
|
||||
{
|
||||
BaseDifficulty = new BeatmapDifficulty { CircleSize = 5, SliderMultiplier = 2 },
|
||||
Ruleset = ruleset
|
||||
},
|
||||
HitObjects = new List<HitObject>
|
||||
{
|
||||
new JuiceStream
|
||||
{
|
||||
X = 0.5f,
|
||||
Path = new SliderPath(PathType.Linear, new[]
|
||||
{
|
||||
Vector2.Zero,
|
||||
new Vector2(0, 100)
|
||||
}),
|
||||
StartTime = 200
|
||||
},
|
||||
new Banana
|
||||
{
|
||||
X = 0.5f,
|
||||
StartTime = 1000,
|
||||
NewCombo = true
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
// 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.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Objects
|
||||
@@ -11,6 +12,8 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
|
||||
public override bool LastInCombo => true;
|
||||
|
||||
public override Judgement CreateJudgement() => new IgnoreJudgement();
|
||||
|
||||
protected override void CreateNestedHitObjects()
|
||||
{
|
||||
base.CreateNestedHitObjects();
|
||||
|
||||
@@ -7,9 +7,7 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Rulesets.Catch.Objects.Drawables.Pieces;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
@@ -64,15 +62,24 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
|
||||
if (hitObject.HyperDash)
|
||||
{
|
||||
AddInternal(new Pulp
|
||||
AddInternal(new Circle
|
||||
{
|
||||
RelativePositionAxes = Axes.Both,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
AccentColour = { Value = Color4.Red },
|
||||
Blending = BlendingParameters.Additive,
|
||||
Alpha = 0.5f,
|
||||
Scale = new Vector2(1.333f)
|
||||
BorderColour = Color4.Red,
|
||||
BorderThickness = 12f * RADIUS_ADJUST,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
AlwaysPresent = true,
|
||||
Alpha = 0.3f,
|
||||
Blending = BlendingParameters.Additive,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.Red,
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Rulesets.Catch.UI;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
|
||||
@@ -19,6 +20,8 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
/// </summary>
|
||||
private const float base_scoring_distance = 100;
|
||||
|
||||
public override Judgement CreateJudgement() => new IgnoreJudgement();
|
||||
|
||||
public int RepeatCount { get; set; }
|
||||
|
||||
public double Velocity;
|
||||
|
||||
@@ -9,6 +9,7 @@ using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Rulesets.Catch.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Skinning
|
||||
@@ -49,6 +50,23 @@ namespace osu.Game.Rulesets.Catch.Skinning
|
||||
Origin = Anchor.Centre,
|
||||
},
|
||||
};
|
||||
|
||||
if (drawableCatchObject.HitObject.HyperDash)
|
||||
{
|
||||
var hyperDash = new Sprite
|
||||
{
|
||||
Texture = skin.GetTexture(lookupName),
|
||||
Colour = Color4.Red,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Blending = BlendingParameters.Additive,
|
||||
Depth = 1,
|
||||
Alpha = 0.7f,
|
||||
Scale = new Vector2(1.2f)
|
||||
};
|
||||
|
||||
AddInternal(hyperDash);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
||||
@@ -50,6 +50,9 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
|
||||
public void OnResult(DrawableCatchHitObject fruit, JudgementResult result)
|
||||
{
|
||||
if (result.Judgement is IgnoreJudgement)
|
||||
return;
|
||||
|
||||
void runAfterLoaded(Action action)
|
||||
{
|
||||
if (lastPlateableFruit == null)
|
||||
@@ -89,7 +92,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
|
||||
if (fruit.HitObject.LastInCombo)
|
||||
{
|
||||
if (((CatchJudgement)result.Judgement).ShouldExplodeFor(result))
|
||||
if (result.Judgement is CatchJudgement catchJudgement && catchJudgement.ShouldExplodeFor(result))
|
||||
runAfterLoaded(() => MovableCatcher.Explode());
|
||||
else
|
||||
MovableCatcher.Drop();
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
// 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.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Judgements
|
||||
{
|
||||
public class HoldNoteJudgement : ManiaJudgement
|
||||
{
|
||||
public override bool AffectsCombo => false;
|
||||
|
||||
protected override int NumericResultFor(HitResult result) => 0;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
// 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.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Objects
|
||||
@@ -8,5 +9,7 @@ namespace osu.Game.Rulesets.Mania.Objects
|
||||
public class BarLine : ManiaHitObject, IBarLine
|
||||
{
|
||||
public bool Major { get; set; }
|
||||
|
||||
public override Judgement CreateJudgement() => new IgnoreJudgement();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,8 +71,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
{
|
||||
}
|
||||
|
||||
protected override void UpdateStateTransforms(ArmedState state)
|
||||
{
|
||||
}
|
||||
protected override void UpdateStateTransforms(ArmedState state) => this.FadeOut(150);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Mania.Judgements;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
@@ -103,7 +102,7 @@ namespace osu.Game.Rulesets.Mania.Objects
|
||||
}
|
||||
}
|
||||
|
||||
public override Judgement CreateJudgement() => new HoldNoteJudgement();
|
||||
public override Judgement CreateJudgement() => new IgnoreJudgement();
|
||||
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
// 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.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Judgements
|
||||
{
|
||||
public class OsuSliderTailJudgement : OsuJudgement
|
||||
{
|
||||
public override bool AffectsCombo => false;
|
||||
|
||||
protected override int NumericResultFor(HitResult result) => 0;
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
private const int spacing = 32;
|
||||
private const double preempt = 800;
|
||||
|
||||
public override bool RemoveWhenNotAlive => false;
|
||||
|
||||
/// <summary>
|
||||
/// The start time of <see cref="Start"/>.
|
||||
/// </summary>
|
||||
@@ -79,27 +81,31 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
drawableObject.HitObject.DefaultsApplied += scheduleRefresh;
|
||||
}
|
||||
|
||||
private void scheduleRefresh() => Scheduler.AddOnce(refresh);
|
||||
private void scheduleRefresh()
|
||||
{
|
||||
Scheduler.AddOnce(refresh);
|
||||
}
|
||||
|
||||
private void refresh()
|
||||
{
|
||||
ClearInternal();
|
||||
|
||||
if (End == null)
|
||||
return;
|
||||
|
||||
OsuHitObject osuStart = Start.HitObject;
|
||||
OsuHitObject osuEnd = End.HitObject;
|
||||
double startTime = osuStart.GetEndTime();
|
||||
|
||||
if (osuEnd.NewCombo)
|
||||
return;
|
||||
LifetimeStart = startTime;
|
||||
|
||||
if (osuStart is Spinner || osuEnd is Spinner)
|
||||
OsuHitObject osuEnd = End?.HitObject;
|
||||
|
||||
if (osuEnd == null || osuEnd.NewCombo || osuStart is Spinner || osuEnd is Spinner)
|
||||
{
|
||||
// ensure we always set a lifetime for full LifetimeManagementContainer benefits
|
||||
LifetimeEnd = LifetimeStart;
|
||||
return;
|
||||
}
|
||||
|
||||
Vector2 startPosition = osuStart.EndPosition;
|
||||
Vector2 endPosition = osuEnd.Position;
|
||||
double startTime = osuStart.GetEndTime();
|
||||
double endTime = osuEnd.StartTime;
|
||||
|
||||
Vector2 distanceVector = endPosition - startPosition;
|
||||
@@ -107,6 +113,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
float rotation = (float)(Math.Atan2(distanceVector.Y, distanceVector.X) * (180 / Math.PI));
|
||||
double duration = endTime - startTime;
|
||||
|
||||
double? firstTransformStartTime = null;
|
||||
double finalTransformEndTime = startTime;
|
||||
|
||||
for (int d = (int)(spacing * 1.5); d < distance - spacing; d += spacing)
|
||||
{
|
||||
float fraction = (float)d / distance;
|
||||
@@ -125,16 +134,23 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
Scale = new Vector2(1.5f * osuEnd.Scale),
|
||||
});
|
||||
|
||||
if (firstTransformStartTime == null)
|
||||
firstTransformStartTime = fadeInTime;
|
||||
|
||||
using (fp.BeginAbsoluteSequence(fadeInTime))
|
||||
{
|
||||
fp.FadeIn(osuEnd.TimeFadeIn);
|
||||
fp.ScaleTo(osuEnd.Scale, osuEnd.TimeFadeIn, Easing.Out);
|
||||
fp.MoveTo(pointEndPosition, osuEnd.TimeFadeIn, Easing.Out);
|
||||
fp.Delay(fadeOutTime - fadeInTime).FadeOut(osuEnd.TimeFadeIn);
|
||||
}
|
||||
|
||||
fp.Expire(true);
|
||||
finalTransformEndTime = fadeOutTime + osuEnd.TimeFadeIn;
|
||||
}
|
||||
}
|
||||
|
||||
// todo: use Expire() on FollowPoints and take lifetime from them when https://github.com/ppy/osu-framework/issues/3300 is fixed.
|
||||
LifetimeStart = firstTransformStartTime ?? startTime;
|
||||
LifetimeEnd = finalTransformEndTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
/// <summary>
|
||||
/// Visualises connections between <see cref="DrawableOsuHitObject"/>s.
|
||||
/// </summary>
|
||||
public class FollowPointRenderer : CompositeDrawable
|
||||
public class FollowPointRenderer : LifetimeManagementContainer
|
||||
{
|
||||
/// <summary>
|
||||
/// All the <see cref="FollowPointConnection"/>s contained by this <see cref="FollowPointRenderer"/>.
|
||||
@@ -45,8 +45,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
/// <returns>The index of <paramref name="connection"/> in <see cref="connections"/>.</returns>
|
||||
private void addConnection(FollowPointConnection connection)
|
||||
{
|
||||
AddInternal(connection);
|
||||
|
||||
// Groups are sorted by their start time when added such that the index can be used to post-process other surrounding connections
|
||||
int index = connections.AddInPlace(connection, Comparer<FollowPointConnection>.Create((g1, g2) => g1.StartTime.Value.CompareTo(g2.StartTime.Value)));
|
||||
|
||||
@@ -74,6 +72,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
FollowPointConnection previousConnection = connections[index - 1];
|
||||
previousConnection.End = connection.Start;
|
||||
}
|
||||
|
||||
AddInternal(connection);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Osu.Judgements;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Objects
|
||||
@@ -23,7 +22,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
pathVersion.BindValueChanged(_ => Position = slider.EndPosition);
|
||||
}
|
||||
|
||||
public override Judgement CreateJudgement() => new OsuSliderTailJudgement();
|
||||
public override Judgement CreateJudgement() => new IgnoreJudgement();
|
||||
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ using osu.Framework.Allocation;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Rulesets.Taiko.Judgements;
|
||||
using osu.Game.Rulesets.Taiko.Objects;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Tests.Visual;
|
||||
@@ -28,7 +27,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
||||
public void TestZeroTickTimeOffsets()
|
||||
{
|
||||
AddUntilStep("gameplay finished", () => Player.ScoreProcessor.HasCompleted);
|
||||
AddAssert("all tick offsets are 0", () => Player.Results.Where(r => r.Judgement is TaikoSwellTickJudgement).All(r => r.TimeOffset == 0));
|
||||
AddAssert("all tick offsets are 0", () => Player.Results.Where(r => r.HitObject is SwellTick).All(r => r.TimeOffset == 0));
|
||||
}
|
||||
|
||||
protected override bool Autoplay => true;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// 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.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Objects
|
||||
@@ -8,5 +9,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
|
||||
public class BarLine : TaikoHitObject, IBarLine
|
||||
{
|
||||
public bool Major { get; set; }
|
||||
|
||||
public override Judgement CreateJudgement() => new IgnoreJudgement();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,5 +54,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
Alpha = 0.75f
|
||||
});
|
||||
}
|
||||
|
||||
protected override void UpdateStateTransforms(ArmedState state) => this.FadeOut(150);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,13 +3,12 @@
|
||||
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Rulesets.Taiko.Judgements;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Objects
|
||||
{
|
||||
public class SwellTick : TaikoHitObject
|
||||
{
|
||||
public override Judgement CreateJudgement() => new TaikoSwellTickJudgement();
|
||||
public override Judgement CreateJudgement() => new IgnoreJudgement();
|
||||
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
}
|
||||
|
||||
@@ -154,6 +154,7 @@ namespace osu.Game.Tests.Gameplay
|
||||
private class JudgeableHitObject : HitObject
|
||||
{
|
||||
public override Judgement CreateJudgement() => new Judgement();
|
||||
protected override HitWindows CreateHitWindows() => new HitWindows();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Objects.Legacy;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Skinning;
|
||||
using osu.Game.Tests.Visual;
|
||||
@@ -78,7 +78,7 @@ namespace osu.Game.Tests.Gameplay
|
||||
}
|
||||
}
|
||||
|
||||
private class TestHitObjectWithCombo : HitObject, IHasComboInformation
|
||||
private class TestHitObjectWithCombo : ConvertHitObject, IHasComboInformation
|
||||
{
|
||||
public bool NewCombo { get; } = false;
|
||||
public int ComboOffset { get; } = 0;
|
||||
|
||||
@@ -20,6 +20,7 @@ using osu.Game.Rulesets.Difficulty;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Objects.Legacy;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.UI;
|
||||
@@ -289,7 +290,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
#region HitObject
|
||||
|
||||
private class TestHitObject : HitObject, IHasEndTime
|
||||
private class TestHitObject : ConvertHitObject, IHasEndTime
|
||||
{
|
||||
public double EndTime { get; set; }
|
||||
|
||||
|
||||
@@ -2,16 +2,17 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Rulesets.Catch.Scoring;
|
||||
using osu.Game.Rulesets.Mania.Scoring;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Osu.Scoring;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Rulesets.Taiko.Scoring;
|
||||
@@ -43,6 +44,22 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddRepeatStep("New max negative", () => newJudgement(-hitWindows.WindowFor(HitResult.Meh)), 20);
|
||||
AddRepeatStep("New max positive", () => newJudgement(hitWindows.WindowFor(HitResult.Meh)), 20);
|
||||
AddStep("New fixed judgement (50ms)", () => newJudgement(50));
|
||||
|
||||
AddStep("Judgement barrage", () =>
|
||||
{
|
||||
int runCount = 0;
|
||||
|
||||
ScheduledDelegate del = null;
|
||||
|
||||
del = Scheduler.AddDelayed(() =>
|
||||
{
|
||||
newJudgement(runCount++ / 10f);
|
||||
|
||||
if (runCount == 500)
|
||||
// ReSharper disable once AccessToModifiedClosure
|
||||
del?.Cancel();
|
||||
}, 10, true);
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -13,6 +13,8 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics;
|
||||
using osuTK;
|
||||
using JetBrains.Annotations;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@@ -30,6 +32,8 @@ namespace osu.Game.Tests.Visual.Online
|
||||
private readonly BindableBool showDeleted = new BindableBool();
|
||||
private readonly Container content;
|
||||
|
||||
private TestCommentsPage commentsPage;
|
||||
|
||||
public TestSceneCommentsPage()
|
||||
{
|
||||
Add(new FillFlowContainer
|
||||
@@ -57,15 +61,29 @@ namespace osu.Game.Tests.Visual.Online
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
AddStep("load comments", () => createPage(getCommentBundle()));
|
||||
AddStep("load empty comments", () => createPage(getEmptyCommentBundle()));
|
||||
[Test]
|
||||
public void TestAppendDuplicatedComment()
|
||||
{
|
||||
AddStep("Create page", () => createPage(getCommentBundle()));
|
||||
AddAssert("Dictionary length is 10", () => commentsPage?.DictionaryLength == 10);
|
||||
AddStep("Append existing comment", () => commentsPage?.AppendComments(getCommentSubBundle()));
|
||||
AddAssert("Dictionary length is 10", () => commentsPage?.DictionaryLength == 10);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestEmptyBundle()
|
||||
{
|
||||
AddStep("Create page", () => createPage(getEmptyCommentBundle()));
|
||||
AddAssert("Dictionary length is 0", () => commentsPage?.DictionaryLength == 0);
|
||||
}
|
||||
|
||||
private void createPage(CommentBundle commentBundle)
|
||||
{
|
||||
commentsPage = null;
|
||||
content.Clear();
|
||||
content.Add(new CommentsPage(commentBundle)
|
||||
content.Add(commentsPage = new TestCommentsPage(commentBundle)
|
||||
{
|
||||
ShowDeleted = { BindTarget = showDeleted }
|
||||
});
|
||||
@@ -182,5 +200,33 @@ namespace osu.Game.Tests.Visual.Online
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
private CommentBundle getCommentSubBundle() => new CommentBundle
|
||||
{
|
||||
Comments = new List<Comment>
|
||||
{
|
||||
new Comment
|
||||
{
|
||||
Id = 1,
|
||||
Message = "Simple test comment",
|
||||
LegacyName = "TestUser1",
|
||||
CreatedAt = DateTimeOffset.Now,
|
||||
VotesCount = 5
|
||||
},
|
||||
},
|
||||
IncludedComments = new List<Comment>(),
|
||||
};
|
||||
|
||||
private class TestCommentsPage : CommentsPage
|
||||
{
|
||||
public TestCommentsPage(CommentBundle commentBundle)
|
||||
: base(commentBundle)
|
||||
{
|
||||
}
|
||||
|
||||
public new void AppendComments([NotNull] CommentBundle bundle) => base.AppendComments(bundle);
|
||||
|
||||
public int DictionaryLength => CommentDictionary.Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Overlays.Direct;
|
||||
using osu.Game.Rulesets;
|
||||
@@ -14,7 +15,8 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
public class TestSceneDirectPanel : OsuTestScene
|
||||
[Cached(typeof(IPreviewTrackOwner))]
|
||||
public class TestSceneDirectPanel : OsuTestScene, IPreviewTrackOwner
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
|
||||
@@ -7,6 +7,8 @@ using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Overlays.Comments;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Overlays;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@@ -18,6 +20,9 @@ namespace osu.Game.Tests.Visual.Online
|
||||
typeof(VotePill)
|
||||
};
|
||||
|
||||
[Cached]
|
||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
||||
|
||||
private VotePill votePill;
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -13,6 +13,7 @@ using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Catch;
|
||||
using osu.Game.Rulesets.Mania;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Legacy;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Taiko;
|
||||
@@ -194,7 +195,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
public new BufferedWedgeInfo Info => base.Info;
|
||||
}
|
||||
|
||||
private class TestHitObject : HitObject, IHasPosition
|
||||
private class TestHitObject : ConvertHitObject, IHasPosition
|
||||
{
|
||||
public float X { get; } = 0;
|
||||
public float Y { get; } = 0;
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
// 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 System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Home.Friends;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
public class TestSceneUserListToolbar : OsuTestScene
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
typeof(UserSortTabControl),
|
||||
typeof(OverlaySortTabControl<>),
|
||||
typeof(OverlayPanelDisplayStyleControl),
|
||||
typeof(UserListToolbar),
|
||||
};
|
||||
|
||||
[Cached]
|
||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
|
||||
|
||||
public TestSceneUserListToolbar()
|
||||
{
|
||||
UserListToolbar toolbar;
|
||||
OsuSpriteText sort;
|
||||
OsuSpriteText displayStyle;
|
||||
|
||||
Add(toolbar = new UserListToolbar
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
});
|
||||
|
||||
Add(new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, 5),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
sort = new OsuSpriteText(),
|
||||
displayStyle = new OsuSpriteText()
|
||||
}
|
||||
});
|
||||
|
||||
toolbar.SortCriteria.BindValueChanged(criteria => sort.Text = $"Criteria: {criteria.NewValue}", true);
|
||||
toolbar.DisplayStyle.BindValueChanged(style => displayStyle.Text = $"Style: {style.NewValue}", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,8 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
{
|
||||
public readonly Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
|
||||
|
||||
protected override double LoadDelay => 500;
|
||||
|
||||
[Resolved]
|
||||
private BeatmapManager beatmaps { get; set; }
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ using System.Reflection;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.Overlays.Settings;
|
||||
|
||||
namespace osu.Game.Configuration
|
||||
@@ -105,7 +104,8 @@ namespace osu.Game.Configuration
|
||||
var dropdownType = typeof(SettingsEnumDropdown<>).MakeGenericType(bindable.GetType().GetGenericArguments()[0]);
|
||||
var dropdown = (Drawable)Activator.CreateInstance(dropdownType);
|
||||
|
||||
dropdown.GetType().GetProperty(nameof(IHasCurrentValue<object>.Current))?.SetValue(dropdown, obj);
|
||||
dropdownType.GetProperty(nameof(SettingsDropdown<object>.LabelText))?.SetValue(dropdown, attr.Label);
|
||||
dropdownType.GetProperty(nameof(SettingsDropdown<object>.Bindable))?.SetValue(dropdown, bindable);
|
||||
|
||||
yield return dropdown;
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
MainContents.Size = new Vector2(Math.Min(100, Math.Min(DrawWidth, DrawHeight) * 0.25f));
|
||||
MainContents.Size = new Vector2(Math.Clamp(Math.Min(DrawWidth, DrawHeight) * 0.25f, 30, 100));
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
private void rotate()
|
||||
{
|
||||
spinner.Spin(spin_duration * 4, RotationDirection.Clockwise);
|
||||
spinner.Spin(spin_duration * 3.5f, RotationDirection.Clockwise);
|
||||
|
||||
MainContents.RotateTo(0).Then()
|
||||
.RotateTo(90, spin_duration, Easing.InOutQuart).Then()
|
||||
|
||||
@@ -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.
|
||||
|
||||
using osu.Game.Online.Multiplayer;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class GetRoomRequest : APIRequest<Room>
|
||||
{
|
||||
private readonly int roomId;
|
||||
|
||||
public GetRoomRequest(int roomId)
|
||||
{
|
||||
this.roomId = roomId;
|
||||
}
|
||||
|
||||
protected override string Target => $"rooms/{roomId}";
|
||||
}
|
||||
}
|
||||
@@ -65,9 +65,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
|
||||
public void MapObjects(BeatmapManager beatmaps, RulesetStore rulesets)
|
||||
{
|
||||
// If we don't have an api beatmap, the request occurred as a result of room creation, so we can query the local beatmap instead
|
||||
// Todo: Is this a bug? Room creation only returns the beatmap ID
|
||||
Beatmap.Value = apiBeatmap == null ? beatmaps.QueryBeatmap(b => b.OnlineBeatmapID == BeatmapID) : apiBeatmap.ToBeatmap(rulesets);
|
||||
Beatmap.Value = apiBeatmap.ToBeatmap(rulesets);
|
||||
Ruleset.Value = rulesets.GetRuleset(RulesetID);
|
||||
|
||||
Ruleset rulesetInstance = Ruleset.Value.CreateInstance();
|
||||
|
||||
@@ -59,8 +59,8 @@ namespace osu.Game.Online.Multiplayer
|
||||
public Bindable<int?> MaxParticipants { get; private set; } = new Bindable<int?>();
|
||||
|
||||
[Cached]
|
||||
[JsonIgnore]
|
||||
public BindableList<User> Participants { get; private set; } = new BindableList<User>();
|
||||
[JsonProperty("recent_participants")]
|
||||
public BindableList<User> RecentParticipants { get; private set; } = new BindableList<User>();
|
||||
|
||||
[Cached]
|
||||
public Bindable<int> ParticipantCount { get; private set; } = new Bindable<int>();
|
||||
@@ -118,25 +118,16 @@ namespace osu.Game.Online.Multiplayer
|
||||
if (DateTimeOffset.Now >= EndDate.Value)
|
||||
Status.Value = new RoomStatusEnded();
|
||||
|
||||
// transfer local beatmaps across to ensure we have Metadata available (CreateRoomRequest does not give us metadata as expected)
|
||||
foreach (var item in other.Playlist)
|
||||
{
|
||||
var localItem = Playlist.FirstOrDefault(i => i.BeatmapID == item.BeatmapID);
|
||||
|
||||
if (localItem != null)
|
||||
item.Beatmap.Value.Metadata = localItem.Beatmap.Value.Metadata;
|
||||
}
|
||||
|
||||
if (!Playlist.SequenceEqual(other.Playlist))
|
||||
{
|
||||
Playlist.Clear();
|
||||
Playlist.AddRange(other.Playlist);
|
||||
}
|
||||
|
||||
if (!Participants.SequenceEqual(other.Participants))
|
||||
if (!RecentParticipants.SequenceEqual(other.RecentParticipants))
|
||||
{
|
||||
Participants.Clear();
|
||||
Participants.AddRange(other.Participants);
|
||||
RecentParticipants.Clear();
|
||||
RecentParticipants.AddRange(other.RecentParticipants);
|
||||
}
|
||||
|
||||
Position = other.Position;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// 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.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Effects;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.BeatmapSet
|
||||
{
|
||||
public class BeatmapSetLayoutSection : Container
|
||||
{
|
||||
public BeatmapSetLayoutSection()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
Masking = true;
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Colour = Color4.Black.Opacity(0.25f),
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Radius = 3,
|
||||
Offset = new Vector2(0f, 1f),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,17 +3,14 @@
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Effects;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.BeatmapSet
|
||||
{
|
||||
@@ -43,14 +40,6 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = base_height;
|
||||
Masking = true;
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Colour = Color4.Black.Opacity(0.25f),
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Radius = 3,
|
||||
Offset = new Vector2(0f, 1f),
|
||||
};
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
{
|
||||
public class ScoresContainer : CompositeDrawable
|
||||
public class ScoresContainer : BeatmapSetLayoutSection
|
||||
{
|
||||
private const int spacing = 15;
|
||||
|
||||
@@ -34,7 +34,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
private readonly LoadingLayer loading;
|
||||
private readonly LeaderboardModSelector modSelector;
|
||||
private readonly NoScoresPlaceholder noScoresPlaceholder;
|
||||
private readonly FillFlowContainer content;
|
||||
private readonly NotSupporterPlaceholder notSupporterPlaceholder;
|
||||
|
||||
[Resolved]
|
||||
@@ -76,15 +75,13 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
|
||||
public ScoresContainer()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
InternalChildren = new Drawable[]
|
||||
AddRange(new Drawable[]
|
||||
{
|
||||
background = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
content = new FillFlowContainer
|
||||
new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
@@ -164,8 +161,8 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@@ -223,7 +220,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
if (Beatmap.Value?.OnlineBeatmapID.HasValue != true || Beatmap.Value.Status <= BeatmapSetOnlineStatus.Pending)
|
||||
{
|
||||
Scores = null;
|
||||
content.Hide();
|
||||
Hide();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -237,7 +234,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
|
||||
notSupporterPlaceholder.Hide();
|
||||
|
||||
content.Show();
|
||||
Show();
|
||||
loading.Show();
|
||||
|
||||
getScoresRequest = new GetScoresRequest(Beatmap.Value, Beatmap.Value.Ruleset, scope.Value, modSelector.SelectedMods);
|
||||
|
||||
@@ -13,6 +13,7 @@ using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Overlays.BeatmapSet;
|
||||
using osu.Game.Overlays.BeatmapSet.Scores;
|
||||
using osu.Game.Overlays.Comments;
|
||||
using osu.Game.Rulesets;
|
||||
using osuTK;
|
||||
|
||||
@@ -40,6 +41,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
OsuScrollContainer scroll;
|
||||
Info info;
|
||||
CommentsSection comments;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@@ -51,29 +53,33 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
ScrollbarVisible = false,
|
||||
Child = new ReverseChildIDFillFlowContainer<Drawable>
|
||||
Child = new ReverseChildIDFillFlowContainer<BeatmapSetLayoutSection>
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, 20),
|
||||
Children = new Drawable[]
|
||||
Children = new[]
|
||||
{
|
||||
new ReverseChildIDFillFlowContainer<Drawable>
|
||||
new BeatmapSetLayoutSection
|
||||
{
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
Child = new ReverseChildIDFillFlowContainer<Drawable>
|
||||
{
|
||||
Header = new Header(),
|
||||
info = new Info()
|
||||
}
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
Header = new Header(),
|
||||
info = new Info()
|
||||
}
|
||||
},
|
||||
},
|
||||
new ScoresContainer
|
||||
{
|
||||
Beatmap = { BindTarget = Header.Picker.Beatmap }
|
||||
}
|
||||
},
|
||||
comments = new CommentsSection()
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -81,6 +87,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
Header.BeatmapSet.BindTo(beatmapSet);
|
||||
info.BeatmapSet.BindTo(beatmapSet);
|
||||
comments.BeatmapSet.BindTo(beatmapSet);
|
||||
|
||||
Header.Picker.Beatmap.ValueChanged += b =>
|
||||
{
|
||||
@@ -143,5 +150,30 @@ namespace osu.Game.Overlays
|
||||
beatmapSet.Value = set;
|
||||
Show();
|
||||
}
|
||||
|
||||
private class CommentsSection : BeatmapSetLayoutSection
|
||||
{
|
||||
public readonly Bindable<BeatmapSetInfo> BeatmapSet = new Bindable<BeatmapSetInfo>();
|
||||
|
||||
public CommentsSection()
|
||||
{
|
||||
CommentsContainer comments;
|
||||
|
||||
Add(comments = new CommentsContainer());
|
||||
|
||||
BeatmapSet.BindValueChanged(beatmapSet =>
|
||||
{
|
||||
if (beatmapSet.NewValue?.OnlineBeatmapSetID is int onlineBeatmapSetID)
|
||||
{
|
||||
Show();
|
||||
comments.ShowComments(CommentableType.Beatmapset, onlineBeatmapSetID);
|
||||
}
|
||||
else
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ using osuTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using System.Net;
|
||||
using osuTK;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
|
||||
namespace osu.Game.Overlays.Changelog
|
||||
{
|
||||
@@ -51,28 +52,27 @@ namespace osu.Game.Overlays.Changelog
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
private void load(OsuColour colours, OverlayColourProvider colourProvider)
|
||||
{
|
||||
foreach (var categoryEntries in Build.ChangelogEntries.GroupBy(b => b.Category).OrderBy(c => c.Key))
|
||||
{
|
||||
ChangelogEntries.Add(new OsuSpriteText
|
||||
{
|
||||
Text = categoryEntries.Key,
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 24),
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 18),
|
||||
Margin = new MarginPadding { Top = 35, Bottom = 15 },
|
||||
});
|
||||
|
||||
var fontLarge = OsuFont.GetFont(size: 18);
|
||||
var fontMedium = OsuFont.GetFont(size: 14);
|
||||
var fontSmall = OsuFont.GetFont(size: 12);
|
||||
var fontLarge = OsuFont.GetFont(size: 16);
|
||||
var fontMedium = OsuFont.GetFont(size: 12);
|
||||
|
||||
foreach (APIChangelogEntry entry in categoryEntries)
|
||||
foreach (var entry in categoryEntries)
|
||||
{
|
||||
var entryColour = entry.Major ? colours.YellowLight : Color4.White;
|
||||
|
||||
LinkFlowContainer title;
|
||||
|
||||
Container titleContainer = new Container
|
||||
var titleContainer = new Container
|
||||
{
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
@@ -83,9 +83,9 @@ namespace osu.Game.Overlays.Changelog
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreRight,
|
||||
Size = new Vector2(fontSmall.Size),
|
||||
Size = new Vector2(10),
|
||||
Icon = entry.Type == ChangelogEntryType.Fix ? FontAwesome.Solid.Check : FontAwesome.Solid.Plus,
|
||||
Colour = entryColour,
|
||||
Colour = entryColour.Opacity(0.5f),
|
||||
Margin = new MarginPadding { Right = 5 },
|
||||
},
|
||||
title = new LinkFlowContainer
|
||||
@@ -123,10 +123,11 @@ namespace osu.Game.Overlays.Changelog
|
||||
});
|
||||
}
|
||||
|
||||
title.AddText(" by ", t =>
|
||||
title.AddText("by ", t =>
|
||||
{
|
||||
t.Font = fontMedium;
|
||||
t.Font = fontMedium.With(italics: true);
|
||||
t.Colour = entryColour;
|
||||
t.Padding = new MarginPadding { Left = 10 };
|
||||
});
|
||||
|
||||
if (entry.GithubUser.UserId != null)
|
||||
@@ -137,7 +138,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
Id = entry.GithubUser.UserId.Value
|
||||
}, t =>
|
||||
{
|
||||
t.Font = fontMedium;
|
||||
t.Font = fontMedium.With(italics: true);
|
||||
t.Colour = entryColour;
|
||||
});
|
||||
}
|
||||
@@ -145,7 +146,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
{
|
||||
title.AddLink(entry.GithubUser.DisplayName, entry.GithubUser.GithubUrl, t =>
|
||||
{
|
||||
t.Font = fontMedium;
|
||||
t.Font = fontMedium.With(italics: true);
|
||||
t.Colour = entryColour;
|
||||
});
|
||||
}
|
||||
@@ -153,7 +154,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
{
|
||||
title.AddText(entry.GithubUser.DisplayName, t =>
|
||||
{
|
||||
t.Font = fontSmall;
|
||||
t.Font = fontMedium.With(italics: true);
|
||||
t.Colour = entryColour;
|
||||
});
|
||||
}
|
||||
@@ -162,7 +163,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
|
||||
if (!string.IsNullOrEmpty(entry.MessageHtml))
|
||||
{
|
||||
TextFlowContainer message = new TextFlowContainer
|
||||
var message = new TextFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
@@ -171,8 +172,8 @@ namespace osu.Game.Overlays.Changelog
|
||||
// todo: use markdown parsing once API returns markdown
|
||||
message.AddText(WebUtility.HtmlDecode(Regex.Replace(entry.MessageHtml, @"<(.|\n)*?>", string.Empty)), t =>
|
||||
{
|
||||
t.Font = fontSmall;
|
||||
t.Colour = new Color4(235, 184, 254, 255);
|
||||
t.Font = fontMedium;
|
||||
t.Colour = colourProvider.Foreground1;
|
||||
});
|
||||
|
||||
ChangelogEntries.Add(message);
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace osu.Game.Overlays.Changelog
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
Direction = FillDirection.Vertical;
|
||||
Padding = new MarginPadding { Bottom = 50 };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Changelog
|
||||
{
|
||||
@@ -24,13 +23,13 @@ namespace osu.Game.Overlays.Changelog
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
DateTime currentDate = DateTime.MinValue;
|
||||
var currentDate = DateTime.MinValue;
|
||||
|
||||
if (entries == null) return;
|
||||
|
||||
foreach (APIChangelogBuild build in entries)
|
||||
foreach (var build in entries)
|
||||
{
|
||||
if (build.CreatedAt.Date != currentDate)
|
||||
{
|
||||
@@ -40,7 +39,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = 2,
|
||||
Colour = new Color4(17, 17, 17, 255),
|
||||
Colour = colourProvider.Background6,
|
||||
Margin = new MarginPadding { Top = 30 },
|
||||
});
|
||||
}
|
||||
@@ -49,10 +48,9 @@ namespace osu.Game.Overlays.Changelog
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Margin = new MarginPadding { Top = 15 },
|
||||
Text = build.CreatedAt.Date.ToString("dd MMM yyyy"),
|
||||
Margin = new MarginPadding { Top = 20 },
|
||||
Text = build.CreatedAt.Date.ToString("dd MMMM yyyy"),
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 24),
|
||||
Colour = OsuColour.FromHex(@"FD5"),
|
||||
});
|
||||
|
||||
currentDate = build.CreatedAt.Date;
|
||||
@@ -68,7 +66,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
Child = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = new Color4(32, 24, 35, 255),
|
||||
Colour = colourProvider.Background6,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
@@ -31,7 +32,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(CancellationToken? cancellation, IAPIProvider api)
|
||||
private void load(CancellationToken? cancellation, IAPIProvider api, OverlayColourProvider colourProvider)
|
||||
{
|
||||
bool complete = false;
|
||||
|
||||
@@ -63,10 +64,14 @@ namespace osu.Game.Overlays.Changelog
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new ChangelogBuildWithNavigation(build) { SelectBuild = SelectBuild },
|
||||
comments = new CommentsContainer
|
||||
new Box
|
||||
{
|
||||
Margin = new MarginPadding { Top = 10 }
|
||||
}
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = 2,
|
||||
Colour = colourProvider.Background6,
|
||||
Margin = new MarginPadding { Top = 30 },
|
||||
},
|
||||
comments = new CommentsContainer()
|
||||
};
|
||||
|
||||
comments.ShowComments(CommentableType.Build, build.Id);
|
||||
@@ -80,6 +85,8 @@ namespace osu.Game.Overlays.Changelog
|
||||
{
|
||||
}
|
||||
|
||||
private OsuSpriteText date;
|
||||
|
||||
protected override FillFlowContainer CreateHeader()
|
||||
{
|
||||
var fill = base.CreateHeader();
|
||||
@@ -89,11 +96,10 @@ namespace osu.Game.Overlays.Changelog
|
||||
existing.Scale = new Vector2(1.25f);
|
||||
existing.Action = null;
|
||||
|
||||
existing.Add(new OsuSpriteText
|
||||
existing.Add(date = new OsuSpriteText
|
||||
{
|
||||
Text = Build.CreatedAt.Date.ToString("dd MMM yyyy"),
|
||||
Text = Build.CreatedAt.Date.ToString("dd MMMM yyyy"),
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 14),
|
||||
Colour = OsuColour.FromHex(@"FD5"),
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Margin = new MarginPadding { Top = 5 },
|
||||
@@ -113,6 +119,12 @@ namespace osu.Game.Overlays.Changelog
|
||||
|
||||
return fill;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
date.Colour = colourProvider.Light1;
|
||||
}
|
||||
}
|
||||
|
||||
private class NavigationIconButton : IconButton
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
using Humanizer;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@@ -16,99 +14,90 @@ using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Changelog
|
||||
{
|
||||
public class UpdateStreamBadge : TabItem<APIUpdateStream>
|
||||
{
|
||||
private const float badge_height = 66.5f;
|
||||
private const float badge_width = 100;
|
||||
private const float transition_duration = 100;
|
||||
|
||||
private readonly ExpandingBar expandingBar;
|
||||
private SampleChannel sampleClick;
|
||||
private SampleChannel sampleHover;
|
||||
|
||||
private readonly FillFlowContainer<SpriteText> text;
|
||||
|
||||
public readonly Bindable<APIUpdateStream> SelectedTab = new Bindable<APIUpdateStream>();
|
||||
|
||||
private readonly Container fadeContainer;
|
||||
private readonly APIUpdateStream stream;
|
||||
|
||||
private Container fadeContainer;
|
||||
private FillFlowContainer<SpriteText> text;
|
||||
private ExpandingBar expandingBar;
|
||||
|
||||
public UpdateStreamBadge(APIUpdateStream stream)
|
||||
: base(stream)
|
||||
{
|
||||
Size = new Vector2(stream.IsFeatured ? badge_width * 2 : badge_width, badge_height);
|
||||
Padding = new MarginPadding(5);
|
||||
|
||||
Child = fadeContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
text = new FillFlowContainer<SpriteText>
|
||||
{
|
||||
AutoSizeAxes = Axes.X,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new[]
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = stream.DisplayName,
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 12),
|
||||
Margin = new MarginPadding { Top = 6 },
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = stream.LatestBuild.DisplayVersion,
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Light, size: 16),
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = stream.LatestBuild.Users > 0 ? $"{stream.LatestBuild.Users:N0} {"user".Pluralize(stream.LatestBuild.Users == 1)} online" : null,
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 10),
|
||||
Colour = new Color4(203, 164, 218, 255),
|
||||
},
|
||||
}
|
||||
},
|
||||
expandingBar = new ExpandingBar
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Colour = stream.Colour,
|
||||
ExpandedSize = 4,
|
||||
CollapsedSize = 2,
|
||||
IsCollapsed = true
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
SelectedTab.BindValueChanged(_ => updateState(), true);
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
sampleClick = audio.Samples.Get(@"UI/generic-select-soft");
|
||||
sampleHover = audio.Samples.Get(@"UI/generic-hover-soft");
|
||||
Size = new Vector2(stream.IsFeatured ? badge_width * 2 : badge_width, 60);
|
||||
Padding = new MarginPadding(5);
|
||||
|
||||
AddRange(new Drawable[]
|
||||
{
|
||||
fadeContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
text = new FillFlowContainer<SpriteText>
|
||||
{
|
||||
AutoSizeAxes = Axes.X,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Vertical,
|
||||
Margin = new MarginPadding { Top = 6 },
|
||||
Children = new[]
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = stream.DisplayName,
|
||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Black),
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = stream.LatestBuild.DisplayVersion,
|
||||
Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular),
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = stream.LatestBuild.Users > 0 ? $"{"user".ToQuantity(stream.LatestBuild.Users, "N0")} online" : null,
|
||||
Font = OsuFont.GetFont(size: 10),
|
||||
Colour = colourProvider.Foreground1
|
||||
},
|
||||
}
|
||||
},
|
||||
expandingBar = new ExpandingBar
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Colour = stream.Colour,
|
||||
ExpandedSize = 4,
|
||||
CollapsedSize = 2,
|
||||
IsCollapsed = true
|
||||
},
|
||||
}
|
||||
},
|
||||
new HoverClickSounds()
|
||||
});
|
||||
|
||||
SelectedTab.BindValueChanged(_ => updateState(), true);
|
||||
}
|
||||
|
||||
protected override void OnActivated() => updateState();
|
||||
|
||||
protected override void OnDeactivated() => updateState();
|
||||
|
||||
protected override bool OnClick(ClickEvent e)
|
||||
{
|
||||
sampleClick?.Play();
|
||||
return base.OnClick(e);
|
||||
}
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
sampleHover?.Play();
|
||||
updateState();
|
||||
|
||||
return base.OnHover(e);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,34 +8,34 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Game.Overlays.Changelog
|
||||
{
|
||||
public class UpdateStreamBadgeArea : TabControl<APIUpdateStream>
|
||||
{
|
||||
public UpdateStreamBadgeArea()
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
|
||||
AddInternal(new Box
|
||||
{
|
||||
Colour = Color4.Black,
|
||||
Alpha = 0.12f,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = colourProvider.Background5,
|
||||
});
|
||||
}
|
||||
|
||||
public void Populate(List<APIUpdateStream> streams)
|
||||
{
|
||||
foreach (APIUpdateStream updateStream in streams)
|
||||
foreach (var updateStream in streams)
|
||||
AddItem(updateStream);
|
||||
}
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
foreach (UpdateStreamBadge streamBadge in TabContainer.Children.OfType<UpdateStreamBadge>())
|
||||
foreach (var streamBadge in TabContainer.Children.OfType<UpdateStreamBadge>())
|
||||
streamBadge.EnableDim();
|
||||
|
||||
return base.OnHover(e);
|
||||
@@ -43,7 +43,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
|
||||
protected override void OnHoverLost(HoverLostEvent e)
|
||||
{
|
||||
foreach (UpdateStreamBadge streamBadge in TabContainer.Children.OfType<UpdateStreamBadge>())
|
||||
foreach (var streamBadge in TabContainer.Children.OfType<UpdateStreamBadge>())
|
||||
streamBadge.DisableDim();
|
||||
|
||||
base.OnHoverLost(e);
|
||||
|
||||
@@ -13,7 +13,6 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Input.Bindings;
|
||||
using osu.Game.Online.API.Requests;
|
||||
@@ -42,14 +41,14 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio, OsuColour colour)
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = colour.PurpleDarkAlternative,
|
||||
Colour = ColourProvider.Background4,
|
||||
},
|
||||
new OsuScrollContainer
|
||||
{
|
||||
|
||||
@@ -109,6 +109,7 @@ namespace osu.Game.Overlays.Comments
|
||||
|
||||
public enum CommentsSortCriteria
|
||||
{
|
||||
[System.ComponentModel.Description(@"Recent")]
|
||||
New,
|
||||
Old,
|
||||
Top
|
||||
|
||||
@@ -61,15 +61,15 @@ namespace osu.Game.Overlays.Comments
|
||||
return;
|
||||
}
|
||||
|
||||
appendComments(commentBundle);
|
||||
AppendComments(commentBundle);
|
||||
}
|
||||
|
||||
private DrawableComment getDrawableComment(Comment comment)
|
||||
{
|
||||
if (commentDictionary.TryGetValue(comment.Id, out var existing))
|
||||
if (CommentDictionary.TryGetValue(comment.Id, out var existing))
|
||||
return existing;
|
||||
|
||||
return commentDictionary[comment.Id] = new DrawableComment(comment)
|
||||
return CommentDictionary[comment.Id] = new DrawableComment(comment)
|
||||
{
|
||||
ShowDeleted = { BindTarget = ShowDeleted },
|
||||
Sort = { BindTarget = Sort },
|
||||
@@ -81,31 +81,28 @@ namespace osu.Game.Overlays.Comments
|
||||
{
|
||||
var request = new GetCommentsRequest(CommentableId.Value, Type.Value, Sort.Value, page, drawableComment.Comment.Id);
|
||||
|
||||
request.Success += response => Schedule(() => appendComments(response));
|
||||
request.Success += response => Schedule(() => AppendComments(response));
|
||||
|
||||
api.PerformAsync(request);
|
||||
}
|
||||
|
||||
private readonly Dictionary<long, DrawableComment> commentDictionary = new Dictionary<long, DrawableComment>();
|
||||
protected readonly Dictionary<long, DrawableComment> CommentDictionary = new Dictionary<long, DrawableComment>();
|
||||
|
||||
/// <summary>
|
||||
/// Appends retrieved comments to the subtree rooted of comments in this page.
|
||||
/// </summary>
|
||||
/// <param name="bundle">The bundle of comments to add.</param>
|
||||
private void appendComments([NotNull] CommentBundle bundle)
|
||||
protected void AppendComments([NotNull] CommentBundle bundle)
|
||||
{
|
||||
var orphaned = new List<Comment>();
|
||||
|
||||
foreach (var topLevel in bundle.Comments)
|
||||
addNewComment(topLevel);
|
||||
|
||||
foreach (var child in bundle.IncludedComments)
|
||||
foreach (var comment in bundle.Comments.Concat(bundle.IncludedComments))
|
||||
{
|
||||
// Included comments can contain the parent comment, which already exists in the hierarchy.
|
||||
if (commentDictionary.ContainsKey(child.Id))
|
||||
// Exclude possible duplicated comments.
|
||||
if (CommentDictionary.ContainsKey(comment.Id))
|
||||
continue;
|
||||
|
||||
addNewComment(child);
|
||||
addNewComment(comment);
|
||||
}
|
||||
|
||||
// Comments whose parents were seen later than themselves can now be added.
|
||||
@@ -121,7 +118,7 @@ namespace osu.Game.Overlays.Comments
|
||||
// Comments that have no parent are added as top-level comments to the flow.
|
||||
flow.Add(drawableComment);
|
||||
}
|
||||
else if (commentDictionary.TryGetValue(comment.ParentId.Value, out var parentDrawable))
|
||||
else if (CommentDictionary.TryGetValue(comment.ParentId.Value, out var parentDrawable))
|
||||
{
|
||||
// The comment's parent has already been seen, so the parent<-> child links can be added.
|
||||
comment.ParentComment = parentDrawable.Comment;
|
||||
|
||||
@@ -384,7 +384,7 @@ namespace osu.Game.Overlays.Comments
|
||||
|
||||
protected override void OnExpandedChanged(ValueChangedEvent<bool> expanded)
|
||||
{
|
||||
text.Text = $@"{(expanded.NewValue ? "[+]" : "[-]")} replies ({count})";
|
||||
text.Text = $@"{(expanded.NewValue ? "[-]" : "[+]")} replies ({count})";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,9 @@ namespace osu.Game.Overlays.Comments
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private OverlayColourProvider colourProvider { get; set; }
|
||||
|
||||
private readonly Comment comment;
|
||||
private Box background;
|
||||
private Box hoverLayer;
|
||||
@@ -68,7 +71,7 @@ namespace osu.Game.Overlays.Comments
|
||||
base.LoadComplete();
|
||||
isVoted.Value = comment.IsVoted;
|
||||
votesCount.Value = comment.VotesCount;
|
||||
isVoted.BindValueChanged(voted => background.Colour = voted.NewValue ? AccentColour : OsuColour.Gray(0.05f), true);
|
||||
isVoted.BindValueChanged(voted => background.Colour = voted.NewValue ? AccentColour : colourProvider.Background6, true);
|
||||
votesCount.BindValueChanged(count => votesCounter.Text = $"+{count.NewValue}", true);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
// 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.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osuTK;
|
||||
using osu.Framework.Bindables;
|
||||
|
||||
namespace osu.Game.Overlays.Home.Friends
|
||||
{
|
||||
public class UserListToolbar : CompositeDrawable
|
||||
{
|
||||
public Bindable<UserSortCriteria> SortCriteria => sortControl.Current;
|
||||
|
||||
public Bindable<OverlayPanelDisplayStyle> DisplayStyle => styleControl.Current;
|
||||
|
||||
private readonly UserSortTabControl sortControl;
|
||||
private readonly OverlayPanelDisplayStyleControl styleControl;
|
||||
|
||||
public UserListToolbar()
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
AddInternal(new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Spacing = new Vector2(10, 0),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
sortControl = new UserSortTabControl
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
},
|
||||
styleControl = new OverlayPanelDisplayStyleControl
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace osu.Game.Overlays.Home.Friends
|
||||
{
|
||||
public class UserSortTabControl : OverlaySortTabControl<UserSortCriteria>
|
||||
{
|
||||
}
|
||||
|
||||
public enum UserSortCriteria
|
||||
{
|
||||
[Description(@"Recently Active")]
|
||||
LastVisit,
|
||||
Rank,
|
||||
Username
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
// 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.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osuTK;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Framework.Allocation;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class OverlayPanelDisplayStyleControl : OsuTabControl<OverlayPanelDisplayStyle>
|
||||
{
|
||||
protected override Dropdown<OverlayPanelDisplayStyle> CreateDropdown() => null;
|
||||
|
||||
protected override TabItem<OverlayPanelDisplayStyle> CreateTabItem(OverlayPanelDisplayStyle value) => new PanelDisplayTabItem(value);
|
||||
|
||||
protected override bool AddEnumEntriesAutomatically => false;
|
||||
|
||||
public OverlayPanelDisplayStyleControl()
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
AddTabItem(new PanelDisplayTabItem(OverlayPanelDisplayStyle.Card)
|
||||
{
|
||||
Icon = FontAwesome.Solid.Square
|
||||
});
|
||||
AddTabItem(new PanelDisplayTabItem(OverlayPanelDisplayStyle.List)
|
||||
{
|
||||
Icon = FontAwesome.Solid.Bars
|
||||
});
|
||||
}
|
||||
|
||||
protected override TabFillFlowContainer CreateTabFlow() => new TabFillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal
|
||||
};
|
||||
|
||||
private class PanelDisplayTabItem : TabItem<OverlayPanelDisplayStyle>, IHasTooltip
|
||||
{
|
||||
public IconUsage Icon
|
||||
{
|
||||
set => icon.Icon = value;
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
private OverlayColourProvider colourProvider { get; set; }
|
||||
|
||||
public string TooltipText => $@"{Value} view";
|
||||
|
||||
private readonly SpriteIcon icon;
|
||||
|
||||
public PanelDisplayTabItem(OverlayPanelDisplayStyle value)
|
||||
: base(value)
|
||||
{
|
||||
Size = new Vector2(11);
|
||||
AddRange(new Drawable[]
|
||||
{
|
||||
icon = new SpriteIcon
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
FillMode = FillMode.Fit
|
||||
},
|
||||
new HoverClickSounds()
|
||||
});
|
||||
}
|
||||
|
||||
protected override void OnActivated() => updateState();
|
||||
|
||||
protected override void OnDeactivated() => updateState();
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
updateState();
|
||||
return base.OnHover(e);
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(HoverLostEvent e)
|
||||
{
|
||||
updateState();
|
||||
base.OnHoverLost(e);
|
||||
}
|
||||
|
||||
private void updateState() => icon.Colour = Active.Value || IsHovered ? colourProvider.Light1 : Color4.White;
|
||||
}
|
||||
}
|
||||
|
||||
public enum OverlayPanelDisplayStyle
|
||||
{
|
||||
Card,
|
||||
List
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,8 @@ using osu.Game.Graphics.Sprites;
|
||||
using osuTK.Graphics;
|
||||
using osu.Game.Overlays.Comments;
|
||||
using JetBrains.Annotations;
|
||||
using System;
|
||||
using osu.Framework.Extensions;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
@@ -132,7 +134,7 @@ namespace osu.Game.Overlays
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Font = OsuFont.GetFont(size: 12),
|
||||
Text = value.ToString()
|
||||
Text = (value as Enum)?.GetDescription() ?? value.ToString()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -138,6 +138,12 @@ namespace osu.Game.Overlays
|
||||
Country.Value = requested;
|
||||
}
|
||||
|
||||
public void ShowSpotlights()
|
||||
{
|
||||
Scope.Value = RankingsScope.Spotlights;
|
||||
Show();
|
||||
}
|
||||
|
||||
private void loadNewContent()
|
||||
{
|
||||
loading.Show();
|
||||
|
||||
@@ -22,11 +22,6 @@ namespace osu.Game.Overlays.Settings.Sections.Debug
|
||||
Bindable = frameworkConfig.GetBindable<bool>(FrameworkSetting.ShowLogOverlay)
|
||||
},
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = "Performance logging",
|
||||
Bindable = config.GetBindable<bool>(DebugSetting.PerformanceLogging)
|
||||
},
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = "Bypass front-to-back render pass",
|
||||
Bindable = config.GetBindable<bool>(DebugSetting.BypassFrontToBackPass)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Configuration;
|
||||
|
||||
namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
@@ -24,6 +25,11 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
LabelText = "Frame limiter",
|
||||
Bindable = config.GetBindable<FrameSync>(FrameworkSetting.FrameSync)
|
||||
},
|
||||
new SettingsEnumDropdown<ExecutionMode>
|
||||
{
|
||||
LabelText = "Threading mode",
|
||||
Bindable = config.GetBindable<ExecutionMode>(FrameworkSetting.ExecutionMode)
|
||||
},
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = "Show FPS",
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// 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.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Judgements
|
||||
namespace osu.Game.Rulesets.Judgements
|
||||
{
|
||||
public class TaikoSwellTickJudgement : TaikoJudgement
|
||||
public class IgnoreJudgement : Judgement
|
||||
{
|
||||
public override bool AffectsCombo => false;
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace osu.Game.Rulesets.Judgements
|
||||
return -DEFAULT_MAX_HEALTH_INCREASE * 0.01;
|
||||
|
||||
case HitResult.Good:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.3;
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.5;
|
||||
|
||||
case HitResult.Great:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE;
|
||||
|
||||
@@ -99,12 +99,9 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
{
|
||||
var judgement = HitObject.CreateJudgement();
|
||||
|
||||
if (judgement != null)
|
||||
{
|
||||
Result = CreateResult(judgement);
|
||||
if (Result == null)
|
||||
throw new InvalidOperationException($"{GetType().ReadableName()} must provide a {nameof(JudgementResult)} through {nameof(CreateResult)}.");
|
||||
}
|
||||
Result = CreateResult(judgement);
|
||||
if (Result == null)
|
||||
throw new InvalidOperationException($"{GetType().ReadableName()} must provide a {nameof(JudgementResult)} through {nameof(CreateResult)}.");
|
||||
|
||||
loadSamples();
|
||||
}
|
||||
@@ -224,18 +221,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
/// </summary>
|
||||
public event Action<DrawableHitObject, ArmedState> ApplyCustomUpdateState;
|
||||
|
||||
#pragma warning disable 618 // (legacy state management) - can be removed 20200227
|
||||
|
||||
/// <summary>
|
||||
/// Enables automatic transform management of this hitobject. Implementation of transforms should be done in <see cref="UpdateInitialTransforms"/> and <see cref="UpdateStateTransforms"/> only. Rewinding and removing previous states is done automatically.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Going forward, this is the preferred way of implementing <see cref="DrawableHitObject"/>s. Previous functionality
|
||||
/// is offered as a compatibility layer until all rulesets have been migrated across.
|
||||
/// </remarks>
|
||||
[Obsolete("Use UpdateInitialTransforms()/UpdateStateTransforms() instead")] // can be removed 20200227
|
||||
protected virtual bool UseTransformStateManagement => true;
|
||||
|
||||
protected override void ClearInternal(bool disposeChildren = true) => throw new InvalidOperationException($"Should never clear a {nameof(DrawableHitObject)}");
|
||||
|
||||
private void updateState(ArmedState newState, bool force = false)
|
||||
@@ -243,35 +228,28 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
if (State.Value == newState && !force)
|
||||
return;
|
||||
|
||||
if (UseTransformStateManagement)
|
||||
LifetimeEnd = double.MaxValue;
|
||||
|
||||
double transformTime = HitObject.StartTime - InitialLifetimeOffset;
|
||||
|
||||
base.ApplyTransformsAt(double.MinValue, true);
|
||||
base.ClearTransformsAfter(double.MinValue, true);
|
||||
|
||||
using (BeginAbsoluteSequence(transformTime, true))
|
||||
{
|
||||
LifetimeEnd = double.MaxValue;
|
||||
UpdateInitialTransforms();
|
||||
|
||||
double transformTime = HitObject.StartTime - InitialLifetimeOffset;
|
||||
var judgementOffset = Result?.TimeOffset ?? 0;
|
||||
|
||||
base.ApplyTransformsAt(double.MinValue, true);
|
||||
base.ClearTransformsAfter(double.MinValue, true);
|
||||
|
||||
using (BeginAbsoluteSequence(transformTime, true))
|
||||
using (BeginDelayedSequence(InitialLifetimeOffset + judgementOffset, true))
|
||||
{
|
||||
UpdateInitialTransforms();
|
||||
|
||||
var judgementOffset = Result?.TimeOffset ?? 0;
|
||||
|
||||
using (BeginDelayedSequence(InitialLifetimeOffset + judgementOffset, true))
|
||||
{
|
||||
UpdateStateTransforms(newState);
|
||||
state.Value = newState;
|
||||
}
|
||||
UpdateStateTransforms(newState);
|
||||
state.Value = newState;
|
||||
}
|
||||
|
||||
if (state.Value != ArmedState.Idle && LifetimeEnd == double.MaxValue)
|
||||
Expire();
|
||||
}
|
||||
else
|
||||
state.Value = newState;
|
||||
|
||||
UpdateState(newState);
|
||||
if (state.Value != ArmedState.Idle && LifetimeEnd == double.MaxValue || HitObject.HitWindows == null)
|
||||
Expire();
|
||||
|
||||
// apply any custom state overrides
|
||||
ApplyCustomUpdateState?.Invoke(this, newState);
|
||||
@@ -306,30 +284,14 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
|
||||
public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null)
|
||||
{
|
||||
// When we are using automatic state management, parent calls to this should be blocked for safety.
|
||||
if (!UseTransformStateManagement)
|
||||
base.ClearTransformsAfter(time, propagateChildren, targetMember);
|
||||
// Parent calls to this should be blocked for safety, as we are manually handling this in updateState.
|
||||
}
|
||||
|
||||
public override void ApplyTransformsAt(double time, bool propagateChildren = false)
|
||||
{
|
||||
// When we are using automatic state management, parent calls to this should be blocked for safety.
|
||||
if (!UseTransformStateManagement)
|
||||
base.ApplyTransformsAt(time, propagateChildren);
|
||||
// Parent calls to this should be blocked for safety, as we are manually handling this in updateState.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Legacy method to handle state changes.
|
||||
/// Should generally not be used when <see cref="UseTransformStateManagement"/> is true; use <see cref="UpdateStateTransforms"/> instead.
|
||||
/// </summary>
|
||||
/// <param name="state">The new armed state.</param>
|
||||
[Obsolete("Use UpdateInitialTransforms()/UpdateStateTransforms() instead")] // can be removed 20200227
|
||||
protected virtual void UpdateState(ArmedState state)
|
||||
{
|
||||
}
|
||||
|
||||
#pragma warning restore 618
|
||||
|
||||
#endregion
|
||||
|
||||
protected sealed override void SkinChanged(ISkinSource skin, bool allowFallback)
|
||||
|
||||
@@ -144,9 +144,9 @@ namespace osu.Game.Rulesets.Objects
|
||||
|
||||
/// <summary>
|
||||
/// Creates the <see cref="Judgement"/> that represents the scoring information for this <see cref="HitObject"/>.
|
||||
/// May be null.
|
||||
/// </summary>
|
||||
public virtual Judgement CreateJudgement() => null;
|
||||
[NotNull]
|
||||
public virtual Judgement CreateJudgement() => new Judgement();
|
||||
|
||||
/// <summary>
|
||||
/// Creates the <see cref="HitWindows"/> for this <see cref="HitObject"/>.
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
/// <summary>
|
||||
/// Legacy osu!catch Hit-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertHit : HitObject, IHasCombo, IHasXPosition
|
||||
internal sealed class ConvertHit : ConvertHitObject, IHasCombo, IHasXPosition
|
||||
{
|
||||
public float X { get; set; }
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
/// <summary>
|
||||
/// Legacy osu!catch Spinner-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertSpinner : HitObject, IHasEndTime, IHasXPosition, IHasCombo
|
||||
internal sealed class ConvertSpinner : ConvertHitObject, IHasEndTime, IHasXPosition, IHasCombo
|
||||
{
|
||||
public double EndTime { get; set; }
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// 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.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy
|
||||
{
|
||||
/// <summary>
|
||||
/// A hit object only used for conversion, not actual gameplay.
|
||||
/// </summary>
|
||||
internal abstract class ConvertHitObject : HitObject
|
||||
{
|
||||
public override Judgement CreateJudgement() => new IgnoreJudgement();
|
||||
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ using osu.Game.Beatmaps.ControlPoints;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy
|
||||
{
|
||||
internal abstract class ConvertSlider : HitObject, IHasCurve, IHasLegacyLastTickOffset
|
||||
internal abstract class ConvertSlider : ConvertHitObject, IHasCurve, IHasLegacyLastTickOffset
|
||||
{
|
||||
/// <summary>
|
||||
/// Scoring distance with a speed-adjusted beat length of 1 second.
|
||||
|
||||
@@ -2,17 +2,14 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
{
|
||||
/// <summary>
|
||||
/// Legacy osu!mania Hit-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertHit : HitObject, IHasXPosition
|
||||
internal sealed class ConvertHit : ConvertHitObject, IHasXPosition
|
||||
{
|
||||
public float X { get; set; }
|
||||
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,18 +2,15 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
{
|
||||
internal sealed class ConvertHold : HitObject, IHasXPosition, IHasEndTime
|
||||
internal sealed class ConvertHold : ConvertHitObject, IHasXPosition, IHasEndTime
|
||||
{
|
||||
public float X { get; set; }
|
||||
|
||||
public double EndTime { get; set; }
|
||||
|
||||
public double Duration => EndTime - StartTime;
|
||||
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
{
|
||||
@@ -12,7 +11,5 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
internal sealed class ConvertSlider : Legacy.ConvertSlider, IHasXPosition
|
||||
{
|
||||
public float X { get; set; }
|
||||
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,21 +2,18 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
{
|
||||
/// <summary>
|
||||
/// Legacy osu!mania Spinner-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertSpinner : HitObject, IHasEndTime, IHasXPosition
|
||||
internal sealed class ConvertSpinner : ConvertHitObject, IHasEndTime, IHasXPosition
|
||||
{
|
||||
public double EndTime { get; set; }
|
||||
|
||||
public double Duration => EndTime - StartTime;
|
||||
|
||||
public float X { get; set; }
|
||||
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
@@ -10,7 +9,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
/// <summary>
|
||||
/// Legacy osu! Hit-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertHit : HitObject, IHasPosition, IHasCombo
|
||||
internal sealed class ConvertHit : ConvertHitObject, IHasPosition, IHasCombo
|
||||
{
|
||||
public Vector2 Position { get; set; }
|
||||
|
||||
@@ -21,7 +20,5 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
public bool NewCombo { get; set; }
|
||||
|
||||
public int ComboOffset { get; set; }
|
||||
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
@@ -21,7 +20,5 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
public bool NewCombo { get; set; }
|
||||
|
||||
public int ComboOffset { get; set; }
|
||||
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
@@ -10,7 +9,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
/// <summary>
|
||||
/// Legacy osu! Spinner-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertSpinner : HitObject, IHasEndTime, IHasPosition, IHasCombo
|
||||
internal sealed class ConvertSpinner : ConvertHitObject, IHasEndTime, IHasPosition, IHasCombo
|
||||
{
|
||||
public double EndTime { get; set; }
|
||||
|
||||
@@ -22,8 +21,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
|
||||
public float Y => Position.Y;
|
||||
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
|
||||
public bool NewCombo { get; set; }
|
||||
|
||||
public int ComboOffset { get; set; }
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
// 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.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
{
|
||||
/// <summary>
|
||||
/// Legacy osu!taiko Hit-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertHit : HitObject
|
||||
internal sealed class ConvertHit : ConvertHitObject
|
||||
{
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// 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.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
{
|
||||
/// <summary>
|
||||
@@ -10,6 +8,5 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
/// </summary>
|
||||
internal sealed class ConvertSlider : Legacy.ConvertSlider
|
||||
{
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,19 +2,16 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
{
|
||||
/// <summary>
|
||||
/// Legacy osu!taiko Spinner-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertSpinner : HitObject, IHasEndTime
|
||||
internal sealed class ConvertSpinner : ConvertHitObject, IHasEndTime
|
||||
{
|
||||
public double EndTime { get; set; }
|
||||
|
||||
public double Duration => EndTime - StartTime;
|
||||
|
||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,8 +125,6 @@ namespace osu.Game.Rulesets.Scoring
|
||||
simulate(nested);
|
||||
|
||||
var judgement = obj.CreateJudgement();
|
||||
if (judgement == null)
|
||||
return;
|
||||
|
||||
var result = CreateResult(obj, judgement);
|
||||
if (result == null)
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
// 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.Screens.Charts
|
||||
{
|
||||
public class ChartInfo : ScreenWhiteBox
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// 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 System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.Screens.Charts
|
||||
{
|
||||
public class ChartListing : ScreenWhiteBox
|
||||
{
|
||||
protected override IEnumerable<Type> PossibleChildren => new[]
|
||||
{
|
||||
typeof(ChartInfo)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -93,15 +93,15 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
EditorMenuBar menuBar;
|
||||
|
||||
var fileMenuItems = new List<MenuItem>();
|
||||
var fileMenuItems = new List<MenuItem>
|
||||
{
|
||||
new EditorMenuItem("Save", MenuItemType.Standard, saveBeatmap)
|
||||
};
|
||||
|
||||
if (RuntimeInfo.IsDesktop)
|
||||
{
|
||||
fileMenuItems.Add(new EditorMenuItem("Save", MenuItemType.Standard, saveBeatmap));
|
||||
fileMenuItems.Add(new EditorMenuItem("Export package", MenuItemType.Standard, exportBeatmap));
|
||||
fileMenuItems.Add(new EditorMenuItemSpacer());
|
||||
}
|
||||
|
||||
fileMenuItems.Add(new EditorMenuItemSpacer());
|
||||
fileMenuItems.Add(new EditorMenuItem("Exit", MenuItemType.Standard, this.Exit));
|
||||
|
||||
AddInternal(new OsuContextMenuContainer
|
||||
|
||||
@@ -54,8 +54,6 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
base.LogoArriving(logo, resuming);
|
||||
|
||||
logo.Triangles = true;
|
||||
|
||||
if (!resuming)
|
||||
{
|
||||
PrepareMenuLoad();
|
||||
|
||||
@@ -18,7 +18,6 @@ using osu.Game.Online.API;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Dialog;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using osu.Game.Screens.Charts;
|
||||
using osu.Game.Screens.Edit;
|
||||
using osu.Game.Screens.Multi;
|
||||
using osu.Game.Screens.Select;
|
||||
@@ -73,7 +72,7 @@ namespace osu.Game.Screens.Menu
|
||||
private SongTicker songTicker;
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(DirectOverlay direct, SettingsOverlay settings, OsuConfigManager config, SessionStatics statics)
|
||||
private void load(DirectOverlay direct, SettingsOverlay settings, RankingsOverlay rankings, OsuConfigManager config, SessionStatics statics)
|
||||
{
|
||||
holdDelay = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay);
|
||||
loginDisplayed = statics.GetBindable<bool>(Static.LoginOverlayDisplayed);
|
||||
@@ -101,7 +100,6 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
buttons = new ButtonSystem
|
||||
{
|
||||
OnChart = delegate { this.Push(new ChartListing()); },
|
||||
OnEdit = delegate { this.Push(new Editor()); },
|
||||
OnSolo = onSolo,
|
||||
OnMulti = delegate { this.Push(new Multiplayer()); },
|
||||
@@ -136,6 +134,7 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
buttons.OnSettings = () => settings?.ToggleVisibility();
|
||||
buttons.OnDirect = () => direct?.ToggleVisibility();
|
||||
buttons.OnChart = () => rankings?.ShowSpotlights();
|
||||
|
||||
LoadComponentAsync(background = new BackgroundScreenDefault());
|
||||
preloadSongSelect();
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace osu.Game.Screens.Multi.Components
|
||||
}
|
||||
|
||||
public OverlinedParticipants(Direction direction)
|
||||
: base("Participants")
|
||||
: base("Recent participants")
|
||||
{
|
||||
OsuScrollContainer scroll;
|
||||
ParticipantsList list;
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
// 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 System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Users.Drawables;
|
||||
using osuTK;
|
||||
@@ -26,7 +24,9 @@ namespace osu.Game.Screens.Multi.Components
|
||||
set
|
||||
{
|
||||
base.RelativeSizeAxes = value;
|
||||
fill.RelativeSizeAxes = value;
|
||||
|
||||
if (tiles != null)
|
||||
tiles.RelativeSizeAxes = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,83 +36,75 @@ namespace osu.Game.Screens.Multi.Components
|
||||
set
|
||||
{
|
||||
base.AutoSizeAxes = value;
|
||||
fill.AutoSizeAxes = value;
|
||||
|
||||
if (tiles != null)
|
||||
tiles.AutoSizeAxes = value;
|
||||
}
|
||||
}
|
||||
|
||||
private FillDirection direction = FillDirection.Full;
|
||||
|
||||
public FillDirection Direction
|
||||
{
|
||||
get => fill.Direction;
|
||||
set => fill.Direction = value;
|
||||
}
|
||||
get => direction;
|
||||
set
|
||||
{
|
||||
direction = value;
|
||||
|
||||
private readonly FillFlowContainer fill;
|
||||
|
||||
public ParticipantsList()
|
||||
{
|
||||
InternalChild = fill = new FillFlowContainer { Spacing = new Vector2(10) };
|
||||
if (tiles != null)
|
||||
tiles.Direction = value;
|
||||
}
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
RoomID.BindValueChanged(_ => updateParticipants(), true);
|
||||
RecentParticipants.CollectionChanged += (_, __) => updateParticipants();
|
||||
updateParticipants();
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
private GetRoomScoresRequest request;
|
||||
private ScheduledDelegate scheduledUpdate;
|
||||
private FillFlowContainer<UserTile> tiles;
|
||||
|
||||
private void updateParticipants()
|
||||
{
|
||||
var roomId = RoomID.Value ?? 0;
|
||||
|
||||
request?.Cancel();
|
||||
|
||||
// nice little progressive fade
|
||||
int time = 500;
|
||||
|
||||
foreach (var c in fill.Children)
|
||||
scheduledUpdate?.Cancel();
|
||||
scheduledUpdate = Schedule(() =>
|
||||
{
|
||||
c.Delay(500 - time).FadeOut(time, Easing.Out);
|
||||
time = Math.Max(20, time - 20);
|
||||
c.Expire();
|
||||
}
|
||||
tiles?.FadeOut(250, Easing.Out).Expire();
|
||||
|
||||
if (roomId == 0) return;
|
||||
tiles = new FillFlowContainer<UserTile>
|
||||
{
|
||||
Alpha = 0,
|
||||
Direction = Direction,
|
||||
AutoSizeAxes = AutoSizeAxes,
|
||||
RelativeSizeAxes = RelativeSizeAxes,
|
||||
Spacing = new Vector2(10)
|
||||
};
|
||||
|
||||
request = new GetRoomScoresRequest(roomId);
|
||||
request.Success += scores => Schedule(() =>
|
||||
{
|
||||
if (roomId != RoomID.Value)
|
||||
return;
|
||||
for (int i = 0; i < RecentParticipants.Count; i++)
|
||||
tiles.Add(new UserTile { User = RecentParticipants[i] });
|
||||
|
||||
fill.Clear();
|
||||
foreach (var s in scores)
|
||||
fill.Add(new UserTile(s.User));
|
||||
AddInternal(tiles);
|
||||
|
||||
fill.FadeInFromZero(1000, Easing.OutQuint);
|
||||
tiles.Delay(250).FadeIn(250, Easing.OutQuint);
|
||||
});
|
||||
|
||||
api.Queue(request);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
request?.Cancel();
|
||||
base.Dispose(isDisposing);
|
||||
}
|
||||
|
||||
private class UserTile : CompositeDrawable, IHasTooltip
|
||||
{
|
||||
private readonly User user;
|
||||
public User User
|
||||
{
|
||||
get => avatar.User;
|
||||
set => avatar.User = value;
|
||||
}
|
||||
|
||||
public string TooltipText => user.Username;
|
||||
public string TooltipText => User?.Username ?? string.Empty;
|
||||
|
||||
public UserTile(User user)
|
||||
private readonly UpdateableAvatar avatar;
|
||||
|
||||
public UserTile()
|
||||
{
|
||||
this.user = user;
|
||||
Size = new Vector2(TILE_SIZE);
|
||||
CornerRadius = 5f;
|
||||
Masking = true;
|
||||
@@ -124,11 +116,7 @@ namespace osu.Game.Screens.Multi.Components
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = OsuColour.FromHex(@"27252d"),
|
||||
},
|
||||
new UpdateableAvatar
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
User = user,
|
||||
},
|
||||
avatar = new UpdateableAvatar { RelativeSizeAxes = Axes.Both },
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
||||
private Bindable<FilterCriteria> filter { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private Bindable<Room> currentRoom { get; set; }
|
||||
private Bindable<Room> selectedRoom { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private IRoomManager roomManager { get; set; }
|
||||
@@ -122,7 +122,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
||||
else
|
||||
roomFlow.Children.ForEach(r => r.State = r.Room == room ? SelectionState.Selected : SelectionState.NotSelected);
|
||||
|
||||
currentRoom.Value = room;
|
||||
selectedRoom.Value = room;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace osu.Game.Screens.Multi.Lounge
|
||||
private readonly LoadingLayer loadingLayer;
|
||||
|
||||
[Resolved]
|
||||
private Bindable<Room> currentRoom { get; set; }
|
||||
private Bindable<Room> selectedRoom { get; set; }
|
||||
|
||||
public LoungeSubScreen()
|
||||
{
|
||||
@@ -101,8 +101,8 @@ namespace osu.Game.Screens.Multi.Lounge
|
||||
{
|
||||
base.OnResuming(last);
|
||||
|
||||
if (currentRoom.Value?.RoomID.Value == null)
|
||||
currentRoom.Value = new Room();
|
||||
if (selectedRoom.Value?.RoomID.Value == null)
|
||||
selectedRoom.Value = new Room();
|
||||
|
||||
onReturning();
|
||||
}
|
||||
@@ -143,7 +143,7 @@ namespace osu.Game.Screens.Multi.Lounge
|
||||
if (!this.IsCurrentScreen())
|
||||
return;
|
||||
|
||||
currentRoom.Value = room;
|
||||
selectedRoom.Value = room;
|
||||
|
||||
this.Push(new MatchSubScreen(room));
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace osu.Game.Screens.Multi
|
||||
private readonly IBindable<bool> isIdle = new BindableBool();
|
||||
|
||||
[Cached]
|
||||
private readonly Bindable<Room> currentRoom = new Bindable<Room>();
|
||||
private readonly Bindable<Room> selectedRoom = new Bindable<Room>();
|
||||
|
||||
[Cached]
|
||||
private readonly Bindable<FilterCriteria> currentFilter = new Bindable<FilterCriteria>(new FilterCriteria());
|
||||
@@ -163,14 +163,39 @@ namespace osu.Game.Screens.Multi
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||
{
|
||||
var dependencies = new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent));
|
||||
dependencies.Model.BindTo(currentRoom);
|
||||
dependencies.Model.BindTo(selectedRoom);
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
private void updatePollingRate(bool idle)
|
||||
{
|
||||
roomManager.TimeBetweenPolls = !this.IsCurrentScreen() || !(screenStack.CurrentScreen is LoungeSubScreen) ? 0 : (idle ? 120000 : 15000);
|
||||
Logger.Log($"Polling adjusted to {roomManager.TimeBetweenPolls}");
|
||||
if (!this.IsCurrentScreen())
|
||||
{
|
||||
roomManager.TimeBetweenListingPolls = 0;
|
||||
roomManager.TimeBetweenSelectionPolls = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (screenStack.CurrentScreen)
|
||||
{
|
||||
case LoungeSubScreen _:
|
||||
roomManager.TimeBetweenListingPolls = idle ? 120000 : 15000;
|
||||
roomManager.TimeBetweenSelectionPolls = idle ? 120000 : 15000;
|
||||
break;
|
||||
|
||||
case MatchSubScreen _:
|
||||
roomManager.TimeBetweenListingPolls = 0;
|
||||
roomManager.TimeBetweenSelectionPolls = idle ? 30000 : 5000;
|
||||
break;
|
||||
|
||||
default:
|
||||
roomManager.TimeBetweenListingPolls = 0;
|
||||
roomManager.TimeBetweenSelectionPolls = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Logger.Log($"Polling adjusted (listing: {roomManager.TimeBetweenListingPolls}, selection: {roomManager.TimeBetweenSelectionPolls})");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -222,6 +247,8 @@ namespace osu.Game.Screens.Multi
|
||||
base.OnResuming(last);
|
||||
|
||||
beginHandlingTrack();
|
||||
|
||||
updatePollingRate(isIdle.Value);
|
||||
}
|
||||
|
||||
public override void OnSuspending(IScreen next)
|
||||
@@ -231,7 +258,7 @@ namespace osu.Game.Screens.Multi
|
||||
|
||||
endHandlingTrack();
|
||||
|
||||
roomManager.TimeBetweenPolls = 0;
|
||||
updatePollingRate(isIdle.Value);
|
||||
}
|
||||
|
||||
public override bool OnExiting(IScreen next)
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace osu.Game.Screens.Multi
|
||||
protected BindableList<PlaylistItem> Playlist { get; private set; }
|
||||
|
||||
[Resolved(typeof(Room))]
|
||||
protected BindableList<User> Participants { get; private set; }
|
||||
protected BindableList<User> RecentParticipants { get; private set; }
|
||||
|
||||
[Resolved(typeof(Room))]
|
||||
protected Bindable<int> ParticipantCount { get; private set; }
|
||||
|
||||
@@ -2,10 +2,13 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online;
|
||||
@@ -17,20 +20,24 @@ using osu.Game.Screens.Multi.Lounge.Components;
|
||||
|
||||
namespace osu.Game.Screens.Multi
|
||||
{
|
||||
public class RoomManager : PollingComponent, IRoomManager
|
||||
public class RoomManager : CompositeDrawable, IRoomManager
|
||||
{
|
||||
public event Action RoomsUpdated;
|
||||
|
||||
private readonly BindableList<Room> rooms = new BindableList<Room>();
|
||||
public IBindableList<Room> Rooms => rooms;
|
||||
|
||||
private Room joinedRoom;
|
||||
public double TimeBetweenListingPolls
|
||||
{
|
||||
get => listingPollingComponent.TimeBetweenPolls;
|
||||
set => listingPollingComponent.TimeBetweenPolls = value;
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
private Bindable<FilterCriteria> currentFilter { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
public double TimeBetweenSelectionPolls
|
||||
{
|
||||
get => selectionPollingComponent.TimeBetweenPolls;
|
||||
set => selectionPollingComponent.TimeBetweenPolls = value;
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
private RulesetStore rulesets { get; set; }
|
||||
@@ -38,14 +45,26 @@ namespace osu.Game.Screens.Multi
|
||||
[Resolved]
|
||||
private BeatmapManager beatmaps { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private Bindable<Room> selectedRoom { get; set; }
|
||||
|
||||
private readonly ListingPollingComponent listingPollingComponent;
|
||||
private readonly SelectionPollingComponent selectionPollingComponent;
|
||||
|
||||
private Room joinedRoom;
|
||||
|
||||
public RoomManager()
|
||||
{
|
||||
currentFilter.BindValueChanged(_ =>
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
if (IsLoaded)
|
||||
PollImmediately();
|
||||
});
|
||||
listingPollingComponent = new ListingPollingComponent { RoomsReceived = onListingReceived },
|
||||
selectionPollingComponent = new SelectionPollingComponent { RoomReceived = onSelectedRoomReceived }
|
||||
};
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
@@ -116,45 +135,52 @@ namespace osu.Game.Screens.Multi
|
||||
joinedRoom = null;
|
||||
}
|
||||
|
||||
private GetRoomsRequest pollReq;
|
||||
|
||||
protected override Task Poll()
|
||||
/// <summary>
|
||||
/// Invoked when the listing of all <see cref="Room"/>s is received from the server.
|
||||
/// </summary>
|
||||
/// <param name="listing">The listing.</param>
|
||||
private void onListingReceived(List<Room> listing)
|
||||
{
|
||||
if (!api.IsLoggedIn)
|
||||
return base.Poll();
|
||||
|
||||
var tcs = new TaskCompletionSource<bool>();
|
||||
|
||||
pollReq?.Cancel();
|
||||
pollReq = new GetRoomsRequest(currentFilter.Value.PrimaryFilter);
|
||||
|
||||
pollReq.Success += result =>
|
||||
// Remove past matches
|
||||
foreach (var r in rooms.ToList())
|
||||
{
|
||||
// Remove past matches
|
||||
foreach (var r in rooms.ToList())
|
||||
if (listing.All(e => e.RoomID.Value != r.RoomID.Value))
|
||||
rooms.Remove(r);
|
||||
}
|
||||
|
||||
for (int i = 0; i < listing.Count; i++)
|
||||
{
|
||||
if (selectedRoom.Value?.RoomID?.Value == listing[i].RoomID.Value)
|
||||
{
|
||||
if (result.All(e => e.RoomID.Value != r.RoomID.Value))
|
||||
rooms.Remove(r);
|
||||
// The listing request contains less data than the selection request, so data from the selection request is always preferred while the room is selected.
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int i = 0; i < result.Count; i++)
|
||||
var r = listing[i];
|
||||
r.Position.Value = i;
|
||||
|
||||
update(r, r);
|
||||
addRoom(r);
|
||||
}
|
||||
|
||||
RoomsUpdated?.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when a <see cref="Room"/> is received from the server.
|
||||
/// </summary>
|
||||
/// <param name="toUpdate">The received <see cref="Room"/>.</param>
|
||||
private void onSelectedRoomReceived(Room toUpdate)
|
||||
{
|
||||
foreach (var room in rooms)
|
||||
{
|
||||
if (room.RoomID.Value == toUpdate.RoomID.Value)
|
||||
{
|
||||
var r = result[i];
|
||||
r.Position.Value = i;
|
||||
|
||||
update(r, r);
|
||||
addRoom(r);
|
||||
toUpdate.Position.Value = room.Position.Value;
|
||||
update(room, toUpdate);
|
||||
break;
|
||||
}
|
||||
|
||||
RoomsUpdated?.Invoke();
|
||||
tcs.SetResult(true);
|
||||
};
|
||||
|
||||
pollReq.Failure += _ => tcs.SetResult(false);
|
||||
|
||||
api.Queue(pollReq);
|
||||
|
||||
return tcs.Task;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -182,5 +208,100 @@ namespace osu.Game.Screens.Multi
|
||||
else
|
||||
existing.CopyFrom(room);
|
||||
}
|
||||
|
||||
private class SelectionPollingComponent : PollingComponent
|
||||
{
|
||||
public Action<Room> RoomReceived;
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private Bindable<Room> selectedRoom { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
selectedRoom.BindValueChanged(_ =>
|
||||
{
|
||||
if (IsLoaded)
|
||||
PollImmediately();
|
||||
});
|
||||
}
|
||||
|
||||
private GetRoomRequest pollReq;
|
||||
|
||||
protected override Task Poll()
|
||||
{
|
||||
if (!api.IsLoggedIn)
|
||||
return base.Poll();
|
||||
|
||||
if (selectedRoom.Value?.RoomID.Value == null)
|
||||
return base.Poll();
|
||||
|
||||
var tcs = new TaskCompletionSource<bool>();
|
||||
|
||||
pollReq?.Cancel();
|
||||
pollReq = new GetRoomRequest(selectedRoom.Value.RoomID.Value.Value);
|
||||
|
||||
pollReq.Success += result =>
|
||||
{
|
||||
RoomReceived?.Invoke(result);
|
||||
tcs.SetResult(true);
|
||||
};
|
||||
|
||||
pollReq.Failure += _ => tcs.SetResult(false);
|
||||
|
||||
api.Queue(pollReq);
|
||||
|
||||
return tcs.Task;
|
||||
}
|
||||
}
|
||||
|
||||
private class ListingPollingComponent : PollingComponent
|
||||
{
|
||||
public Action<List<Room>> RoomsReceived;
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private Bindable<FilterCriteria> currentFilter { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
currentFilter.BindValueChanged(_ =>
|
||||
{
|
||||
if (IsLoaded)
|
||||
PollImmediately();
|
||||
});
|
||||
}
|
||||
|
||||
private GetRoomsRequest pollReq;
|
||||
|
||||
protected override Task Poll()
|
||||
{
|
||||
if (!api.IsLoggedIn)
|
||||
return base.Poll();
|
||||
|
||||
var tcs = new TaskCompletionSource<bool>();
|
||||
|
||||
pollReq?.Cancel();
|
||||
pollReq = new GetRoomsRequest(currentFilter.Value.PrimaryFilter);
|
||||
|
||||
pollReq.Success += result =>
|
||||
{
|
||||
RoomsReceived?.Invoke(result);
|
||||
tcs.SetResult(true);
|
||||
};
|
||||
|
||||
pollReq.Failure += _ => tcs.SetResult(false);
|
||||
|
||||
api.Queue(pollReq);
|
||||
|
||||
return tcs.Task;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
@@ -63,15 +62,9 @@ namespace osu.Game.Screens.Play
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
loading.Show();
|
||||
backgroundSprite.FadeColour(OsuColour.Gray(0.5f), 400, Easing.OutQuint);
|
||||
}
|
||||
else
|
||||
{
|
||||
loading.Hide();
|
||||
backgroundSprite.FadeColour(Color4.White, 400, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +131,7 @@ namespace osu.Game.Screens.Play
|
||||
Anchor = Anchor.Centre,
|
||||
FillMode = FillMode.Fill,
|
||||
},
|
||||
loading = new LoadingSpinner { Scale = new Vector2(1.3f) }
|
||||
loading = new LoadingLayer(backgroundSprite)
|
||||
}
|
||||
},
|
||||
new OsuSpriteText
|
||||
|
||||
@@ -13,12 +13,5 @@ namespace osu.Game.Screens.Play.HUD
|
||||
MinValue = 0,
|
||||
MaxValue = 1
|
||||
};
|
||||
|
||||
protected HealthDisplay()
|
||||
{
|
||||
Current.ValueChanged += health => SetHealth((float)health.NewValue);
|
||||
}
|
||||
|
||||
protected abstract void SetHealth(float value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,11 +207,27 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
|
||||
private double floatingAverage;
|
||||
private Container colourBars;
|
||||
|
||||
private const int max_concurrent_judgements = 50;
|
||||
|
||||
public override void OnNewJudgement(JudgementResult judgement)
|
||||
{
|
||||
if (!judgement.IsHit)
|
||||
return;
|
||||
|
||||
if (judgementsContainer.Count > max_concurrent_judgements)
|
||||
{
|
||||
const double quick_fade_time = 100;
|
||||
|
||||
// check with a bit of lenience to avoid precision error in comparison.
|
||||
var old = judgementsContainer.FirstOrDefault(j => j.LifetimeEnd > Clock.CurrentTime + quick_fade_time * 1.1);
|
||||
|
||||
if (old != null)
|
||||
{
|
||||
old.ClearTransforms();
|
||||
old.FadeOut(quick_fade_time).Expire();
|
||||
}
|
||||
}
|
||||
|
||||
judgementsContainer.Add(new JudgementLine
|
||||
{
|
||||
Y = getRelativeJudgementPosition(judgement.TimeOffset),
|
||||
@@ -228,7 +244,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
|
||||
|
||||
private class JudgementLine : CompositeDrawable
|
||||
{
|
||||
private const int judgement_fade_duration = 10000;
|
||||
private const int judgement_fade_duration = 5000;
|
||||
|
||||
public JudgementLine()
|
||||
{
|
||||
@@ -255,7 +271,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
|
||||
Width = 0;
|
||||
|
||||
this.ResizeWidthTo(1, 200, Easing.OutElasticHalf);
|
||||
this.FadeTo(0.8f, 150).Then().FadeOut(judgement_fade_duration, Easing.OutQuint).Expire();
|
||||
this.FadeTo(0.8f, 150).Then().FadeOut(judgement_fade_duration).Expire();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ using osu.Game.Rulesets.Judgements;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Screens.Play.HUD
|
||||
@@ -108,11 +109,23 @@ namespace osu.Game.Screens.Play.HUD
|
||||
if (result.Type == HitResult.Miss)
|
||||
return;
|
||||
|
||||
Scheduler.AddOnce(flash);
|
||||
}
|
||||
|
||||
private void flash()
|
||||
{
|
||||
fill.FadeEdgeEffectTo(Math.Min(1, fill.EdgeEffect.Colour.Linear.A + (1f - base_glow_opacity) / glow_max_hits), 50, Easing.OutQuint)
|
||||
.Delay(glow_fade_delay)
|
||||
.FadeEdgeEffectTo(base_glow_opacity, glow_fade_time, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void SetHealth(float value) => fill.ResizeTo(new Vector2(value, 1), 200, Easing.OutQuint);
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
fill.Width = Interpolation.ValueAt(
|
||||
Math.Clamp(Clock.ElapsedFrameTime, 0, 200),
|
||||
fill.Width, (float)Current.Value, 0, 200, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -609,9 +609,9 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
var score = CreateScore();
|
||||
if (DrawableRuleset.ReplayScore == null)
|
||||
scoreManager.Import(score).Wait();
|
||||
|
||||
this.Push(CreateResults(score));
|
||||
scoreManager.Import(score).ContinueWith(_ => Schedule(() => this.Push(CreateResults(score))));
|
||||
else
|
||||
this.Push(CreateResults(score));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user