mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Merge branch 'master' into update-follower-count
This commit is contained in:
@ -63,6 +63,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.717.1" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.726.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -29,29 +29,36 @@ namespace osu.Desktop
|
|||||||
|
|
||||||
if (!host.IsPrimaryInstance)
|
if (!host.IsPrimaryInstance)
|
||||||
{
|
{
|
||||||
var importer = new ArchiveImportIPCChannel(host);
|
if (args.Length > 0 && args[0].Contains('.')) // easy way to check for a file import in args
|
||||||
// Restore the cwd so relative paths given at the command line work correctly
|
|
||||||
Directory.SetCurrentDirectory(cwd);
|
|
||||||
|
|
||||||
foreach (var file in args)
|
|
||||||
{
|
{
|
||||||
Console.WriteLine(@"Importing {0}", file);
|
var importer = new ArchiveImportIPCChannel(host);
|
||||||
if (!importer.ImportAsync(Path.GetFullPath(file)).Wait(3000))
|
// Restore the cwd so relative paths given at the command line work correctly
|
||||||
throw new TimeoutException(@"IPC took too long to send");
|
Directory.SetCurrentDirectory(cwd);
|
||||||
|
|
||||||
|
foreach (var file in args)
|
||||||
|
{
|
||||||
|
Console.WriteLine(@"Importing {0}", file);
|
||||||
|
if (!importer.ImportAsync(Path.GetFullPath(file)).Wait(3000))
|
||||||
|
throw new TimeoutException(@"IPC took too long to send");
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we want to allow multiple instances to be started when in debug.
|
||||||
|
if (!DebugUtils.IsDebugBuild)
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
switch (args.FirstOrDefault() ?? string.Empty)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
host.Run(new OsuGameDesktop(args));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "--tournament":
|
switch (args.FirstOrDefault() ?? string.Empty)
|
||||||
host.Run(new TournamentGame());
|
{
|
||||||
break;
|
default:
|
||||||
}
|
host.Run(new OsuGameDesktop(args));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "--tournament":
|
||||||
|
host.Run(new TournamentGame());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3,12 +3,10 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Skinning;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||||
{
|
{
|
||||||
@ -60,16 +58,11 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
ApplyResult(r => r.Type = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss);
|
ApplyResult(r => r.Type = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SkinChanged(ISkinSource skin, bool allowFallback)
|
protected override bool UseTransformStateManagement => false;
|
||||||
{
|
|
||||||
base.SkinChanged(skin, allowFallback);
|
|
||||||
|
|
||||||
if (HitObject is IHasComboInformation combo)
|
|
||||||
AccentColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : (Color4?)null) ?? Color4.White;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void UpdateState(ArmedState state)
|
protected override void UpdateState(ArmedState state)
|
||||||
{
|
{
|
||||||
|
// TODO: update to use new state management.
|
||||||
using (BeginAbsoluteSequence(HitObject.StartTime - HitObject.TimePreempt))
|
using (BeginAbsoluteSequence(HitObject.StartTime - HitObject.TimePreempt))
|
||||||
this.FadeIn(200);
|
this.FadeIn(200);
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||||
{
|
{
|
||||||
@ -27,16 +26,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
AddInternal(pulp = new Pulp { Size = Size });
|
AddInternal(pulp = new Pulp { Size = Size });
|
||||||
}
|
|
||||||
|
|
||||||
public override Color4 AccentColour
|
AccentColour.BindValueChanged(colour => { pulp.AccentColour = colour.NewValue; }, true);
|
||||||
{
|
|
||||||
get => base.AccentColour;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
base.AccentColour = value;
|
|
||||||
pulp.AccentColour = AccentColour;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
// todo: this should come from the skin.
|
// todo: this should come from the skin.
|
||||||
AccentColour = colourForRepresentation(HitObject.VisualRepresentation);
|
AccentColour.Value = colourForRepresentation(HitObject.VisualRepresentation);
|
||||||
|
|
||||||
AddRangeInternal(new[]
|
AddRangeInternal(new[]
|
||||||
{
|
{
|
||||||
@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
Hollow = !HitObject.HyperDash,
|
Hollow = !HitObject.HyperDash,
|
||||||
Type = EdgeEffectType.Glow,
|
Type = EdgeEffectType.Glow,
|
||||||
Radius = 4 * radius_adjust,
|
Radius = 4 * radius_adjust,
|
||||||
Colour = HitObject.HyperDash ? Color4.Red : AccentColour.Darken(1).Opacity(0.6f)
|
Colour = HitObject.HyperDash ? Color4.Red : AccentColour.Value.Darken(1).Opacity(0.6f)
|
||||||
},
|
},
|
||||||
Size = new Vector2(Height),
|
Size = new Vector2(Height),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
@ -65,7 +65,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
AlwaysPresent = true,
|
AlwaysPresent = true,
|
||||||
Colour = AccentColour,
|
Colour = AccentColour.Value,
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
}
|
}
|
||||||
@ -115,32 +115,32 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
{
|
{
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(small_pulp),
|
Size = new Vector2(small_pulp),
|
||||||
Y = -0.34f,
|
Y = -0.34f,
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(large_pulp_4),
|
Size = new Vector2(large_pulp_4),
|
||||||
Position = positionAt(0, distance_from_centre_4),
|
Position = positionAt(0, distance_from_centre_4),
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(large_pulp_4),
|
Size = new Vector2(large_pulp_4),
|
||||||
Position = positionAt(90, distance_from_centre_4),
|
Position = positionAt(90, distance_from_centre_4),
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(large_pulp_4),
|
Size = new Vector2(large_pulp_4),
|
||||||
Position = positionAt(180, distance_from_centre_4),
|
Position = positionAt(180, distance_from_centre_4),
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
Size = new Vector2(large_pulp_4),
|
Size = new Vector2(large_pulp_4),
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Position = positionAt(270, distance_from_centre_4),
|
Position = positionAt(270, distance_from_centre_4),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -154,32 +154,32 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
{
|
{
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(small_pulp),
|
Size = new Vector2(small_pulp),
|
||||||
Y = -0.3f,
|
Y = -0.3f,
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(large_pulp_4),
|
Size = new Vector2(large_pulp_4),
|
||||||
Position = positionAt(45, distance_from_centre_4),
|
Position = positionAt(45, distance_from_centre_4),
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(large_pulp_4),
|
Size = new Vector2(large_pulp_4),
|
||||||
Position = positionAt(135, distance_from_centre_4),
|
Position = positionAt(135, distance_from_centre_4),
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(large_pulp_4),
|
Size = new Vector2(large_pulp_4),
|
||||||
Position = positionAt(225, distance_from_centre_4),
|
Position = positionAt(225, distance_from_centre_4),
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
Size = new Vector2(large_pulp_4),
|
Size = new Vector2(large_pulp_4),
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Position = positionAt(315, distance_from_centre_4),
|
Position = positionAt(315, distance_from_centre_4),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -193,26 +193,26 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
{
|
{
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(small_pulp),
|
Size = new Vector2(small_pulp),
|
||||||
Y = -0.33f,
|
Y = -0.33f,
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(large_pulp_3),
|
Size = new Vector2(large_pulp_3),
|
||||||
Position = positionAt(60, distance_from_centre_3),
|
Position = positionAt(60, distance_from_centre_3),
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(large_pulp_3),
|
Size = new Vector2(large_pulp_3),
|
||||||
Position = positionAt(180, distance_from_centre_3),
|
Position = positionAt(180, distance_from_centre_3),
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
Size = new Vector2(large_pulp_3),
|
Size = new Vector2(large_pulp_3),
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Position = positionAt(300, distance_from_centre_3),
|
Position = positionAt(300, distance_from_centre_3),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -226,26 +226,26 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
{
|
{
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(small_pulp),
|
Size = new Vector2(small_pulp),
|
||||||
Y = -0.25f,
|
Y = -0.25f,
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(large_pulp_3),
|
Size = new Vector2(large_pulp_3),
|
||||||
Position = positionAt(0, distance_from_centre_3),
|
Position = positionAt(0, distance_from_centre_3),
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(large_pulp_3),
|
Size = new Vector2(large_pulp_3),
|
||||||
Position = positionAt(120, distance_from_centre_3),
|
Position = positionAt(120, distance_from_centre_3),
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
Size = new Vector2(large_pulp_3),
|
Size = new Vector2(large_pulp_3),
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Position = positionAt(240, distance_from_centre_3),
|
Position = positionAt(240, distance_from_centre_3),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -259,13 +259,13 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
{
|
{
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(small_pulp),
|
Size = new Vector2(small_pulp),
|
||||||
Y = -0.3f
|
Y = -0.3f
|
||||||
},
|
},
|
||||||
new Pulp
|
new Pulp
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
AccentColour = AccentColour.Value,
|
||||||
Size = new Vector2(large_pulp_4 * 0.8f, large_pulp_4 * 2.5f),
|
Size = new Vector2(large_pulp_4 * 0.8f, large_pulp_4 * 2.5f),
|
||||||
Y = 0.05f,
|
Y = 0.05f,
|
||||||
},
|
},
|
||||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
Child = drawableObject = new DrawableHoldNote(holdNote)
|
Child = drawableObject = new DrawableHoldNote(holdNote)
|
||||||
{
|
{
|
||||||
Height = 300,
|
Height = 300,
|
||||||
AccentColour = OsuColour.Gray(0.3f)
|
AccentColour = { Value = OsuColour.Gray(0.3f) }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Child = new NoteContainer(direction, $"note {identifier}, scrolling {direction.ToString().ToLowerInvariant()}")
|
Child = new NoteContainer(direction, $"note {identifier}, scrolling {direction.ToString().ToLowerInvariant()}")
|
||||||
{
|
{
|
||||||
Child = hitObject = new DrawableNote(note) { AccentColour = Color4.OrangeRed }
|
Child = hitObject = new DrawableNote(note) { AccentColour = { Value = Color4.OrangeRed } }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
Child = hitObject = new DrawableHoldNote(note)
|
Child = hitObject = new DrawableHoldNote(note)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
AccentColour = Color4.OrangeRed,
|
AccentColour = { Value = Color4.OrangeRed },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -6,7 +6,6 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
|
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
|
||||||
using osuTK.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
@ -36,11 +35,10 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private bool hasBroken;
|
private bool hasBroken;
|
||||||
|
|
||||||
private readonly Container<DrawableHoldNoteTick> tickContainer;
|
|
||||||
|
|
||||||
public DrawableHoldNote(HoldNote hitObject)
|
public DrawableHoldNote(HoldNote hitObject)
|
||||||
: base(hitObject)
|
: base(hitObject)
|
||||||
{
|
{
|
||||||
|
Container<DrawableHoldNoteTick> tickContainer;
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
|
|
||||||
AddRangeInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
@ -74,6 +72,14 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
|
|
||||||
AddNested(Head);
|
AddNested(Head);
|
||||||
AddNested(Tail);
|
AddNested(Tail);
|
||||||
|
|
||||||
|
AccentColour.BindValueChanged(colour =>
|
||||||
|
{
|
||||||
|
bodyPiece.AccentColour = colour.NewValue;
|
||||||
|
Head.AccentColour.Value = colour.NewValue;
|
||||||
|
Tail.AccentColour.Value = colour.NewValue;
|
||||||
|
tickContainer.ForEach(t => t.AccentColour.Value = colour.NewValue);
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDirectionChanged(ValueChangedEvent<ScrollingDirection> e)
|
protected override void OnDirectionChanged(ValueChangedEvent<ScrollingDirection> e)
|
||||||
@ -83,20 +89,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
bodyPiece.Anchor = bodyPiece.Origin = e.NewValue == ScrollingDirection.Up ? Anchor.TopLeft : Anchor.BottomLeft;
|
bodyPiece.Anchor = bodyPiece.Origin = e.NewValue == ScrollingDirection.Up ? Anchor.TopLeft : Anchor.BottomLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Color4 AccentColour
|
|
||||||
{
|
|
||||||
get => base.AccentColour;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
base.AccentColour = value;
|
|
||||||
|
|
||||||
bodyPiece.AccentColour = value;
|
|
||||||
Head.AccentColour = value;
|
|
||||||
Tail.AccentColour = value;
|
|
||||||
tickContainer.ForEach(t => t.AccentColour = value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
{
|
{
|
||||||
if (Tail.AllJudged)
|
if (Tail.AllJudged)
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -23,11 +22,11 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Func<double?> HoldStartTime;
|
public Func<double?> HoldStartTime;
|
||||||
|
|
||||||
private readonly Container glowContainer;
|
|
||||||
|
|
||||||
public DrawableHoldNoteTick(HoldNoteTick hitObject)
|
public DrawableHoldNoteTick(HoldNoteTick hitObject)
|
||||||
: base(hitObject)
|
: base(hitObject)
|
||||||
{
|
{
|
||||||
|
Container glowContainer;
|
||||||
|
|
||||||
Anchor = Anchor.TopCentre;
|
Anchor = Anchor.TopCentre;
|
||||||
Origin = Anchor.TopCentre;
|
Origin = Anchor.TopCentre;
|
||||||
|
|
||||||
@ -53,23 +52,17 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
public override Color4 AccentColour
|
AccentColour.BindValueChanged(colour =>
|
||||||
{
|
|
||||||
get => base.AccentColour;
|
|
||||||
set
|
|
||||||
{
|
{
|
||||||
base.AccentColour = value;
|
|
||||||
|
|
||||||
glowContainer.EdgeEffect = new EdgeEffectParameters
|
glowContainer.EdgeEffect = new EdgeEffectParameters
|
||||||
{
|
{
|
||||||
Type = EdgeEffectType.Glow,
|
Type = EdgeEffectType.Glow,
|
||||||
Radius = 2f,
|
Radius = 2f,
|
||||||
Roundness = 15f,
|
Roundness = 15f,
|
||||||
Colour = value.Opacity(0.3f)
|
Colour = colour.NewValue.Opacity(0.3f)
|
||||||
};
|
};
|
||||||
}
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
|
@ -58,8 +58,11 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
HitObject = hitObject;
|
HitObject = hitObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool UseTransformStateManagement => false;
|
||||||
|
|
||||||
protected override void UpdateState(ArmedState state)
|
protected override void UpdateState(ArmedState state)
|
||||||
{
|
{
|
||||||
|
// TODO: update to use new state management.
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case ArmedState.Miss:
|
case ArmedState.Miss:
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osuTK.Graphics;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
@ -30,6 +29,18 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
Masking = true;
|
Masking = true;
|
||||||
|
|
||||||
AddInternal(headPiece = new NotePiece());
|
AddInternal(headPiece = new NotePiece());
|
||||||
|
|
||||||
|
AccentColour.BindValueChanged(colour =>
|
||||||
|
{
|
||||||
|
headPiece.AccentColour = colour.NewValue;
|
||||||
|
|
||||||
|
EdgeEffect = new EdgeEffectParameters
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Glow,
|
||||||
|
Colour = colour.NewValue.Lighten(1f).Opacity(0.6f),
|
||||||
|
Radius = 10,
|
||||||
|
};
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDirectionChanged(ValueChangedEvent<ScrollingDirection> e)
|
protected override void OnDirectionChanged(ValueChangedEvent<ScrollingDirection> e)
|
||||||
@ -39,23 +50,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
headPiece.Anchor = headPiece.Origin = e.NewValue == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre;
|
headPiece.Anchor = headPiece.Origin = e.NewValue == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Color4 AccentColour
|
|
||||||
{
|
|
||||||
get => base.AccentColour;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
base.AccentColour = value;
|
|
||||||
headPiece.AccentColour = AccentColour;
|
|
||||||
|
|
||||||
EdgeEffect = new EdgeEffectParameters
|
|
||||||
{
|
|
||||||
Type = EdgeEffectType.Glow,
|
|
||||||
Colour = AccentColour.Lighten(1f).Opacity(0.6f),
|
|
||||||
Radius = 10,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
{
|
{
|
||||||
if (!userTriggered)
|
if (!userTriggered)
|
||||||
|
@ -143,7 +143,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
/// <param name="hitObject">The DrawableHitObject to add.</param>
|
/// <param name="hitObject">The DrawableHitObject to add.</param>
|
||||||
public override void Add(DrawableHitObject hitObject)
|
public override void Add(DrawableHitObject hitObject)
|
||||||
{
|
{
|
||||||
hitObject.AccentColour = AccentColour;
|
hitObject.AccentColour.Value = AccentColour;
|
||||||
hitObject.OnNewResult += OnNewResult;
|
hitObject.OnNewResult += OnNewResult;
|
||||||
|
|
||||||
HitObjectContainer.Add(hitObject);
|
HitObjectContainer.Add(hitObject);
|
||||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
EdgeEffect = new EdgeEffectParameters
|
EdgeEffect = new EdgeEffectParameters
|
||||||
{
|
{
|
||||||
Type = EdgeEffectType.Glow,
|
Type = EdgeEffectType.Glow,
|
||||||
Colour = Interpolation.ValueAt(0.1f, judgedObject.AccentColour, Color4.White, 0, 1),
|
Colour = Interpolation.ValueAt(0.1f, judgedObject.AccentColour.Value, Color4.White, 0, 1),
|
||||||
Radius = 100,
|
Radius = 100,
|
||||||
},
|
},
|
||||||
Child = new Box
|
Child = new Box
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components
|
|||||||
this.hitCircle = hitCircle;
|
this.hitCircle = hitCircle;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Size = new Vector2((float)OsuHitObject.OBJECT_RADIUS * 2);
|
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
|
||||||
Scale = new Vector2(hitCircle.Scale);
|
Scale = new Vector2(hitCircle.Scale);
|
||||||
CornerRadius = Size.X / 2;
|
CornerRadius = Size.X / 2;
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
InternalChild = body = new ManualSliderBody
|
InternalChild = body = new ManualSliderBody
|
||||||
{
|
{
|
||||||
AccentColour = Color4.Transparent,
|
AccentColour = Color4.Transparent,
|
||||||
PathRadius = slider.Scale * 64
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +33,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
body.BorderColour = colours.Yellow;
|
body.BorderColour = colours.Yellow;
|
||||||
|
|
||||||
PositionBindable.BindValueChanged(_ => updatePosition(), true);
|
PositionBindable.BindValueChanged(_ => updatePosition(), true);
|
||||||
ScaleBindable.BindValueChanged(scale => body.PathRadius = scale.NewValue * 64, true);
|
ScaleBindable.BindValueChanged(scale => body.PathRadius = scale.NewValue * OsuHitObject.OBJECT_RADIUS, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePosition() => Position = slider.StackedPosition;
|
private void updatePosition() => Position = slider.StackedPosition;
|
||||||
|
@ -11,6 +11,8 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public override string Acronym => "TD";
|
public override string Acronym => "TD";
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
|
|
||||||
|
public override ModType Type => ModType.System;
|
||||||
|
|
||||||
public override bool Ranked => true;
|
public override bool Ranked => true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ using osu.Game.Rulesets.Objects.Drawables;
|
|||||||
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
|
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osuTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||||
{
|
{
|
||||||
@ -98,19 +97,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
positionBindable.BindTo(HitObject.PositionBindable);
|
positionBindable.BindTo(HitObject.PositionBindable);
|
||||||
stackHeightBindable.BindTo(HitObject.StackHeightBindable);
|
stackHeightBindable.BindTo(HitObject.StackHeightBindable);
|
||||||
scaleBindable.BindTo(HitObject.ScaleBindable);
|
scaleBindable.BindTo(HitObject.ScaleBindable);
|
||||||
}
|
|
||||||
|
|
||||||
public override Color4 AccentColour
|
AccentColour.BindValueChanged(colour =>
|
||||||
{
|
|
||||||
get => base.AccentColour;
|
|
||||||
set
|
|
||||||
{
|
{
|
||||||
base.AccentColour = value;
|
explode.Colour = colour.NewValue;
|
||||||
explode.Colour = AccentColour;
|
glow.Colour = colour.NewValue;
|
||||||
glow.Colour = AccentColour;
|
circle.Colour = colour.NewValue;
|
||||||
circle.Colour = AccentColour;
|
ApproachCircle.Colour = colour.NewValue;
|
||||||
ApproachCircle.Colour = AccentColour;
|
}, true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
@ -134,16 +128,16 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
ApplyResult(r => r.Type = result);
|
ApplyResult(r => r.Type = result);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdatePreemptState()
|
protected override void UpdateInitialTransforms()
|
||||||
{
|
{
|
||||||
base.UpdatePreemptState();
|
base.UpdateInitialTransforms();
|
||||||
|
|
||||||
ApproachCircle.FadeIn(Math.Min(HitObject.TimeFadeIn * 2, HitObject.TimePreempt));
|
ApproachCircle.FadeIn(Math.Min(HitObject.TimeFadeIn * 2, HitObject.TimePreempt));
|
||||||
ApproachCircle.ScaleTo(1.1f, HitObject.TimePreempt);
|
ApproachCircle.ScaleTo(1.1f, HitObject.TimePreempt);
|
||||||
ApproachCircle.Expire(true);
|
ApproachCircle.Expire(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateCurrentState(ArmedState state)
|
protected override void UpdateStateTransforms(ArmedState state)
|
||||||
{
|
{
|
||||||
glow.FadeOut(400);
|
glow.FadeOut(400);
|
||||||
|
|
||||||
|
@ -1,15 +1,10 @@
|
|||||||
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
|
||||||
using osu.Game.Rulesets.Osu.Judgements;
|
using osu.Game.Rulesets.Osu.Judgements;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osu.Game.Skinning;
|
|
||||||
using osuTK.Graphics;
|
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||||
@ -41,47 +36,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
protected sealed override double InitialLifetimeOffset => HitObject.TimePreempt;
|
protected sealed override double InitialLifetimeOffset => HitObject.TimePreempt;
|
||||||
|
|
||||||
protected sealed override void UpdateState(ArmedState state)
|
protected override void UpdateInitialTransforms() => this.FadeIn(HitObject.TimeFadeIn);
|
||||||
{
|
|
||||||
double transformTime = HitObject.StartTime - HitObject.TimePreempt;
|
|
||||||
|
|
||||||
base.ApplyTransformsAt(transformTime, true);
|
|
||||||
base.ClearTransformsAfter(transformTime, true);
|
|
||||||
|
|
||||||
using (BeginAbsoluteSequence(transformTime, true))
|
|
||||||
{
|
|
||||||
UpdatePreemptState();
|
|
||||||
|
|
||||||
var judgementOffset = Math.Min(HitObject.HitWindows.HalfWindowFor(HitResult.Miss), Result?.TimeOffset ?? 0);
|
|
||||||
|
|
||||||
using (BeginDelayedSequence(HitObject.TimePreempt + judgementOffset, true))
|
|
||||||
UpdateCurrentState(state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void SkinChanged(ISkinSource skin, bool allowFallback)
|
|
||||||
{
|
|
||||||
base.SkinChanged(skin, allowFallback);
|
|
||||||
|
|
||||||
if (HitObject is IHasComboInformation combo)
|
|
||||||
AccentColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : (Color4?)null) ?? Color4.White;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void UpdatePreemptState() => this.FadeIn(HitObject.TimeFadeIn);
|
|
||||||
|
|
||||||
protected virtual void UpdateCurrentState(ArmedState state)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// Todo: At some point we need to move these to DrawableHitObject after ensuring that all other Rulesets apply
|
|
||||||
// transforms in the same way and don't rely on them not being cleared
|
|
||||||
public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void ApplyTransformsAt(double time, bool propagateChildren = false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
private OsuInputManager osuActionInputManager;
|
private OsuInputManager osuActionInputManager;
|
||||||
internal OsuInputManager OsuActionInputManager => osuActionInputManager ?? (osuActionInputManager = GetContainingInputManager() as OsuInputManager);
|
internal OsuInputManager OsuActionInputManager => osuActionInputManager ?? (osuActionInputManager = GetContainingInputManager() as OsuInputManager);
|
||||||
|
@ -47,7 +47,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
ApplyResult(r => r.Type = drawableSlider.Tracking.Value ? HitResult.Great : HitResult.Miss);
|
ApplyResult(r => r.Type = drawableSlider.Tracking.Value ? HitResult.Great : HitResult.Miss);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdatePreemptState()
|
protected override void UpdateInitialTransforms()
|
||||||
{
|
{
|
||||||
animDuration = Math.Min(150, repeatPoint.SpanDuration / 2);
|
animDuration = Math.Min(150, repeatPoint.SpanDuration / 2);
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateCurrentState(ArmedState state)
|
protected override void UpdateStateTransforms(ArmedState state)
|
||||||
{
|
{
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
Body = new SnakingSliderBody(s)
|
Body = new SnakingSliderBody(s)
|
||||||
{
|
{
|
||||||
PathRadius = s.Scale * 64,
|
PathRadius = s.Scale * OsuHitObject.OBJECT_RADIUS,
|
||||||
},
|
},
|
||||||
ticks = new Container<DrawableSliderTick> { RelativeSizeAxes = Axes.Both },
|
ticks = new Container<DrawableSliderTick> { RelativeSizeAxes = Axes.Both },
|
||||||
repeatPoints = new Container<DrawableRepeatPoint> { RelativeSizeAxes = Axes.Both },
|
repeatPoints = new Container<DrawableRepeatPoint> { RelativeSizeAxes = Axes.Both },
|
||||||
@ -114,20 +114,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
pathBindable.BindTo(slider.PathBindable);
|
pathBindable.BindTo(slider.PathBindable);
|
||||||
|
|
||||||
pathBindable.BindValueChanged(_ => Body.Refresh());
|
pathBindable.BindValueChanged(_ => Body.Refresh());
|
||||||
}
|
|
||||||
|
|
||||||
public override Color4 AccentColour
|
AccentColour.BindValueChanged(colour =>
|
||||||
{
|
|
||||||
get => base.AccentColour;
|
|
||||||
set
|
|
||||||
{
|
{
|
||||||
base.AccentColour = value;
|
Body.AccentColour = colour.NewValue;
|
||||||
Body.AccentColour = AccentColour;
|
Ball.AccentColour = colour.NewValue;
|
||||||
Ball.AccentColour = AccentColour;
|
|
||||||
|
|
||||||
foreach (var drawableHitObject in NestedHitObjects)
|
foreach (var drawableHitObject in NestedHitObjects)
|
||||||
drawableHitObject.AccentColour = AccentColour;
|
drawableHitObject.AccentColour.Value = colour.NewValue;
|
||||||
}
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly Bindable<bool> Tracking = new Bindable<bool>();
|
public readonly Bindable<bool> Tracking = new Bindable<bool>();
|
||||||
@ -167,9 +162,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
base.SkinChanged(skin, allowFallback);
|
base.SkinChanged(skin, allowFallback);
|
||||||
|
|
||||||
Body.BorderSize = skin.GetValue<SkinConfiguration, float?>(s => s.SliderBorderSize) ?? SliderBody.DEFAULT_BORDER_SIZE;
|
Body.BorderSize = skin.GetValue<SkinConfiguration, float?>(s => s.SliderBorderSize) ?? SliderBody.DEFAULT_BORDER_SIZE;
|
||||||
Body.AccentColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderTrackOverride") ? s.CustomColours["SliderTrackOverride"] : (Color4?)null) ?? AccentColour;
|
Body.AccentColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderTrackOverride") ? s.CustomColours["SliderTrackOverride"] : (Color4?)null) ?? AccentColour.Value;
|
||||||
Body.BorderColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBorder") ? s.CustomColours["SliderBorder"] : (Color4?)null) ?? Color4.White;
|
Body.BorderColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBorder") ? s.CustomColours["SliderBorder"] : (Color4?)null) ?? Color4.White;
|
||||||
Ball.AccentColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : (Color4?)null) ?? AccentColour;
|
Ball.AccentColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : (Color4?)null) ?? AccentColour.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
@ -195,7 +190,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateCurrentState(ArmedState state)
|
protected override void UpdateStateTransforms(ArmedState state)
|
||||||
{
|
{
|
||||||
Ball.FadeIn();
|
Ball.FadeIn();
|
||||||
Ball.ScaleTo(HitObject.Scale);
|
Ball.ScaleTo(HitObject.Scale);
|
||||||
|
@ -34,14 +34,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
CornerRadius = Size.X / 2,
|
CornerRadius = Size.X / 2,
|
||||||
|
|
||||||
BorderThickness = 2,
|
BorderThickness = 2,
|
||||||
BorderColour = Color4.White,
|
BorderColour = Color4.White,
|
||||||
|
|
||||||
Child = new Box
|
Child = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = AccentColour,
|
Colour = AccentColour.Value,
|
||||||
Alpha = 0.3f,
|
Alpha = 0.3f,
|
||||||
}
|
}
|
||||||
}, restrictSize: false)
|
}, restrictSize: false)
|
||||||
@ -54,13 +52,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
ApplyResult(r => r.Type = Tracking ? HitResult.Great : HitResult.Miss);
|
ApplyResult(r => r.Type = Tracking ? HitResult.Great : HitResult.Miss);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdatePreemptState()
|
protected override void UpdateInitialTransforms()
|
||||||
{
|
{
|
||||||
this.FadeOut().FadeIn(ANIM_DURATION);
|
this.FadeOut().FadeIn(ANIM_DURATION);
|
||||||
this.ScaleTo(0.5f).ScaleTo(1f, ANIM_DURATION * 4, Easing.OutElasticHalf);
|
this.ScaleTo(0.5f).ScaleTo(1f, ANIM_DURATION * 4, Easing.OutElasticHalf);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateCurrentState(ArmedState state)
|
protected override void UpdateStateTransforms(ArmedState state)
|
||||||
{
|
{
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
|
@ -196,9 +196,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
symbol.RotateTo(Disc.Rotation / 2, 500, Easing.OutQuint);
|
symbol.RotateTo(Disc.Rotation / 2, 500, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdatePreemptState()
|
protected override void UpdateInitialTransforms()
|
||||||
{
|
{
|
||||||
base.UpdatePreemptState();
|
base.UpdateInitialTransforms();
|
||||||
|
|
||||||
circleContainer.ScaleTo(Spinner.Scale * 0.3f);
|
circleContainer.ScaleTo(Spinner.Scale * 0.3f);
|
||||||
circleContainer.ScaleTo(Spinner.Scale, HitObject.TimePreempt / 1.4f, Easing.OutQuint);
|
circleContainer.ScaleTo(Spinner.Scale, HitObject.TimePreempt / 1.4f, Easing.OutQuint);
|
||||||
@ -213,7 +213,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
.ScaleTo(1, 500, Easing.OutQuint);
|
.ScaleTo(1, 500, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateCurrentState(ArmedState state)
|
protected override void UpdateStateTransforms(ArmedState state)
|
||||||
{
|
{
|
||||||
var sequence = this.Delay(Spinner.Duration).FadeOut(160);
|
var sequence = this.Delay(Spinner.Duration).FadeOut(160);
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
|
|
||||||
public CirclePiece()
|
public CirclePiece()
|
||||||
{
|
{
|
||||||
Size = new Vector2((float)OsuHitObject.OBJECT_RADIUS * 2);
|
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
|
||||||
Masking = true;
|
Masking = true;
|
||||||
CornerRadius = Size.X / 2;
|
CornerRadius = Size.X / 2;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
public ExplodePiece()
|
public ExplodePiece()
|
||||||
{
|
{
|
||||||
Size = new Vector2(128);
|
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
|
||||||
|
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
public FlashPiece()
|
public FlashPiece()
|
||||||
{
|
{
|
||||||
Size = new Vector2(128);
|
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
|
||||||
|
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
public RingPiece()
|
public RingPiece()
|
||||||
{
|
{
|
||||||
Size = new Vector2(128);
|
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
|
||||||
|
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
@ -17,8 +17,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
public class SliderBall : CircularContainer, ISliderProgress, IRequireHighFrequencyMousePosition
|
public class SliderBall : CircularContainer, ISliderProgress, IRequireHighFrequencyMousePosition
|
||||||
{
|
{
|
||||||
private const float width = 128;
|
|
||||||
|
|
||||||
private Color4 accentColour = Color4.Black;
|
private Color4 accentColour = Color4.Black;
|
||||||
|
|
||||||
public Func<OsuAction?> GetInitialHitAction;
|
public Func<OsuAction?> GetInitialHitAction;
|
||||||
@ -57,8 +55,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Width = width,
|
Width = OsuHitObject.OBJECT_RADIUS * 2,
|
||||||
Height = width,
|
Height = OsuHitObject.OBJECT_RADIUS * 2,
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
Child = new SkinnableDrawable("Play/osu/sliderfollowcircle", _ => new CircularContainer
|
Child = new SkinnableDrawable("Play/osu/sliderfollowcircle", _ => new CircularContainer
|
||||||
{
|
{
|
||||||
@ -84,8 +82,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
Alpha = 1,
|
Alpha = 1,
|
||||||
Child = new Container
|
Child = new Container
|
||||||
{
|
{
|
||||||
Width = width,
|
Width = OsuHitObject.OBJECT_RADIUS * 2,
|
||||||
Height = width,
|
Height = OsuHitObject.OBJECT_RADIUS * 2,
|
||||||
// TODO: support skin filename animation (sliderb0, sliderb1...)
|
// TODO: support skin filename animation (sliderb0, sliderb1...)
|
||||||
Child = new SkinnableDrawable("Play/osu/sliderb", _ => new CircularContainer
|
Child = new SkinnableDrawable("Play/osu/sliderb", _ => new CircularContainer
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Lines;
|
using osu.Framework.Graphics.Lines;
|
||||||
@ -75,22 +76,22 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
|
|
||||||
protected SliderBody()
|
protected SliderBody()
|
||||||
{
|
{
|
||||||
InternalChild = path = new SliderPath();
|
RecyclePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initialises a new <see cref="SliderPath"/>, releasing all resources retained by the old one.
|
/// Initialises a new <see cref="SliderPath"/>, releasing all resources retained by the old one.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void RecyclePath()
|
public virtual void RecyclePath()
|
||||||
{
|
{
|
||||||
InternalChild = path = new SliderPath
|
InternalChild = path = new SliderPath
|
||||||
{
|
{
|
||||||
Position = path.Position,
|
Position = path?.Position ?? Vector2.Zero,
|
||||||
PathRadius = path.PathRadius,
|
PathRadius = path?.PathRadius ?? 10,
|
||||||
AccentColour = path.AccentColour,
|
AccentColour = path?.AccentColour ?? Color4.White,
|
||||||
BorderColour = path.BorderColour,
|
BorderColour = path?.BorderColour ?? Color4.White,
|
||||||
BorderSize = path.BorderSize,
|
BorderSize = path?.BorderSize ?? DEFAULT_BORDER_SIZE,
|
||||||
Vertices = path.Vertices
|
Vertices = path?.Vertices ?? Array.Empty<Vector2>()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -78,9 +79,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
slider.Path.GetPathToProgress(CurrentCurve, 0, 1);
|
slider.Path.GetPathToProgress(CurrentCurve, 0, 1);
|
||||||
SetVertices(CurrentCurve);
|
SetVertices(CurrentCurve);
|
||||||
|
|
||||||
// The body is sized to the full path size to avoid excessive autosize computations
|
// Force the body to be the final path size to avoid excessive autosize computations
|
||||||
|
Path.AutoSizeAxes = Axes.Both;
|
||||||
Size = Path.Size;
|
Size = Path.Size;
|
||||||
|
|
||||||
|
updatePathSize();
|
||||||
|
|
||||||
snakedPosition = Path.PositionInBoundingBox(Vector2.Zero);
|
snakedPosition = Path.PositionInBoundingBox(Vector2.Zero);
|
||||||
snakedPathOffset = Path.PositionInBoundingBox(Path.Vertices[0]);
|
snakedPathOffset = Path.PositionInBoundingBox(Path.Vertices[0]);
|
||||||
|
|
||||||
@ -93,6 +97,19 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
setRange(lastSnakedStart, lastSnakedEnd);
|
setRange(lastSnakedStart, lastSnakedEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void RecyclePath()
|
||||||
|
{
|
||||||
|
base.RecyclePath();
|
||||||
|
updatePathSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updatePathSize()
|
||||||
|
{
|
||||||
|
// Force the path to its final size to avoid excessive framebuffer resizes
|
||||||
|
Path.AutoSizeAxes = Axes.None;
|
||||||
|
Path.Size = Size;
|
||||||
|
}
|
||||||
|
|
||||||
private void setRange(double p0, double p1)
|
private void setRange(double p0, double p1)
|
||||||
{
|
{
|
||||||
if (p0 > p1)
|
if (p0 > p1)
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
{
|
{
|
||||||
public abstract class OsuHitObject : HitObject, IHasComboInformation, IHasPosition
|
public abstract class OsuHitObject : HitObject, IHasComboInformation, IHasPosition
|
||||||
{
|
{
|
||||||
public const double OBJECT_RADIUS = 64;
|
public const float OBJECT_RADIUS = 64;
|
||||||
|
|
||||||
public double TimePreempt = 600;
|
public double TimePreempt = 600;
|
||||||
public double TimeFadeIn = 400;
|
public double TimeFadeIn = 400;
|
||||||
|
@ -138,6 +138,12 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
new MultiMod(new ModWindUp<OsuHitObject>(), new ModWindDown<OsuHitObject>()),
|
new MultiMod(new ModWindUp<OsuHitObject>(), new ModWindDown<OsuHitObject>()),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
case ModType.System:
|
||||||
|
return new Mod[]
|
||||||
|
{
|
||||||
|
new OsuModTouchDevice(),
|
||||||
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return new Mod[] { };
|
return new Mod[] { };
|
||||||
}
|
}
|
||||||
|
@ -94,6 +94,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
|
|
||||||
protected override void UpdateState(ArmedState state)
|
protected override void UpdateState(ArmedState state)
|
||||||
{
|
{
|
||||||
|
// TODO: update to use new state management.
|
||||||
var circlePiece = MainPiece as CirclePiece;
|
var circlePiece = MainPiece as CirclePiece;
|
||||||
circlePiece?.FlashBox.FinishTransforms();
|
circlePiece?.FlashBox.FinishTransforms();
|
||||||
|
|
||||||
|
@ -121,6 +121,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool UseTransformStateManagement => false;
|
||||||
|
|
||||||
// Normal and clap samples are handled by the drum
|
// Normal and clap samples are handled by the drum
|
||||||
protected override IEnumerable<HitSampleInfo> GetSamples() => HitObject.Samples.Where(s => s.Name != HitSampleInfo.HIT_NORMAL && s.Name != HitSampleInfo.HIT_CLAP);
|
protected override IEnumerable<HitSampleInfo> GetSamples() => HitObject.Samples.Where(s => s.Name != HitSampleInfo.HIT_NORMAL && s.Name != HitSampleInfo.HIT_CLAP);
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
{
|
{
|
||||||
typeof(HistoricalSection),
|
typeof(HistoricalSection),
|
||||||
typeof(PaginatedMostPlayedBeatmapContainer),
|
typeof(PaginatedMostPlayedBeatmapContainer),
|
||||||
typeof(DrawableMostPlayedRow),
|
typeof(DrawableMostPlayedBeatmap),
|
||||||
typeof(DrawableProfileRow)
|
typeof(DrawableProfileRow)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -47,8 +47,8 @@ namespace osu.Game.Tournament.Screens.MapPool
|
|||||||
mapFlows = new FillFlowContainer<FillFlowContainer<TournamentBeatmapPanel>>
|
mapFlows = new FillFlowContainer<FillFlowContainer<TournamentBeatmapPanel>>
|
||||||
{
|
{
|
||||||
Y = 100,
|
Y = 100,
|
||||||
Spacing = new Vector2(10, 20),
|
Spacing = new Vector2(10, 10),
|
||||||
Padding = new MarginPadding(50),
|
Padding = new MarginPadding(25),
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
@ -218,7 +218,7 @@ namespace osu.Game.Tournament.Screens.MapPool
|
|||||||
{
|
{
|
||||||
mapFlows.Add(currentFlow = new FillFlowContainer<TournamentBeatmapPanel>
|
mapFlows.Add(currentFlow = new FillFlowContainer<TournamentBeatmapPanel>
|
||||||
{
|
{
|
||||||
Spacing = new Vector2(10, 20),
|
Spacing = new Vector2(10, 5),
|
||||||
Direction = FillDirection.Full,
|
Direction = FillDirection.Full,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y
|
AutoSizeAxes = Axes.Y
|
||||||
|
@ -386,7 +386,7 @@ namespace osu.Game.Beatmaps
|
|||||||
beatmap.OnlineBeatmapID = res.OnlineBeatmapID;
|
beatmap.OnlineBeatmapID = res.OnlineBeatmapID;
|
||||||
};
|
};
|
||||||
|
|
||||||
req.Failure += e => { LogForModel(set, $"Online retrieval failed for {beatmap}", e); };
|
req.Failure += e => { LogForModel(set, $"Online retrieval failed for {beatmap} ({e.Message})"); };
|
||||||
|
|
||||||
// intentionally blocking to limit web request concurrency
|
// intentionally blocking to limit web request concurrency
|
||||||
req.Perform(api);
|
req.Perform(api);
|
||||||
|
@ -66,6 +66,11 @@ namespace osu.Game.Beatmaps
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int FavouriteCount { get; set; }
|
public int FavouriteCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether this beatmap set has been favourited by the current user.
|
||||||
|
/// </summary>
|
||||||
|
public bool HasFavourited { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The availability of this beatmap set.
|
/// The availability of this beatmap set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -247,7 +247,7 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
// cancelling the beatmap load is safe for now since the retrieval is a synchronous
|
// cancelling the beatmap load is safe for now since the retrieval is a synchronous
|
||||||
// operation. if we add an async retrieval method this may need to be reconsidered.
|
// operation. if we add an async retrieval method this may need to be reconsidered.
|
||||||
beatmapCancellation.Cancel();
|
beatmapCancellation?.Cancel();
|
||||||
total_count.Value--;
|
total_count.Value--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ using osuTK.Graphics;
|
|||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics.Shaders;
|
using osu.Framework.Graphics.Shaders;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osuTK.Graphics.ES30;
|
|
||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -137,11 +136,13 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected int AimCount;
|
||||||
|
|
||||||
private void addTriangles(bool randomY)
|
private void addTriangles(bool randomY)
|
||||||
{
|
{
|
||||||
int aimTriangleCount = (int)(DrawWidth * DrawHeight * 0.002f / (triangleScale * triangleScale) * SpawnRatio);
|
AimCount = (int)(DrawWidth * DrawHeight * 0.002f / (triangleScale * triangleScale) * SpawnRatio);
|
||||||
|
|
||||||
for (int i = 0; i < aimTriangleCount - parts.Count; i++)
|
for (int i = 0; i < AimCount - parts.Count; i++)
|
||||||
parts.Add(createTriangle(randomY));
|
parts.Add(createTriangle(randomY));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +191,7 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
private readonly List<TriangleParticle> parts = new List<TriangleParticle>();
|
private readonly List<TriangleParticle> parts = new List<TriangleParticle>();
|
||||||
private Vector2 size;
|
private Vector2 size;
|
||||||
|
|
||||||
private readonly LinearBatch<TexturedVertex2D> vertexBatch = new LinearBatch<TexturedVertex2D>(100 * 3, 10, PrimitiveType.Triangles);
|
private TriangleBatch<TexturedVertex2D> vertexBatch;
|
||||||
|
|
||||||
public TrianglesDrawNode(Triangles source)
|
public TrianglesDrawNode(Triangles source)
|
||||||
: base(source)
|
: base(source)
|
||||||
@ -213,6 +214,12 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
{
|
{
|
||||||
base.Draw(vertexAction);
|
base.Draw(vertexAction);
|
||||||
|
|
||||||
|
if (Source.AimCount > 0 && (vertexBatch == null || vertexBatch.Size != Source.AimCount))
|
||||||
|
{
|
||||||
|
vertexBatch?.Dispose();
|
||||||
|
vertexBatch = new TriangleBatch<TexturedVertex2D>(Source.AimCount, 1);
|
||||||
|
}
|
||||||
|
|
||||||
shader.Bind();
|
shader.Bind();
|
||||||
|
|
||||||
Vector2 localInflationAmount = edge_smoothness * DrawInfo.MatrixInverse.ExtractScale().Xy;
|
Vector2 localInflationAmount = edge_smoothness * DrawInfo.MatrixInverse.ExtractScale().Xy;
|
||||||
@ -246,7 +253,7 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
vertexBatch.Dispose();
|
vertexBatch?.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
26
osu.Game/Graphics/OpenGL/Vertices/PositionAndColourVertex.cs
Normal file
26
osu.Game/Graphics/OpenGL/Vertices/PositionAndColourVertex.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// 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.Runtime.InteropServices;
|
||||||
|
using osu.Framework.Graphics.OpenGL.Vertices;
|
||||||
|
using osuTK;
|
||||||
|
using osuTK.Graphics;
|
||||||
|
using osuTK.Graphics.ES30;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.OpenGL.Vertices
|
||||||
|
{
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct PositionAndColourVertex : IEquatable<PositionAndColourVertex>, IVertex
|
||||||
|
{
|
||||||
|
[VertexMember(2, VertexAttribPointerType.Float)]
|
||||||
|
public Vector2 Position;
|
||||||
|
|
||||||
|
[VertexMember(4, VertexAttribPointerType.Float)]
|
||||||
|
public Color4 Colour;
|
||||||
|
|
||||||
|
public bool Equals(PositionAndColourVertex other)
|
||||||
|
=> Position.Equals(other.Position)
|
||||||
|
&& Colour.Equals(other.Colour);
|
||||||
|
}
|
||||||
|
}
|
80
osu.Game/Graphics/Sprites/GlowingSpriteText.cs
Normal file
80
osu.Game/Graphics/Sprites/GlowingSpriteText.cs
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
// 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.Colour;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.Sprites
|
||||||
|
{
|
||||||
|
public class GlowingSpriteText : Container, IHasText
|
||||||
|
{
|
||||||
|
private readonly OsuSpriteText spriteText, blurredText;
|
||||||
|
|
||||||
|
public string Text
|
||||||
|
{
|
||||||
|
get => spriteText.Text;
|
||||||
|
set => blurredText.Text = spriteText.Text = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FontUsage Font
|
||||||
|
{
|
||||||
|
get => spriteText.Font;
|
||||||
|
set => blurredText.Font = spriteText.Font = value.With(fixedWidth: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector2 TextSize
|
||||||
|
{
|
||||||
|
get => spriteText.Size;
|
||||||
|
set => blurredText.Size = spriteText.Size = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ColourInfo TextColour
|
||||||
|
{
|
||||||
|
get => spriteText.Colour;
|
||||||
|
set => spriteText.Colour = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ColourInfo GlowColour
|
||||||
|
{
|
||||||
|
get => blurredText.Colour;
|
||||||
|
set => blurredText.Colour = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GlowingSpriteText()
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new BufferedContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
BlurSigma = new Vector2(4),
|
||||||
|
CacheDrawnFrameBuffer = true,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Blending = BlendingMode.Additive,
|
||||||
|
Size = new Vector2(3f),
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
blurredText = new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Shadow = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
spriteText = new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Shadow = false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -76,7 +76,12 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
Masking = true,
|
Masking = true,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = path = new SmoothPath { RelativeSizeAxes = Axes.Both, PathRadius = 1 }
|
Child = path = new SmoothPath
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.None,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
PathRadius = 1
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Direction = FillDirection.Horizontal,
|
Direction = FillDirection.Horizontal,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
text = new OsuSpriteText { Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold) },
|
text = new OsuSpriteText { Font = OsuFont.GetFont(size: 14) },
|
||||||
icon = new SpriteIcon
|
icon = new SpriteIcon
|
||||||
{
|
{
|
||||||
Size = new Vector2(14),
|
Size = new Vector2(14),
|
||||||
@ -84,7 +84,11 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Current.ValueChanged += selected => { icon.Icon = selected.NewValue ? FontAwesome.Regular.CheckCircle : FontAwesome.Regular.Circle; };
|
Current.ValueChanged += selected =>
|
||||||
|
{
|
||||||
|
icon.Icon = selected.NewValue ? FontAwesome.Regular.CheckCircle : FontAwesome.Regular.Circle;
|
||||||
|
text.Font = text.Font.With(weight: selected.NewValue ? FontWeight.Bold : FontWeight.Medium);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
@ -33,6 +34,17 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
PlaceholderText = "type to search";
|
PlaceholderText = "type to search";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool OnPressed(PlatformAction action)
|
||||||
|
{
|
||||||
|
// Shift+delete is handled via PlatformAction on macOS. this is not so useful in the context of a SearchTextBox
|
||||||
|
// as we do not allow arrow key navigation in the first place (ie. the care should always be at the end of text)
|
||||||
|
// Avoid handling it here to allow other components to potentially consume the shortcut.
|
||||||
|
if (action.ActionType == PlatformActionType.CharNext && action.ActionMethod == PlatformActionMethod.Delete)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return base.OnPressed(action);
|
||||||
|
}
|
||||||
|
|
||||||
protected override bool OnKeyDown(KeyDownEvent e)
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
{
|
{
|
||||||
if (!e.ControlPressed && !e.ShiftPressed)
|
if (!e.ControlPressed && !e.ShiftPressed)
|
||||||
|
@ -7,21 +7,20 @@ using osu.Game.Online.API.Requests.Responses;
|
|||||||
|
|
||||||
namespace osu.Game.Online.API.Requests
|
namespace osu.Game.Online.API.Requests
|
||||||
{
|
{
|
||||||
public class GetUserBeatmapsRequest : APIRequest<List<APIBeatmapSet>>
|
public class GetUserBeatmapsRequest : PaginatedAPIRequest<List<APIBeatmapSet>>
|
||||||
{
|
{
|
||||||
private readonly long userId;
|
private readonly long userId;
|
||||||
private readonly int offset;
|
|
||||||
private readonly BeatmapSetType type;
|
private readonly BeatmapSetType type;
|
||||||
|
|
||||||
public GetUserBeatmapsRequest(long userId, BeatmapSetType type, int offset = 0)
|
public GetUserBeatmapsRequest(long userId, BeatmapSetType type, int page = 0, int itemsPerPage = 6)
|
||||||
|
: base(page, itemsPerPage)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.offset = offset;
|
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
|
protected override string Target => $@"users/{userId}/beatmapsets/{type.ToString().Underscore()}";
|
||||||
protected override string Target => $@"users/{userId}/beatmapsets/{type.ToString().Underscore()}?offset={offset}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum BeatmapSetType
|
public enum BeatmapSetType
|
||||||
|
@ -6,17 +6,16 @@ using osu.Game.Online.API.Requests.Responses;
|
|||||||
|
|
||||||
namespace osu.Game.Online.API.Requests
|
namespace osu.Game.Online.API.Requests
|
||||||
{
|
{
|
||||||
public class GetUserMostPlayedBeatmapsRequest : APIRequest<List<APIUserMostPlayedBeatmap>>
|
public class GetUserMostPlayedBeatmapsRequest : PaginatedAPIRequest<List<APIUserMostPlayedBeatmap>>
|
||||||
{
|
{
|
||||||
private readonly long userId;
|
private readonly long userId;
|
||||||
private readonly int offset;
|
|
||||||
|
|
||||||
public GetUserMostPlayedBeatmapsRequest(long userId, int offset = 0)
|
public GetUserMostPlayedBeatmapsRequest(long userId, int page = 0, int itemsPerPage = 5)
|
||||||
|
: base(page, itemsPerPage)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.offset = offset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string Target => $@"users/{userId}/beatmapsets/most_played?offset={offset}";
|
protected override string Target => $@"users/{userId}/beatmapsets/most_played";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,18 +6,17 @@ using osu.Game.Online.API.Requests.Responses;
|
|||||||
|
|
||||||
namespace osu.Game.Online.API.Requests
|
namespace osu.Game.Online.API.Requests
|
||||||
{
|
{
|
||||||
public class GetUserRecentActivitiesRequest : APIRequest<List<APIRecentActivity>>
|
public class GetUserRecentActivitiesRequest : PaginatedAPIRequest<List<APIRecentActivity>>
|
||||||
{
|
{
|
||||||
private readonly long userId;
|
private readonly long userId;
|
||||||
private readonly int offset;
|
|
||||||
|
|
||||||
public GetUserRecentActivitiesRequest(long userId, int offset = 0)
|
public GetUserRecentActivitiesRequest(long userId, int page = 0, int itemsPerPage = 5)
|
||||||
|
: base(page, itemsPerPage)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.offset = offset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string Target => $"users/{userId}/recent_activity?offset={offset}";
|
protected override string Target => $"users/{userId}/recent_activity";
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum RecentActivityType
|
public enum RecentActivityType
|
||||||
|
@ -6,21 +6,19 @@ using osu.Game.Online.API.Requests.Responses;
|
|||||||
|
|
||||||
namespace osu.Game.Online.API.Requests
|
namespace osu.Game.Online.API.Requests
|
||||||
{
|
{
|
||||||
public class GetUserScoresRequest : APIRequest<List<APILegacyScoreInfo>>
|
public class GetUserScoresRequest : PaginatedAPIRequest<List<APILegacyScoreInfo>>
|
||||||
{
|
{
|
||||||
private readonly long userId;
|
private readonly long userId;
|
||||||
private readonly ScoreType type;
|
private readonly ScoreType type;
|
||||||
private readonly int offset;
|
|
||||||
|
|
||||||
public GetUserScoresRequest(long userId, ScoreType type, int offset = 0)
|
public GetUserScoresRequest(long userId, ScoreType type, int page = 0, int itemsPerPage = 5)
|
||||||
|
: base(page, itemsPerPage)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.offset = offset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
|
protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLowerInvariant()}";
|
||||||
protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLowerInvariant()}?offset={offset}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ScoreType
|
public enum ScoreType
|
||||||
|
30
osu.Game/Online/API/Requests/PaginatedAPIRequest.cs
Normal file
30
osu.Game/Online/API/Requests/PaginatedAPIRequest.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// 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.Globalization;
|
||||||
|
using osu.Framework.IO.Network;
|
||||||
|
|
||||||
|
namespace osu.Game.Online.API.Requests
|
||||||
|
{
|
||||||
|
public abstract class PaginatedAPIRequest<T> : APIRequest<T>
|
||||||
|
{
|
||||||
|
private readonly int page;
|
||||||
|
private readonly int itemsPerPage;
|
||||||
|
|
||||||
|
protected PaginatedAPIRequest(int page, int itemsPerPage)
|
||||||
|
{
|
||||||
|
this.page = page;
|
||||||
|
this.itemsPerPage = itemsPerPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override WebRequest CreateWebRequest()
|
||||||
|
{
|
||||||
|
var req = base.CreateWebRequest();
|
||||||
|
|
||||||
|
req.AddParameter("offset", (page * itemsPerPage).ToString(CultureInfo.InvariantCulture));
|
||||||
|
req.AddParameter("limit", itemsPerPage.ToString(CultureInfo.InvariantCulture));
|
||||||
|
|
||||||
|
return req;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -30,6 +30,9 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
[JsonProperty(@"preview_url")]
|
[JsonProperty(@"preview_url")]
|
||||||
private string preview { get; set; }
|
private string preview { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(@"has_favourited")]
|
||||||
|
private bool hasFavourited { get; set; }
|
||||||
|
|
||||||
[JsonProperty(@"play_count")]
|
[JsonProperty(@"play_count")]
|
||||||
private int playCount { get; set; }
|
private int playCount { get; set; }
|
||||||
|
|
||||||
@ -91,6 +94,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
Ranked = ranked,
|
Ranked = ranked,
|
||||||
LastUpdated = lastUpdated,
|
LastUpdated = lastUpdated,
|
||||||
Availability = availability,
|
Availability = availability,
|
||||||
|
HasFavourited = hasFavourited,
|
||||||
},
|
},
|
||||||
Beatmaps = beatmaps?.Select(b => b.ToBeatmap(rulesets)).ToList(),
|
Beatmaps = beatmaps?.Select(b => b.ToBeatmap(rulesets)).ToList(),
|
||||||
};
|
};
|
||||||
|
@ -194,13 +194,17 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
|
|
||||||
private APIRequest getScoresRequest;
|
private APIRequest getScoresRequest;
|
||||||
|
|
||||||
|
protected abstract bool IsOnlineScope { get; }
|
||||||
|
|
||||||
public void APIStateChanged(IAPIProvider api, APIState state)
|
public void APIStateChanged(IAPIProvider api, APIState state)
|
||||||
{
|
{
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case APIState.Online:
|
case APIState.Online:
|
||||||
case APIState.Offline:
|
case APIState.Offline:
|
||||||
UpdateScores();
|
if (IsOnlineScope)
|
||||||
|
UpdateScores();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,13 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
Spacing = new Vector2(5f, 0f),
|
Spacing = new Vector2(5f, 0f),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
scoreLabel = new GlowingSpriteText(score.TotalScore.ToString(@"N0"), OsuFont.Numeric.With(size: 23), Color4.White, OsuColour.FromHex(@"83ccfa")),
|
scoreLabel = new GlowingSpriteText
|
||||||
|
{
|
||||||
|
TextColour = Color4.White,
|
||||||
|
GlowColour = OsuColour.FromHex(@"83ccfa"),
|
||||||
|
Text = score.TotalScore.ToString(@"N0"),
|
||||||
|
Font = OsuFont.Numeric.With(size: 23),
|
||||||
|
},
|
||||||
RankContainer = new Container
|
RankContainer = new Container
|
||||||
{
|
{
|
||||||
Size = new Vector2(40f, 20f),
|
Size = new Vector2(40f, 20f),
|
||||||
@ -275,49 +281,6 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
base.OnHoverLost(e);
|
base.OnHoverLost(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class GlowingSpriteText : Container
|
|
||||||
{
|
|
||||||
public GlowingSpriteText(string text, FontUsage font, Color4 textColour, Color4 glowColour)
|
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both;
|
|
||||||
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new BufferedContainer
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
BlurSigma = new Vector2(4),
|
|
||||||
CacheDrawnFrameBuffer = true,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Blending = BlendingMode.Additive,
|
|
||||||
Size = new Vector2(3f),
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Font = font.With(fixedWidth: true),
|
|
||||||
Text = text,
|
|
||||||
Colour = glowColour,
|
|
||||||
Shadow = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Font = font.With(fixedWidth: true),
|
|
||||||
Text = text,
|
|
||||||
Colour = textColour,
|
|
||||||
Shadow = false,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ScoreComponentLabel : Container, IHasTooltip
|
private class ScoreComponentLabel : Container, IHasTooltip
|
||||||
{
|
{
|
||||||
private const float icon_size = 20;
|
private const float icon_size = 20;
|
||||||
@ -367,10 +330,14 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new GlowingSpriteText(statistic.Value, OsuFont.GetFont(size: 17, weight: FontWeight.Bold), Color4.White, OsuColour.FromHex(@"83ccfa"))
|
new GlowingSpriteText
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
|
TextColour = Color4.White,
|
||||||
|
GlowColour = OsuColour.FromHex(@"83ccfa"),
|
||||||
|
Text = statistic.Value,
|
||||||
|
Font = OsuFont.GetFont(size: 17, weight: FontWeight.Bold),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -20,6 +20,7 @@ using System.Threading;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Development;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
@ -153,7 +154,7 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
this.frameworkConfig = frameworkConfig;
|
this.frameworkConfig = frameworkConfig;
|
||||||
|
|
||||||
if (!Host.IsPrimaryInstance)
|
if (!Host.IsPrimaryInstance && !DebugUtils.IsDebugBuild)
|
||||||
{
|
{
|
||||||
Logger.Log(@"osu! does not support multiple running instances.", LoggingTarget.Runtime, LogLevel.Error);
|
Logger.Log(@"osu! does not support multiple running instances.", LoggingTarget.Runtime, LogLevel.Error);
|
||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
@ -588,7 +589,7 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
int recentLogCount = 0;
|
int recentLogCount = 0;
|
||||||
|
|
||||||
const double debounce = 5000;
|
const double debounce = 60000;
|
||||||
|
|
||||||
Logger.NewEntry += entry =>
|
Logger.NewEntry += entry =>
|
||||||
{
|
{
|
||||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Backgrounds;
|
using osu.Game.Graphics.Backgrounds;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -15,7 +16,9 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
|
|||||||
{
|
{
|
||||||
public class FavouriteButton : HeaderButton
|
public class FavouriteButton : HeaderButton
|
||||||
{
|
{
|
||||||
public readonly Bindable<bool> Favourited = new Bindable<bool>();
|
public readonly Bindable<BeatmapSetInfo> BeatmapSet = new Bindable<BeatmapSetInfo>();
|
||||||
|
|
||||||
|
private readonly Bindable<bool> favourited = new Bindable<bool>();
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
@ -54,7 +57,15 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Favourited.ValueChanged += favourited =>
|
BeatmapSet.BindValueChanged(setInfo =>
|
||||||
|
{
|
||||||
|
if (setInfo.NewValue?.OnlineInfo?.HasFavourited == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
favourited.Value = setInfo.NewValue.OnlineInfo.HasFavourited;
|
||||||
|
});
|
||||||
|
|
||||||
|
favourited.ValueChanged += favourited =>
|
||||||
{
|
{
|
||||||
if (favourited.NewValue)
|
if (favourited.NewValue)
|
||||||
{
|
{
|
||||||
@ -67,8 +78,6 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
|
|||||||
icon.Icon = FontAwesome.Regular.Heart;
|
icon.Icon = FontAwesome.Regular.Heart;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Action = () => Favourited.Value = !Favourited.Value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateAfterChildren()
|
protected override void UpdateAfterChildren()
|
||||||
|
@ -161,7 +161,10 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
Margin = new MarginPadding { Top = 10 },
|
Margin = new MarginPadding { Top = 10 },
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
favouriteButton = new FavouriteButton(),
|
favouriteButton = new FavouriteButton
|
||||||
|
{
|
||||||
|
BeatmapSet = { BindTarget = BeatmapSet }
|
||||||
|
},
|
||||||
downloadButtonsContainer = new FillFlowContainer
|
downloadButtonsContainer = new FillFlowContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
@ -19,7 +19,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
public class ScoresContainer : CompositeDrawable
|
public class ScoresContainer : CompositeDrawable
|
||||||
{
|
{
|
||||||
private const int spacing = 15;
|
private const int spacing = 15;
|
||||||
private const int fade_duration = 200;
|
|
||||||
|
|
||||||
private readonly Box background;
|
private readonly Box background;
|
||||||
private readonly ScoreTable scoreTable;
|
private readonly ScoreTable scoreTable;
|
||||||
@ -53,8 +52,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
{
|
{
|
||||||
Schedule(() =>
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
loading = false;
|
|
||||||
|
|
||||||
topScoresContainer.Clear();
|
topScoresContainer.Clear();
|
||||||
|
|
||||||
if (value?.Scores.Any() != true)
|
if (value?.Scores.Any() != true)
|
||||||
@ -128,11 +125,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
background.Colour = colours.Gray2;
|
background.Colour = colours.Gray2;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool loading
|
|
||||||
{
|
|
||||||
set => loadingAnimation.FadeTo(value ? 1 : 0, fade_duration);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void getScores(BeatmapInfo beatmap)
|
private void getScores(BeatmapInfo beatmap)
|
||||||
{
|
{
|
||||||
getScoresRequest?.Cancel();
|
getScoresRequest?.Cancel();
|
||||||
@ -141,15 +133,16 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
Scores = null;
|
Scores = null;
|
||||||
|
|
||||||
if (beatmap?.OnlineBeatmapID.HasValue != true)
|
if (beatmap?.OnlineBeatmapID.HasValue != true)
|
||||||
{
|
|
||||||
loading = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
|
loadingAnimation.Show();
|
||||||
getScoresRequest = new GetScoresRequest(beatmap, beatmap.Ruleset);
|
getScoresRequest = new GetScoresRequest(beatmap, beatmap.Ruleset);
|
||||||
getScoresRequest.Success += scores => Scores = scores;
|
getScoresRequest.Success += scores =>
|
||||||
|
{
|
||||||
|
loadingAnimation.Hide();
|
||||||
|
Scores = scores;
|
||||||
|
};
|
||||||
api.Queue(getScoresRequest);
|
api.Queue(getScoresRequest);
|
||||||
loading = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
avatar = new UpdateableAvatar(hideImmediately: true)
|
avatar = new UpdateableAvatar
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
@ -99,7 +99,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold)
|
Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold)
|
||||||
},
|
},
|
||||||
flag = new UpdateableFlag(hideImmediately: true)
|
flag = new UpdateableFlag
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
|
@ -85,6 +85,7 @@ namespace osu.Game.Overlays.Chat
|
|||||||
|
|
||||||
Drawable effectedUsername = username = new OsuSpriteText
|
Drawable effectedUsername = username = new OsuSpriteText
|
||||||
{
|
{
|
||||||
|
Shadow = false,
|
||||||
Colour = hasBackground ? customUsernameColour : username_colours[message.Sender.Id % username_colours.Length],
|
Colour = hasBackground ? customUsernameColour : username_colours[message.Sender.Id % username_colours.Length],
|
||||||
Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.Bold, italics: true)
|
Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.Bold, italics: true)
|
||||||
};
|
};
|
||||||
@ -133,6 +134,7 @@ namespace osu.Game.Overlays.Chat
|
|||||||
{
|
{
|
||||||
timestamp = new OsuSpriteText
|
timestamp = new OsuSpriteText
|
||||||
{
|
{
|
||||||
|
Shadow = false,
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Font = OsuFont.GetFont(size: TextSize * 0.75f, weight: FontWeight.SemiBold, fixedWidth: true)
|
Font = OsuFont.GetFont(size: TextSize * 0.75f, weight: FontWeight.SemiBold, fixedWidth: true)
|
||||||
@ -155,6 +157,8 @@ namespace osu.Game.Overlays.Chat
|
|||||||
{
|
{
|
||||||
contentFlow = new LinkFlowContainer(t =>
|
contentFlow = new LinkFlowContainer(t =>
|
||||||
{
|
{
|
||||||
|
t.Shadow = false;
|
||||||
|
|
||||||
if (Message.IsAction)
|
if (Message.IsAction)
|
||||||
{
|
{
|
||||||
t.Font = OsuFont.GetFont(italics: true);
|
t.Font = OsuFont.GetFont(italics: true);
|
||||||
|
@ -16,6 +16,7 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Online.Chat;
|
using osu.Game.Online.Chat;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
using osuTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Chat.Tabs
|
namespace osu.Game.Overlays.Chat.Tabs
|
||||||
{
|
{
|
||||||
@ -138,6 +139,19 @@ namespace osu.Game.Overlays.Chat.Tabs
|
|||||||
updateState();
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnMouseUp(MouseUpEvent e)
|
||||||
|
{
|
||||||
|
switch (e.Button)
|
||||||
|
{
|
||||||
|
case MouseButton.Middle:
|
||||||
|
CloseButton.Click();
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
|
@ -4,26 +4,23 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Profile.Sections
|
namespace osu.Game.Overlays.Profile.Sections
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Display artist/title/mapper information, commonly used as the left portion of a profile or score display row (see <see cref="DrawableProfileRow"/>).
|
/// Display artist/title/mapper information, commonly used as the left portion of a profile or score display row (see <see cref="DrawableProfileRow"/>).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class BeatmapMetadataContainer : OsuHoverContainer
|
public abstract class BeatmapMetadataContainer : OsuHoverContainer
|
||||||
{
|
{
|
||||||
private readonly BeatmapInfo beatmap;
|
private readonly BeatmapInfo beatmap;
|
||||||
|
|
||||||
public BeatmapMetadataContainer(BeatmapInfo beatmap)
|
protected BeatmapMetadataContainer(BeatmapInfo beatmap)
|
||||||
{
|
{
|
||||||
this.beatmap = beatmap;
|
this.beatmap = beatmap;
|
||||||
|
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
TooltipText = $"{beatmap.Metadata.Artist} - {beatmap.Metadata.Title}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
@ -40,23 +37,10 @@ namespace osu.Game.Overlays.Profile.Sections
|
|||||||
Child = new FillFlowContainer
|
Child = new FillFlowContainer
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = CreateText(beatmap),
|
||||||
{
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Text = new LocalisedString((
|
|
||||||
$"{beatmap.Metadata.TitleUnicode ?? beatmap.Metadata.Title} [{beatmap.Version}] ",
|
|
||||||
$"{beatmap.Metadata.Title ?? beatmap.Metadata.TitleUnicode} [{beatmap.Version}] ")),
|
|
||||||
Font = OsuFont.GetFont(size: 15, weight: FontWeight.SemiBold, italics: true)
|
|
||||||
},
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Text = new LocalisedString((beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist)),
|
|
||||||
Padding = new MarginPadding { Top = 3 },
|
|
||||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular, italics: true)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected abstract Drawable[] CreateText(BeatmapInfo beatmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
|
|||||||
|
|
||||||
protected override void ShowMore()
|
protected override void ShowMore()
|
||||||
{
|
{
|
||||||
request = new GetUserBeatmapsRequest(User.Value.Id, type, VisiblePages++ * ItemsPerPage);
|
request = new GetUserBeatmapsRequest(User.Value.Id, type, VisiblePages++, ItemsPerPage);
|
||||||
request.Success += sets => Schedule(() =>
|
request.Success += sets => Schedule(() =>
|
||||||
{
|
{
|
||||||
MoreButton.FadeTo(sets.Count == ItemsPerPage ? 1 : 0);
|
MoreButton.FadeTo(sets.Count == ItemsPerPage ? 1 : 0);
|
||||||
|
@ -0,0 +1,182 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Beatmaps.Drawables;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osuTK;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.Graphics.Cursor;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.Profile.Sections.Historical
|
||||||
|
{
|
||||||
|
public class DrawableMostPlayedBeatmap : OsuHoverContainer
|
||||||
|
{
|
||||||
|
private const int cover_width = 100;
|
||||||
|
private const int corner_radius = 6;
|
||||||
|
private const int height = 50;
|
||||||
|
|
||||||
|
private readonly BeatmapInfo beatmap;
|
||||||
|
private readonly int playCount;
|
||||||
|
|
||||||
|
private Box background;
|
||||||
|
|
||||||
|
protected override IEnumerable<Drawable> EffectTargets => new[] { background };
|
||||||
|
|
||||||
|
public DrawableMostPlayedBeatmap(BeatmapInfo beatmap, int playCount)
|
||||||
|
{
|
||||||
|
this.beatmap = beatmap;
|
||||||
|
this.playCount = playCount;
|
||||||
|
Enabled.Value = true; //manually enabled, because we have no action
|
||||||
|
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
Height = height;
|
||||||
|
|
||||||
|
Masking = true;
|
||||||
|
CornerRadius = corner_radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours)
|
||||||
|
{
|
||||||
|
IdleColour = colours.GreySeafoam;
|
||||||
|
HoverColour = colours.GreySeafoamLight;
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new UpdateableBeatmapSetCover
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Width = cover_width,
|
||||||
|
BeatmapSet = beatmap.BeatmapSet,
|
||||||
|
CoverType = BeatmapSetCoverType.List,
|
||||||
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Padding = new MarginPadding { Left = cover_width - corner_radius },
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Masking = true,
|
||||||
|
CornerRadius = corner_radius,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
background = new Box { RelativeSizeAxes = Axes.Both },
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Padding = new MarginPadding(10),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new MostPlayedBeatmapMetadataContainer(beatmap),
|
||||||
|
new LinkFlowContainer(t => t.Font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular))
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
Colour = colours.GreySeafoamLighter
|
||||||
|
}.With(d =>
|
||||||
|
{
|
||||||
|
d.AddText("mapped by ");
|
||||||
|
d.AddUserLink(beatmap.Metadata.Author);
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new PlayCountText(playCount)
|
||||||
|
{
|
||||||
|
Anchor = Anchor.CentreRight,
|
||||||
|
Origin = Anchor.CentreRight
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private class MostPlayedBeatmapMetadataContainer : BeatmapMetadataContainer
|
||||||
|
{
|
||||||
|
public MostPlayedBeatmapMetadataContainer(BeatmapInfo beatmap)
|
||||||
|
: base(beatmap)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Drawable[] CreateText(BeatmapInfo beatmap) => new Drawable[]
|
||||||
|
{
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = new LocalisedString((
|
||||||
|
$"{beatmap.Metadata.TitleUnicode ?? beatmap.Metadata.Title} [{beatmap.Version}] ",
|
||||||
|
$"{beatmap.Metadata.Title ?? beatmap.Metadata.TitleUnicode} [{beatmap.Version}] ")),
|
||||||
|
Font = OsuFont.GetFont(weight: FontWeight.Bold)
|
||||||
|
},
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = "by " + new LocalisedString((beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist)),
|
||||||
|
Font = OsuFont.GetFont(weight: FontWeight.Regular)
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private class PlayCountText : CompositeDrawable, IHasTooltip
|
||||||
|
{
|
||||||
|
public string TooltipText => "times played";
|
||||||
|
|
||||||
|
public PlayCountText(int playCount)
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
InternalChild = new FillFlowContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.CentreRight,
|
||||||
|
Origin = Anchor.CentreRight,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Spacing = new Vector2(5, 0),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new SpriteIcon
|
||||||
|
{
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Size = new Vector2(12),
|
||||||
|
Icon = FontAwesome.Solid.Play,
|
||||||
|
},
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Text = playCount.ToString(),
|
||||||
|
Font = OsuFont.GetFont(size: 20, weight: FontWeight.Regular),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours)
|
||||||
|
{
|
||||||
|
Colour = colours.Yellow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,77 +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.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Beatmaps.Drawables;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Graphics.Containers;
|
|
||||||
using osu.Game.Graphics.Sprites;
|
|
||||||
using osuTK;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Profile.Sections.Historical
|
|
||||||
{
|
|
||||||
public class DrawableMostPlayedRow : DrawableProfileRow
|
|
||||||
{
|
|
||||||
private readonly BeatmapInfo beatmap;
|
|
||||||
private readonly int playCount;
|
|
||||||
|
|
||||||
public DrawableMostPlayedRow(BeatmapInfo beatmap, int playCount)
|
|
||||||
{
|
|
||||||
this.beatmap = beatmap;
|
|
||||||
this.playCount = playCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Drawable CreateLeftVisual() => new UpdateableBeatmapSetCover
|
|
||||||
{
|
|
||||||
Anchor = Anchor.CentreLeft,
|
|
||||||
Origin = Anchor.CentreLeft,
|
|
||||||
Size = new Vector2(80, 50),
|
|
||||||
BeatmapSet = beatmap.BeatmapSet,
|
|
||||||
CoverType = BeatmapSetCoverType.List,
|
|
||||||
};
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load()
|
|
||||||
{
|
|
||||||
LeftFlowContainer.Add(new BeatmapMetadataContainer(beatmap));
|
|
||||||
LeftFlowContainer.Add(new LinkFlowContainer(t => t.Font = OsuFont.GetFont(size: 12))
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Direction = FillDirection.Horizontal,
|
|
||||||
}.With(d =>
|
|
||||||
{
|
|
||||||
d.AddText("mapped by ");
|
|
||||||
d.AddUserLink(beatmap.Metadata.Author);
|
|
||||||
}));
|
|
||||||
|
|
||||||
RightFlowContainer.Add(new FillFlowContainer
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Direction = FillDirection.Horizontal,
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Anchor = Anchor.BottomRight,
|
|
||||||
Origin = Anchor.BottomRight,
|
|
||||||
Text = playCount.ToString(),
|
|
||||||
Font = OsuFont.GetFont(size: 18, weight: FontWeight.SemiBold, italics: true)
|
|
||||||
},
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Anchor = Anchor.BottomRight,
|
|
||||||
Origin = Anchor.BottomRight,
|
|
||||||
Text = @"times played ",
|
|
||||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular, italics: true)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
|||||||
|
|
||||||
protected override void ShowMore()
|
protected override void ShowMore()
|
||||||
{
|
{
|
||||||
request = new GetUserMostPlayedBeatmapsRequest(User.Value.Id, VisiblePages++ * ItemsPerPage);
|
request = new GetUserMostPlayedBeatmapsRequest(User.Value.Id, VisiblePages++, ItemsPerPage);
|
||||||
request.Success += beatmaps => Schedule(() =>
|
request.Success += beatmaps => Schedule(() =>
|
||||||
{
|
{
|
||||||
MoreButton.FadeTo(beatmaps.Count == ItemsPerPage ? 1 : 0);
|
MoreButton.FadeTo(beatmaps.Count == ItemsPerPage ? 1 : 0);
|
||||||
@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
|||||||
|
|
||||||
foreach (var beatmap in beatmaps)
|
foreach (var beatmap in beatmaps)
|
||||||
{
|
{
|
||||||
ItemsContainer.Add(new DrawableMostPlayedRow(beatmap.GetBeatmapInfo(Rulesets), beatmap.PlayCount));
|
ItemsContainer.Add(new DrawableMostPlayedBeatmap(beatmap.GetBeatmapInfo(Rulesets), beatmap.PlayCount));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -10,6 +10,8 @@ using osu.Game.Online.Leaderboards;
|
|||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Profile.Sections.Ranks
|
namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||||
{
|
{
|
||||||
@ -51,7 +53,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
|||||||
|
|
||||||
RightFlowContainer.Insert(1, text);
|
RightFlowContainer.Insert(1, text);
|
||||||
|
|
||||||
LeftFlowContainer.Add(new BeatmapMetadataContainer(Score.Beatmap));
|
LeftFlowContainer.Add(new ProfileScoreBeatmapMetadataContainer(Score.Beatmap));
|
||||||
LeftFlowContainer.Add(new DrawableDate(Score.Date));
|
LeftFlowContainer.Add(new DrawableDate(Score.Date));
|
||||||
|
|
||||||
foreach (Mod mod in Score.Mods)
|
foreach (Mod mod in Score.Mods)
|
||||||
@ -64,5 +66,30 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
|||||||
Width = 60,
|
Width = 60,
|
||||||
FillMode = FillMode.Fit,
|
FillMode = FillMode.Fit,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private class ProfileScoreBeatmapMetadataContainer : BeatmapMetadataContainer
|
||||||
|
{
|
||||||
|
public ProfileScoreBeatmapMetadataContainer(BeatmapInfo beatmap)
|
||||||
|
: base(beatmap)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Drawable[] CreateText(BeatmapInfo beatmap) => new Drawable[]
|
||||||
|
{
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = new LocalisedString((
|
||||||
|
$"{beatmap.Metadata.TitleUnicode ?? beatmap.Metadata.Title} [{beatmap.Version}] ",
|
||||||
|
$"{beatmap.Metadata.Title ?? beatmap.Metadata.TitleUnicode} [{beatmap.Version}] ")),
|
||||||
|
Font = OsuFont.GetFont(size: 15, weight: FontWeight.SemiBold, italics: true)
|
||||||
|
},
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = new LocalisedString((beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist)),
|
||||||
|
Padding = new MarginPadding { Top = 3 },
|
||||||
|
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular, italics: true)
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
|||||||
|
|
||||||
protected override void ShowMore()
|
protected override void ShowMore()
|
||||||
{
|
{
|
||||||
request = new GetUserScoresRequest(User.Value.Id, type, VisiblePages++ * ItemsPerPage);
|
request = new GetUserScoresRequest(User.Value.Id, type, VisiblePages++, ItemsPerPage);
|
||||||
request.Success += scores => Schedule(() =>
|
request.Success += scores => Schedule(() =>
|
||||||
{
|
{
|
||||||
foreach (var s in scores)
|
foreach (var s in scores)
|
||||||
|
@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
|
|||||||
|
|
||||||
protected override void ShowMore()
|
protected override void ShowMore()
|
||||||
{
|
{
|
||||||
request = new GetUserRecentActivitiesRequest(User.Value.Id, VisiblePages++ * ItemsPerPage);
|
request = new GetUserRecentActivitiesRequest(User.Value.Id, VisiblePages++, ItemsPerPage);
|
||||||
request.Success += activities => Schedule(() =>
|
request.Success += activities => Schedule(() =>
|
||||||
{
|
{
|
||||||
MoreButton.FadeTo(activities.Count == ItemsPerPage ? 1 : 0);
|
MoreButton.FadeTo(activities.Count == ItemsPerPage ? 1 : 0);
|
||||||
|
@ -71,16 +71,11 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
// Scheduled to allow the flow layout to be computed before the line position is updated
|
// Scheduled to allow the flow layout to be computed before the line position is updated
|
||||||
private void moveLineToCurrent() => ScheduleAfterChildren(() =>
|
private void moveLineToCurrent() => ScheduleAfterChildren(() =>
|
||||||
{
|
{
|
||||||
foreach (var tabItem in TabContainer)
|
if (SelectedTab != null)
|
||||||
{
|
{
|
||||||
if (tabItem.Value.Equals(Current.Value))
|
ModeButtonLine.MoveToX(SelectedTab.DrawPosition.X, !hasInitialPosition ? 0 : 200, Easing.OutQuint);
|
||||||
{
|
hasInitialPosition = true;
|
||||||
ModeButtonLine.MoveToX(tabItem.DrawPosition.X, !hasInitialPosition ? 0 : 200, Easing.OutQuint);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hasInitialPosition = true;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
public override bool HandleNonPositionalInput => !Current.Disabled && base.HandleNonPositionalInput;
|
public override bool HandleNonPositionalInput => !Current.Disabled && base.HandleNonPositionalInput;
|
||||||
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Batches;
|
||||||
using osu.Framework.Graphics.OpenGL.Vertices;
|
using osu.Framework.Graphics.OpenGL.Vertices;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Framework.Graphics.Shaders;
|
using osu.Framework.Graphics.Shaders;
|
||||||
@ -13,6 +14,7 @@ using osu.Framework.Graphics.Sprites;
|
|||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Game.Beatmaps.Timing;
|
using osu.Game.Beatmaps.Timing;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.OpenGL.Vertices;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
@ -153,9 +155,17 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
private Vector2 flashlightSize;
|
private Vector2 flashlightSize;
|
||||||
private float flashlightDim;
|
private float flashlightDim;
|
||||||
|
|
||||||
|
private readonly VertexBatch<PositionAndColourVertex> quadBatch = new QuadBatch<PositionAndColourVertex>(1, 1);
|
||||||
|
private readonly Action<TexturedVertex2D> addAction;
|
||||||
|
|
||||||
public FlashlightDrawNode(Flashlight source)
|
public FlashlightDrawNode(Flashlight source)
|
||||||
: base(source)
|
: base(source)
|
||||||
{
|
{
|
||||||
|
addAction = v => quadBatch.Add(new PositionAndColourVertex
|
||||||
|
{
|
||||||
|
Position = v.Position,
|
||||||
|
Colour = v.Colour
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ApplyState()
|
public override void ApplyState()
|
||||||
@ -179,7 +189,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
shader.GetUniform<Vector2>("flashlightSize").UpdateValue(ref flashlightSize);
|
shader.GetUniform<Vector2>("flashlightSize").UpdateValue(ref flashlightSize);
|
||||||
shader.GetUniform<float>("flashlightDim").UpdateValue(ref flashlightDim);
|
shader.GetUniform<float>("flashlightDim").UpdateValue(ref flashlightDim);
|
||||||
|
|
||||||
DrawQuad(Texture.WhitePixel, screenSpaceDrawQuad, DrawColourInfo.Colour, vertexAction: vertexAction);
|
DrawQuad(Texture.WhitePixel, screenSpaceDrawQuad, DrawColourInfo.Colour, vertexAction: addAction);
|
||||||
|
|
||||||
shader.Unbind();
|
shader.Unbind();
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
DifficultyIncrease,
|
DifficultyIncrease,
|
||||||
Conversion,
|
Conversion,
|
||||||
Automation,
|
Automation,
|
||||||
Fun
|
Fun,
|
||||||
|
System
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Extensions.TypeExtensions;
|
using osu.Framework.Extensions.TypeExtensions;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
@ -18,14 +17,14 @@ using osuTK.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Objects.Drawables
|
namespace osu.Game.Rulesets.Objects.Drawables
|
||||||
{
|
{
|
||||||
public abstract class DrawableHitObject : SkinReloadableDrawable, IHasAccentColour
|
public abstract class DrawableHitObject : SkinReloadableDrawable
|
||||||
{
|
{
|
||||||
public readonly HitObject HitObject;
|
public readonly HitObject HitObject;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The colour used for various elements of this DrawableHitObject.
|
/// The colour used for various elements of this DrawableHitObject.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual Color4 AccentColour { get; set; } = Color4.Gray;
|
public readonly Bindable<Color4> AccentColour = new Bindable<Color4>(Color4.Gray);
|
||||||
|
|
||||||
// Todo: Rulesets should be overriding the resources instead, but we need to figure out where/when to apply overrides first
|
// Todo: Rulesets should be overriding the resources instead, but we need to figure out where/when to apply overrides first
|
||||||
protected virtual string SampleNamespace => null;
|
protected virtual string SampleNamespace => null;
|
||||||
@ -82,7 +81,9 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
|
|
||||||
public override bool IsPresent => base.IsPresent || (State.Value == ArmedState.Idle && Clock?.CurrentTime >= LifetimeStart);
|
public override bool IsPresent => base.IsPresent || (State.Value == ArmedState.Idle && Clock?.CurrentTime >= LifetimeStart);
|
||||||
|
|
||||||
public readonly Bindable<ArmedState> State = new Bindable<ArmedState>();
|
private readonly Bindable<ArmedState> state = new Bindable<ArmedState>();
|
||||||
|
|
||||||
|
public IBindable<ArmedState> State => state;
|
||||||
|
|
||||||
protected DrawableHitObject(HitObject hitObject)
|
protected DrawableHitObject(HitObject hitObject)
|
||||||
{
|
{
|
||||||
@ -117,33 +118,120 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ClearInternal(bool disposeChildren = true) => throw new InvalidOperationException($"Should never clear a {nameof(DrawableHitObject)}");
|
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
updateState(ArmedState.Idle, true);
|
||||||
State.ValueChanged += armed =>
|
|
||||||
{
|
|
||||||
UpdateState(armed.NewValue);
|
|
||||||
|
|
||||||
// apply any custom state overrides
|
|
||||||
ApplyCustomUpdateState?.Invoke(this, armed.NewValue);
|
|
||||||
|
|
||||||
if (armed.NewValue == ArmedState.Hit)
|
|
||||||
PlaySamples();
|
|
||||||
};
|
|
||||||
|
|
||||||
State.TriggerChange();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void UpdateState(ArmedState state);
|
#region State / Transform Management
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Bind to apply a custom state which can override the default implementation.
|
/// Bind to apply a custom state which can override the default implementation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<DrawableHitObject, ArmedState> ApplyCustomUpdateState;
|
public event Action<DrawableHitObject, ArmedState> ApplyCustomUpdateState;
|
||||||
|
|
||||||
|
/// <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>
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
if (State.Value == newState && !force)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (UseTransformStateManagement)
|
||||||
|
{
|
||||||
|
double transformTime = HitObject.StartTime - InitialLifetimeOffset;
|
||||||
|
|
||||||
|
base.ApplyTransformsAt(transformTime, true);
|
||||||
|
base.ClearTransformsAfter(transformTime, true);
|
||||||
|
|
||||||
|
using (BeginAbsoluteSequence(transformTime, true))
|
||||||
|
{
|
||||||
|
UpdateInitialTransforms();
|
||||||
|
|
||||||
|
var judgementOffset = Math.Min(HitObject.HitWindows?.HalfWindowFor(HitResult.Miss) ?? double.MaxValue, Result?.TimeOffset ?? 0);
|
||||||
|
|
||||||
|
using (BeginDelayedSequence(InitialLifetimeOffset + judgementOffset, true))
|
||||||
|
{
|
||||||
|
UpdateStateTransforms(newState);
|
||||||
|
state.Value = newState;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
state.Value = newState;
|
||||||
|
|
||||||
|
UpdateState(newState);
|
||||||
|
|
||||||
|
// apply any custom state overrides
|
||||||
|
ApplyCustomUpdateState?.Invoke(this, newState);
|
||||||
|
|
||||||
|
if (newState == ArmedState.Hit)
|
||||||
|
PlaySamples();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Apply (generally fade-in) transforms leading into the <see cref="HitObject"/> start time.
|
||||||
|
/// The local drawable hierarchy is recursively delayed to <see cref="LifetimeStart"/> for convenience.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This is called once before every <see cref="UpdateStateTransforms"/>. This is to ensure a good state in the case
|
||||||
|
/// the <see cref="JudgementResult.TimeOffset"/> was negative and potentially altered the pre-hit transforms.
|
||||||
|
/// </remarks>
|
||||||
|
protected virtual void UpdateInitialTransforms()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Apply transforms based on the current <see cref="ArmedState"/>. Previous states are automatically cleared.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="state">The new armed state.</param>
|
||||||
|
protected virtual void UpdateStateTransforms(ArmedState state)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <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>
|
||||||
|
protected virtual void UpdateState(ArmedState state)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
protected override void SkinChanged(ISkinSource skin, bool allowFallback)
|
||||||
|
{
|
||||||
|
base.SkinChanged(skin, allowFallback);
|
||||||
|
|
||||||
|
if (HitObject is IHasComboInformation combo)
|
||||||
|
AccentColour.Value = skin.GetValue<SkinConfiguration, Color4?>(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : (Color4?)null) ?? Color4.White;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Plays all the hit sounds for this <see cref="DrawableHitObject"/>.
|
/// Plays all the hit sounds for this <see cref="DrawableHitObject"/>.
|
||||||
/// This is invoked automatically when this <see cref="DrawableHitObject"/> is hit.
|
/// This is invoked automatically when this <see cref="DrawableHitObject"/> is hit.
|
||||||
@ -164,7 +252,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
|
|
||||||
Result.TimeOffset = 0;
|
Result.TimeOffset = 0;
|
||||||
Result.Type = HitResult.None;
|
Result.Type = HitResult.None;
|
||||||
State.Value = ArmedState.Idle;
|
|
||||||
|
updateState(ArmedState.Idle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -196,6 +285,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This is only used as an optimisation to delay the initial update of this <see cref="DrawableHitObject"/> and may be tuned more aggressively if required.
|
/// This is only used as an optimisation to delay the initial update of this <see cref="DrawableHitObject"/> and may be tuned more aggressively if required.
|
||||||
|
/// It is indirectly used to decide the automatic transform offset provided to <see cref="UpdateInitialTransforms"/>.
|
||||||
/// A more accurate <see cref="LifetimeStart"/> should be set inside <see cref="UpdateState"/> for an <see cref="ArmedState.Idle"/> state.
|
/// A more accurate <see cref="LifetimeStart"/> should be set inside <see cref="UpdateState"/> for an <see cref="ArmedState.Idle"/> state.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected virtual double InitialLifetimeOffset => 10000;
|
protected virtual double InitialLifetimeOffset => 10000;
|
||||||
@ -244,11 +334,11 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HitResult.Miss:
|
case HitResult.Miss:
|
||||||
State.Value = ArmedState.Miss;
|
updateState(ArmedState.Miss);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
State.Value = ArmedState.Hit;
|
updateState(ArmedState.Hit);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,8 @@ namespace osu.Game.Screens.Multi.Match.Components
|
|||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool IsOnlineScope => true;
|
||||||
|
|
||||||
protected override APIRequest FetchScores(Action<IEnumerable<APIRoomScoreInfo>> scoresCallback)
|
protected override APIRequest FetchScores(Action<IEnumerable<APIRoomScoreInfo>> scoresCallback)
|
||||||
{
|
{
|
||||||
if (roomId.Value == null)
|
if (roomId.Value == null)
|
||||||
|
@ -19,11 +19,11 @@ namespace osu.Game.Screens.Play
|
|||||||
private const float remaining_time_container_max_size = 0.3f;
|
private const float remaining_time_container_max_size = 0.3f;
|
||||||
private const int vertical_margin = 25;
|
private const int vertical_margin = 25;
|
||||||
|
|
||||||
private List<BreakPeriod> breaks;
|
|
||||||
|
|
||||||
private readonly Container fadeContainer;
|
private readonly Container fadeContainer;
|
||||||
|
|
||||||
public List<BreakPeriod> Breaks
|
private IReadOnlyList<BreakPeriod> breaks;
|
||||||
|
|
||||||
|
public IReadOnlyList<BreakPeriod> Breaks
|
||||||
{
|
{
|
||||||
get => breaks;
|
get => breaks;
|
||||||
set
|
set
|
||||||
|
@ -26,6 +26,9 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
public class BeatmapCarousel : OsuScrollContainer
|
public class BeatmapCarousel : OsuScrollContainer
|
||||||
{
|
{
|
||||||
|
private const float bleed_top = FilterControl.HEIGHT;
|
||||||
|
private const float bleed_bottom = Footer.HEIGHT;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Triggered when the <see cref="BeatmapSets"/> loaded change and are completely loaded.
|
/// Triggered when the <see cref="BeatmapSets"/> loaded change and are completely loaded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -81,7 +84,8 @@ namespace osu.Game.Screens.Select
|
|||||||
itemsCache.Invalidate();
|
itemsCache.Invalidate();
|
||||||
scrollPositionCache.Invalidate();
|
scrollPositionCache.Invalidate();
|
||||||
|
|
||||||
Schedule(() =>
|
// Run on late scheduler want to ensure this runs after all pending UpdateBeatmapSet / RemoveBeatmapSet operations are run.
|
||||||
|
SchedulerAfterChildren.Add(() =>
|
||||||
{
|
{
|
||||||
BeatmapSetsChanged?.Invoke();
|
BeatmapSetsChanged?.Invoke();
|
||||||
BeatmapSetsLoaded = true;
|
BeatmapSetsLoaded = true;
|
||||||
@ -129,19 +133,16 @@ namespace osu.Game.Screens.Select
|
|||||||
loadBeatmapSets(beatmaps.GetAllUsableBeatmapSetsEnumerable());
|
loadBeatmapSets(beatmaps.GetAllUsableBeatmapSetsEnumerable());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet)
|
public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() =>
|
||||||
{
|
{
|
||||||
Schedule(() =>
|
var existingSet = beatmapSets.FirstOrDefault(b => b.BeatmapSet.ID == beatmapSet.ID);
|
||||||
{
|
|
||||||
var existingSet = beatmapSets.FirstOrDefault(b => b.BeatmapSet.ID == beatmapSet.ID);
|
|
||||||
|
|
||||||
if (existingSet == null)
|
if (existingSet == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
root.RemoveChild(existingSet);
|
root.RemoveChild(existingSet);
|
||||||
itemsCache.Invalidate();
|
itemsCache.Invalidate();
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
public void UpdateBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() =>
|
public void UpdateBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() =>
|
||||||
{
|
{
|
||||||
@ -338,6 +339,25 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public bool AllowSelection = true;
|
public bool AllowSelection = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Half the height of the visible content.
|
||||||
|
/// <remarks>
|
||||||
|
/// This is different from the height of <see cref="ScrollContainer{T}.displayableContent"/>, since
|
||||||
|
/// the beatmap carousel bleeds into the <see cref="FilterControl"/> and the <see cref="Footer"/>
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
private float visibleHalfHeight => (DrawHeight + bleed_bottom + bleed_top) / 2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The position of the lower visible bound with respect to the current scroll position.
|
||||||
|
/// </summary>
|
||||||
|
private float visibleBottomBound => Current + DrawHeight + bleed_bottom;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The position of the upper visible bound with respect to the current scroll position.
|
||||||
|
/// </summary>
|
||||||
|
private float visibleUpperBound => Current - bleed_top;
|
||||||
|
|
||||||
public void FlushPendingFilterOperations()
|
public void FlushPendingFilterOperations()
|
||||||
{
|
{
|
||||||
if (PendingFilter?.Completed == false)
|
if (PendingFilter?.Completed == false)
|
||||||
@ -414,6 +434,8 @@ namespace osu.Game.Screens.Select
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool ReceivePositionalInputAtSubTree(Vector2 screenSpacePos) => ReceivePositionalInputAt(screenSpacePos);
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
@ -424,17 +446,15 @@ namespace osu.Game.Screens.Select
|
|||||||
if (!scrollPositionCache.IsValid)
|
if (!scrollPositionCache.IsValid)
|
||||||
updateScrollPosition();
|
updateScrollPosition();
|
||||||
|
|
||||||
float drawHeight = DrawHeight;
|
|
||||||
|
|
||||||
// Remove all items that should no longer be on-screen
|
// Remove all items that should no longer be on-screen
|
||||||
scrollableContent.RemoveAll(p => p.Y < Current - p.DrawHeight || p.Y > Current + drawHeight || !p.IsPresent);
|
scrollableContent.RemoveAll(p => p.Y < visibleUpperBound - p.DrawHeight || p.Y > visibleBottomBound || !p.IsPresent);
|
||||||
|
|
||||||
// Find index range of all items that should be on-screen
|
// Find index range of all items that should be on-screen
|
||||||
Trace.Assert(Items.Count == yPositions.Count);
|
Trace.Assert(Items.Count == yPositions.Count);
|
||||||
|
|
||||||
int firstIndex = yPositions.BinarySearch(Current - DrawableCarouselItem.MAX_HEIGHT);
|
int firstIndex = yPositions.BinarySearch(visibleUpperBound - DrawableCarouselItem.MAX_HEIGHT);
|
||||||
if (firstIndex < 0) firstIndex = ~firstIndex;
|
if (firstIndex < 0) firstIndex = ~firstIndex;
|
||||||
int lastIndex = yPositions.BinarySearch(Current + drawHeight);
|
int lastIndex = yPositions.BinarySearch(visibleBottomBound);
|
||||||
if (lastIndex < 0) lastIndex = ~lastIndex;
|
if (lastIndex < 0) lastIndex = ~lastIndex;
|
||||||
|
|
||||||
int notVisibleCount = 0;
|
int notVisibleCount = 0;
|
||||||
@ -486,9 +506,8 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
// Update externally controlled state of currently visible items
|
// Update externally controlled state of currently visible items
|
||||||
// (e.g. x-offset and opacity).
|
// (e.g. x-offset and opacity).
|
||||||
float halfHeight = drawHeight / 2;
|
|
||||||
foreach (DrawableCarouselItem p in scrollableContent.Children)
|
foreach (DrawableCarouselItem p in scrollableContent.Children)
|
||||||
updateItem(p, halfHeight);
|
updateItem(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
@ -542,7 +561,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
yPositions.Clear();
|
yPositions.Clear();
|
||||||
|
|
||||||
float currentY = DrawHeight / 2;
|
float currentY = visibleHalfHeight;
|
||||||
DrawableCarouselBeatmapSet lastSet = null;
|
DrawableCarouselBeatmapSet lastSet = null;
|
||||||
|
|
||||||
scrollTarget = null;
|
scrollTarget = null;
|
||||||
@ -575,7 +594,6 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
float? setY = null;
|
float? setY = null;
|
||||||
if (!d.IsLoaded || beatmap.Alpha == 0) // can't use IsPresent due to DrawableCarouselItem override.
|
if (!d.IsLoaded || beatmap.Alpha == 0) // can't use IsPresent due to DrawableCarouselItem override.
|
||||||
// ReSharper disable once PossibleNullReferenceException (resharper broken?)
|
|
||||||
setY = lastSet.Y + lastSet.DrawHeight + 5;
|
setY = lastSet.Y + lastSet.DrawHeight + 5;
|
||||||
|
|
||||||
if (d.IsLoaded)
|
if (d.IsLoaded)
|
||||||
@ -596,7 +614,7 @@ namespace osu.Game.Screens.Select
|
|||||||
currentY += d.DrawHeight + 5;
|
currentY += d.DrawHeight + 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentY += DrawHeight / 2;
|
currentY += visibleHalfHeight;
|
||||||
scrollableContent.Height = currentY;
|
scrollableContent.Height = currentY;
|
||||||
|
|
||||||
if (BeatmapSetsLoaded && (selectedBeatmapSet == null || selectedBeatmap == null || selectedBeatmapSet.State.Value != CarouselItemState.Selected))
|
if (BeatmapSetsLoaded && (selectedBeatmapSet == null || selectedBeatmap == null || selectedBeatmapSet.State.Value != CarouselItemState.Selected))
|
||||||
@ -637,18 +655,15 @@ namespace osu.Game.Screens.Select
|
|||||||
/// the current scroll position.
|
/// the current scroll position.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="p">The item to be updated.</param>
|
/// <param name="p">The item to be updated.</param>
|
||||||
/// <param name="halfHeight">Half the draw height of the carousel container.</param>
|
private void updateItem(DrawableCarouselItem p)
|
||||||
private void updateItem(DrawableCarouselItem p, float halfHeight)
|
|
||||||
{
|
{
|
||||||
var height = p.IsPresent ? p.DrawHeight : 0;
|
float itemDrawY = p.Position.Y - visibleUpperBound + p.DrawHeight / 2;
|
||||||
|
float dist = Math.Abs(1f - itemDrawY / visibleHalfHeight);
|
||||||
float itemDrawY = p.Position.Y - Current + height / 2;
|
|
||||||
float dist = Math.Abs(1f - itemDrawY / halfHeight);
|
|
||||||
|
|
||||||
// Setting the origin position serves as an additive position on top of potential
|
// Setting the origin position serves as an additive position on top of potential
|
||||||
// local transformation we may want to apply (e.g. when a item gets selected, we
|
// local transformation we may want to apply (e.g. when a item gets selected, we
|
||||||
// may want to smoothly transform it leftwards.)
|
// may want to smoothly transform it leftwards.)
|
||||||
p.OriginPosition = new Vector2(-offsetX(dist, halfHeight), 0);
|
p.OriginPosition = new Vector2(-offsetX(dist, visibleHalfHeight), 0);
|
||||||
|
|
||||||
// We are applying a multiplicative alpha (which is internally done by nesting an
|
// We are applying a multiplicative alpha (which is internally done by nesting an
|
||||||
// additional container and setting that container's alpha) such that we can
|
// additional container and setting that container's alpha) such that we can
|
||||||
|
@ -25,22 +25,6 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private Bindable<BeatmapDetailTab> selectedTab;
|
private Bindable<BeatmapDetailTab> selectedTab;
|
||||||
|
|
||||||
private void invokeOnFilter()
|
|
||||||
{
|
|
||||||
OnFilter?.Invoke(tabs.Current.Value, modsCheckbox.Current.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colour, OsuConfigManager config)
|
|
||||||
{
|
|
||||||
modsCheckbox.AccentColour = tabs.AccentColour = colour.YellowLight;
|
|
||||||
|
|
||||||
selectedTab = config.GetBindable<BeatmapDetailTab>(OsuSetting.BeatmapDetailTab);
|
|
||||||
|
|
||||||
tabs.Current.BindTo(selectedTab);
|
|
||||||
tabs.Current.TriggerChange();
|
|
||||||
}
|
|
||||||
|
|
||||||
public BeatmapDetailAreaTabControl()
|
public BeatmapDetailAreaTabControl()
|
||||||
{
|
{
|
||||||
Height = HEIGHT;
|
Height = HEIGHT;
|
||||||
@ -66,12 +50,31 @@ namespace osu.Game.Screens.Select
|
|||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
Text = @"Mods",
|
Text = @"Mods",
|
||||||
|
Alpha = 0,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
tabs.Current.ValueChanged += _ => invokeOnFilter();
|
tabs.Current.ValueChanged += _ => invokeOnFilter();
|
||||||
modsCheckbox.Current.ValueChanged += _ => invokeOnFilter();
|
modsCheckbox.Current.ValueChanged += _ => invokeOnFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colour, OsuConfigManager config)
|
||||||
|
{
|
||||||
|
modsCheckbox.AccentColour = tabs.AccentColour = colour.YellowLight;
|
||||||
|
|
||||||
|
selectedTab = config.GetBindable<BeatmapDetailTab>(OsuSetting.BeatmapDetailTab);
|
||||||
|
|
||||||
|
tabs.Current.BindTo(selectedTab);
|
||||||
|
tabs.Current.TriggerChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void invokeOnFilter()
|
||||||
|
{
|
||||||
|
OnFilter?.Invoke(tabs.Current.Value, modsCheckbox.Current.Value);
|
||||||
|
|
||||||
|
modsCheckbox.FadeTo(tabs.Current.Value == BeatmapDetailTab.Details ? 0 : 1, 200, Easing.OutQuint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum BeatmapDetailTab
|
public enum BeatmapDetailTab
|
||||||
|
@ -14,7 +14,6 @@ using osu.Game.Graphics.UserInterface;
|
|||||||
using osu.Game.Screens.Select.Filter;
|
using osu.Game.Screens.Select.Filter;
|
||||||
using Container = osu.Framework.Graphics.Containers.Container;
|
using Container = osu.Framework.Graphics.Containers.Container;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Events;
|
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
|
|
||||||
@ -22,6 +21,8 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
public class FilterControl : Container
|
public class FilterControl : Container
|
||||||
{
|
{
|
||||||
|
public const float HEIGHT = 100;
|
||||||
|
|
||||||
public Action<FilterCriteria> FilterChanged;
|
public Action<FilterCriteria> FilterChanged;
|
||||||
|
|
||||||
private readonly OsuTabControl<SortMode> sortTabs;
|
private readonly OsuTabControl<SortMode> sortTabs;
|
||||||
@ -120,7 +121,8 @@ namespace osu.Game.Screens.Select
|
|||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Height = 24,
|
Height = 24,
|
||||||
Width = 0.5f,
|
Width = 0.5f,
|
||||||
AutoSort = true
|
AutoSort = true,
|
||||||
|
Current = { Value = GroupMode.Title }
|
||||||
},
|
},
|
||||||
//spriteText = new OsuSpriteText
|
//spriteText = new OsuSpriteText
|
||||||
//{
|
//{
|
||||||
@ -139,6 +141,7 @@ namespace osu.Game.Screens.Select
|
|||||||
Width = 0.5f,
|
Width = 0.5f,
|
||||||
Height = 24,
|
Height = 24,
|
||||||
AutoSort = true,
|
AutoSort = true,
|
||||||
|
Current = { Value = SortMode.Title }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -185,11 +188,5 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateCriteria() => FilterChanged?.Invoke(CreateCriteria());
|
private void updateCriteria() => FilterChanged?.Invoke(CreateCriteria());
|
||||||
|
|
||||||
protected override bool OnMouseDown(MouseDownEvent e) => true;
|
|
||||||
|
|
||||||
protected override bool OnMouseMove(MouseMoveEvent e) => true;
|
|
||||||
|
|
||||||
protected override bool OnClick(ClickEvent e) => true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,8 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool IsOnlineScope => Scope != BeatmapLeaderboardScope.Local;
|
||||||
|
|
||||||
protected override APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresCallback)
|
protected override APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresCallback)
|
||||||
{
|
{
|
||||||
if (Scope == BeatmapLeaderboardScope.Local)
|
if (Scope == BeatmapLeaderboardScope.Local)
|
||||||
|
@ -121,7 +121,7 @@ namespace osu.Game.Screens.Select
|
|||||||
Size = new Vector2(wedged_container_size.X, 1),
|
Size = new Vector2(wedged_container_size.X, 1),
|
||||||
Padding = new MarginPadding
|
Padding = new MarginPadding
|
||||||
{
|
{
|
||||||
Bottom = 50,
|
Bottom = Footer.HEIGHT,
|
||||||
Top = wedged_container_size.Y + left_area_padding,
|
Top = wedged_container_size.Y + left_area_padding,
|
||||||
Left = left_area_padding,
|
Left = left_area_padding,
|
||||||
Right = left_area_padding * 2,
|
Right = left_area_padding * 2,
|
||||||
@ -147,20 +147,29 @@ namespace osu.Game.Screens.Select
|
|||||||
Width = 0.5f,
|
Width = 0.5f,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
Carousel = new BeatmapCarousel
|
new Container
|
||||||
{
|
{
|
||||||
Masking = false,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Size = new Vector2(1 - wedged_container_size.X, 1),
|
Padding = new MarginPadding
|
||||||
Anchor = Anchor.CentreRight,
|
{
|
||||||
Origin = Anchor.CentreRight,
|
Top = FilterControl.HEIGHT,
|
||||||
SelectionChanged = updateSelectedBeatmap,
|
Bottom = Footer.HEIGHT
|
||||||
BeatmapSetsChanged = carouselBeatmapsLoaded,
|
},
|
||||||
|
Child = Carousel = new BeatmapCarousel
|
||||||
|
{
|
||||||
|
Masking = false,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Size = new Vector2(1 - wedged_container_size.X, 1),
|
||||||
|
Anchor = Anchor.CentreRight,
|
||||||
|
Origin = Anchor.CentreRight,
|
||||||
|
SelectionChanged = updateSelectedBeatmap,
|
||||||
|
BeatmapSetsChanged = carouselBeatmapsLoaded,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
FilterControl = new FilterControl
|
FilterControl = new FilterControl
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Height = 100,
|
Height = FilterControl.HEIGHT,
|
||||||
FilterChanged = c => Carousel.Filter(c),
|
FilterChanged = c => Carousel.Filter(c),
|
||||||
Background = { Width = 2 },
|
Background = { Width = 2 },
|
||||||
Exit = () =>
|
Exit = () =>
|
||||||
|
@ -5,7 +5,6 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Transforms;
|
|
||||||
|
|
||||||
namespace osu.Game.Users.Drawables
|
namespace osu.Game.Users.Drawables
|
||||||
{
|
{
|
||||||
@ -38,8 +37,6 @@ namespace osu.Game.Users.Drawables
|
|||||||
set => base.EdgeEffect = value;
|
set => base.EdgeEffect = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool TransformImmediately { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether to show a default guest representation on null user (as opposed to nothing).
|
/// Whether to show a default guest representation on null user (as opposed to nothing).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -50,14 +47,11 @@ namespace osu.Game.Users.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly BindableBool OpenOnClick = new BindableBool(true);
|
public readonly BindableBool OpenOnClick = new BindableBool(true);
|
||||||
|
|
||||||
public UpdateableAvatar(User user = null, bool hideImmediately = false)
|
public UpdateableAvatar(User user = null)
|
||||||
{
|
{
|
||||||
TransformImmediately = hideImmediately;
|
|
||||||
User = user;
|
User = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override TransformSequence<Drawable> ApplyHideTransforms(Drawable drawable) => TransformImmediately ? drawable?.FadeOut() : base.ApplyHideTransforms(drawable);
|
|
||||||
|
|
||||||
protected override Drawable CreateDrawable(User user)
|
protected override Drawable CreateDrawable(User user)
|
||||||
{
|
{
|
||||||
if (user == null && !ShowGuestOnNull)
|
if (user == null && !ShowGuestOnNull)
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Transforms;
|
|
||||||
|
|
||||||
namespace osu.Game.Users.Drawables
|
namespace osu.Game.Users.Drawables
|
||||||
{
|
{
|
||||||
@ -15,21 +14,16 @@ namespace osu.Game.Users.Drawables
|
|||||||
set => Model = value;
|
set => Model = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool TransformImmediately { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether to show a place holder on null country.
|
/// Whether to show a place holder on null country.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ShowPlaceholderOnNull = true;
|
public bool ShowPlaceholderOnNull = true;
|
||||||
|
|
||||||
public UpdateableFlag(Country country = null, bool hideImmediately = false)
|
public UpdateableFlag(Country country = null)
|
||||||
{
|
{
|
||||||
TransformImmediately = hideImmediately;
|
|
||||||
Country = country;
|
Country = country;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override TransformSequence<Drawable> ApplyHideTransforms(Drawable drawable) => TransformImmediately ? drawable?.FadeOut() : base.ApplyHideTransforms(drawable);
|
|
||||||
|
|
||||||
protected override Drawable CreateDrawable(Country country)
|
protected override Drawable CreateDrawable(Country country)
|
||||||
{
|
{
|
||||||
if (country == null && !ShowPlaceholderOnNull)
|
if (country == null && !ShowPlaceholderOnNull)
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.717.1" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.726.2" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.23.0" />
|
<PackageReference Include="SharpCompress" Version="0.23.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
@ -105,8 +105,8 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.717.1" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.726.2" />
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.717.1" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.726.2" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
@ -1,15 +1,25 @@
|
|||||||
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Threading.Tasks;
|
||||||
using Foundation;
|
using Foundation;
|
||||||
using osu.Framework.iOS;
|
using osu.Framework.iOS;
|
||||||
using osu.Game;
|
using osu.Game;
|
||||||
|
using UIKit;
|
||||||
|
|
||||||
namespace osu.iOS
|
namespace osu.iOS
|
||||||
{
|
{
|
||||||
[Register("AppDelegate")]
|
[Register("AppDelegate")]
|
||||||
public class AppDelegate : GameAppDelegate
|
public class AppDelegate : GameAppDelegate
|
||||||
{
|
{
|
||||||
protected override Framework.Game CreateGame() => new OsuGameIOS();
|
private OsuGameIOS game;
|
||||||
|
|
||||||
|
protected override Framework.Game CreateGame() => game = new OsuGameIOS();
|
||||||
|
|
||||||
|
public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)
|
||||||
|
{
|
||||||
|
Task.Run(() => game.Import(url.Path));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,5 +40,70 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>XSAppIconAssets</key>
|
<key>XSAppIconAssets</key>
|
||||||
<string>Assets.xcassets/AppIcon.appiconset</string>
|
<string>Assets.xcassets/AppIcon.appiconset</string>
|
||||||
|
<key>UTExportedTypeDeclarations</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>UTTypeConformsTo</key>
|
||||||
|
<array>
|
||||||
|
<string></string>
|
||||||
|
</array>
|
||||||
|
<key>UTTypeIdentifier</key>
|
||||||
|
<string>sh.ppy.osu.items</string>
|
||||||
|
<key>UTTypeTagSpecification</key>
|
||||||
|
<dict/>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>UTTypeConformsTo</key>
|
||||||
|
<array>
|
||||||
|
<string>sh.ppy.osu.items</string>
|
||||||
|
</array>
|
||||||
|
<key>UTTypeIdentifier</key>
|
||||||
|
<string>sh.ppy.osu.osr</string>
|
||||||
|
<key>UTTypeTagSpecification</key>
|
||||||
|
<dict>
|
||||||
|
<key>public.filename-extension</key>
|
||||||
|
<string>osr</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>UTTypeConformsTo</key>
|
||||||
|
<array>
|
||||||
|
<string>sh.ppy.osu.items</string>
|
||||||
|
</array>
|
||||||
|
<key>UTTypeIdentifier</key>
|
||||||
|
<string>sh.ppy.osu.osk</string>
|
||||||
|
<key>UTTypeTagSpecification</key>
|
||||||
|
<dict>
|
||||||
|
<key>public.filename-extension</key>
|
||||||
|
<string>osk</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>UTTypeConformsTo</key>
|
||||||
|
<array>
|
||||||
|
<string>sh.ppy.osu.items</string>
|
||||||
|
</array>
|
||||||
|
<key>UTTypeIdentifier</key>
|
||||||
|
<string>sh.ppy.osu.osz</string>
|
||||||
|
<key>UTTypeTagSpecification</key>
|
||||||
|
<dict>
|
||||||
|
<key>public.filename-extension</key>
|
||||||
|
<string>osz</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleDocumentTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>LSHandlerRank</key>
|
||||||
|
<string>Owner</string>
|
||||||
|
<key>CFBundleTypeName</key>
|
||||||
|
<string>Supported osu! files</string>
|
||||||
|
<key>LSItemContentTypes</key>
|
||||||
|
<array>
|
||||||
|
<string>sh.ppy.osu.items</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
Reference in New Issue
Block a user