Merge branch 'master' into editor-readability

This commit is contained in:
Bartłomiej Dach 2022-05-13 21:10:48 +02:00 committed by GitHub
commit ab5c736da1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 218 additions and 30 deletions

View File

@ -1,5 +1,5 @@
<p align="center">
<img width="500px" src="assets/lazer.png">
<img width="500" alt="osu! logo" src="assets/lazer.png">
</p>
# osu!
@ -8,6 +8,7 @@
[![GitHub release](https://img.shields.io/github/release/ppy/osu.svg)](https://github.com/ppy/osu/releases/latest)
[![CodeFactor](https://www.codefactor.io/repository/github/ppy/osu/badge)](https://www.codefactor.io/repository/github/ppy/osu)
[![dev chat](https://discordapp.com/api/guilds/188630481301012481/widget.png?style=shield)](https://discord.gg/ppy)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/osu-web/localized.svg)](https://crowdin.com/project/osu-web)
A free-to-win rhythm game. Rhythm is just a *click* away!
@ -31,7 +32,7 @@ If you are looking to install or test osu! without setting up a development envi
**Latest build:**
| [Windows 8.1+ (x64)](https://github.com/ppy/osu/releases/latest/download/install.exe) | macOS 10.15+ ([Intel](https://github.com/ppy/osu/releases/latest/download/osu.app.Intel.zip), [Apple Silicon](https://github.com/ppy/osu/releases/latest/download/osu.app.Apple.Silicon.zip)) | [Linux (x64)](https://github.com/ppy/osu/releases/latest/download/osu.AppImage) | [iOS 10+](https://osu.ppy.sh/home/testflight) | [Android 5+](https://github.com/ppy/osu/releases/latest/download/sh.ppy.osulazer.apk)
| [Windows 8.1+ (x64)](https://github.com/ppy/osu/releases/latest/download/install.exe) | macOS 10.15+ ([Intel](https://github.com/ppy/osu/releases/latest/download/osu.app.Intel.zip), [Apple Silicon](https://github.com/ppy/osu/releases/latest/download/osu.app.Apple.Silicon.zip)) | [Linux (x64)](https://github.com/ppy/osu/releases/latest/download/osu.AppImage) | [iOS 10+](https://osu.ppy.sh/home/testflight) | [Android 5+](https://github.com/ppy/osu/releases/latest/download/sh.ppy.osulazer.apk) |
| ------------- | ------------- | ------------- | ------------- | ------------- |
- The iOS testflight link may fill up (Apple has a hard limit of 10,000 users). We reset it occasionally when this happens. Please do not ask about this. Check back regularly for link resets or follow [peppy](https://twitter.com/ppy) on twitter for announcements of link resets.
@ -104,6 +105,8 @@ When it comes to contributing to the project, the two main things you can do to
Note that while we already have certain standards in place, nothing is set in stone. If you have an issue with the way code is structured, with any libraries we are using, or with any processes involved with contributing, *please* bring it up. We welcome all feedback so we can make contributing to this project as painless as possible.
If you wish to help with localisation efforts, head over to [crowdin](https://crowdin.com/project/osu-web).
For those interested, we love to reward quality contributions via [bounties](https://docs.google.com/spreadsheets/d/1jNXfj_S3Pb5PErA-czDdC9DUu4IgUbe1Lt8E7CYUJuE/view?&rm=minimal#gid=523803337), paid out via PayPal or osu!supporter tags. Don't hesitate to [request a bounty](https://docs.google.com/forms/d/e/1FAIpQLSet_8iFAgPMG526pBZ2Kic6HSh7XPM3fE8xPcnWNkMzINDdYg/viewform) for your work on this project.
## Licence

View File

@ -51,7 +51,7 @@
<Reference Include="Java.Interop" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.422.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.513.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.511.0" />
</ItemGroup>
<ItemGroup Label="Transitive Dependencies">

View File

@ -28,6 +28,51 @@ namespace osu.Game.Tests.Visual.Editing
return beatmap;
}
[Test]
public void TestSeekToFirst()
{
pressAndCheckTime(Key.Z, 2170);
pressAndCheckTime(Key.Z, 0);
pressAndCheckTime(Key.Z, 2170);
AddAssert("track not running", () => !EditorClock.IsRunning);
}
[Test]
public void TestRestart()
{
pressAndCheckTime(Key.V, 227170);
AddAssert("track not running", () => !EditorClock.IsRunning);
AddStep("press X", () => InputManager.Key(Key.X));
AddAssert("track running", () => EditorClock.IsRunning);
AddAssert("time restarted", () => EditorClock.CurrentTime < 100000);
}
[Test]
public void TestPauseResume()
{
AddAssert("track not running", () => !EditorClock.IsRunning);
AddStep("press C", () => InputManager.Key(Key.C));
AddAssert("track running", () => EditorClock.IsRunning);
AddStep("press C", () => InputManager.Key(Key.C));
AddAssert("track not running", () => !EditorClock.IsRunning);
}
[Test]
public void TestSeekToLast()
{
pressAndCheckTime(Key.V, 227170);
pressAndCheckTime(Key.V, 229170);
pressAndCheckTime(Key.V, 227170);
AddAssert("track not running", () => !EditorClock.IsRunning);
}
[Test]
public void TestSnappedSeeking()
{

View File

@ -155,9 +155,8 @@ namespace osu.Game.Online.Chat
{
public Func<Message, ChatLine> CreateChatLineAction;
protected override ChatLine CreateChatLine(Message m) => CreateChatLineAction(m);
protected override DaySeparator CreateDaySeparator(DateTimeOffset time) => new CustomDaySeparator(time);
[Resolved]
private OsuColour colours { get; set; }
public StandAloneDrawableChannel(Channel channel)
: base(channel)
@ -170,23 +169,16 @@ namespace osu.Game.Online.Chat
ChatLineFlow.Padding = new MarginPadding { Horizontal = 0 };
}
private class CustomDaySeparator : DaySeparator
{
public CustomDaySeparator(DateTimeOffset time)
: base(time)
{
}
protected override ChatLine CreateChatLine(Message m) => CreateChatLineAction(m);
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.Yellow;
TextSize = 14;
LineHeight = 1;
Padding = new MarginPadding { Horizontal = 10 };
Margin = new MarginPadding { Vertical = 5 };
}
}
protected override Drawable CreateDaySeparator(DateTimeOffset time) => new DaySeparator(time)
{
TextSize = 14,
Colour = colours.Yellow,
LineHeight = 1,
Padding = new MarginPadding { Horizontal = 10 },
Margin = new MarginPadding { Vertical = 5 },
};
}
protected class StandAloneMessage : ChatLine

View File

@ -0,0 +1,109 @@
// 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.
#nullable enable
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.Chat;
namespace osu.Game.Overlays.Chat
{
public class ChatOverlayDrawableChannel : DrawableChannel
{
public ChatOverlayDrawableChannel(Channel channel)
: base(channel)
{
}
[BackgroundDependencyLoader]
private void load()
{
ChatLineFlow.Padding = new MarginPadding(0);
}
protected override Drawable CreateDaySeparator(DateTimeOffset time) => new ChatOverlayDaySeparator(time);
private class ChatOverlayDaySeparator : Container
{
private readonly DateTimeOffset time;
public ChatOverlayDaySeparator(DateTimeOffset time)
{
this.time = time;
}
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Padding = new MarginPadding { Horizontal = 15, Vertical = 20 };
Child = new GridContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
ColumnDimensions = new[]
{
new Dimension(GridSizeMode.Absolute, 200),
new Dimension(GridSizeMode.Absolute, 15),
new Dimension(),
},
Content = new[]
{
new[]
{
new GridContainer
{
RelativeSizeAxes = Axes.Both,
ColumnDimensions = new[]
{
new Dimension(),
new Dimension(GridSizeMode.Absolute, 15),
new Dimension(GridSizeMode.AutoSize),
},
Content = new[]
{
new[]
{
new Circle
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
Colour = colourProvider.Background5,
RelativeSizeAxes = Axes.X,
Height = 2,
},
Drawable.Empty(),
new OsuSpriteText
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
Text = time.ToLocalTime().ToString("dd MMMM yyyy").ToUpper(),
Font = OsuFont.Torus.With(size: 15, weight: FontWeight.SemiBold),
Colour = colourProvider.Content1,
},
},
},
},
Drawable.Empty(),
new Circle
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Colour = colourProvider.Background5,
RelativeSizeAxes = Axes.X,
Height = 2,
},
},
},
};
}
}
}
}

View File

@ -38,7 +38,7 @@ namespace osu.Game.Overlays.Chat
private Container searchIconContainer = null!;
private ChatTextBox chatTextBox = null!;
private const float chatting_text_width = 240;
private const float chatting_text_width = 220;
private const float search_icon_width = 40;
[BackgroundDependencyLoader]

View File

@ -121,10 +121,10 @@ namespace osu.Game.Overlays.Chat
protected virtual ChatLine CreateChatLine(Message m) => new ChatLine(m);
protected virtual DaySeparator CreateDaySeparator(DateTimeOffset time) => new DaySeparator(time)
protected virtual Drawable CreateDaySeparator(DateTimeOffset time) => new DaySeparator(time)
{
Margin = new MarginPadding { Vertical = 10 },
Colour = colours.ChatBlue.Lighten(0.7f),
Margin = new MarginPadding { Vertical = 10 },
};
private void newMessagesArrived(IEnumerable<Message> newMessages) => Schedule(() =>

View File

@ -37,7 +37,7 @@ namespace osu.Game.Overlays
private LoadingLayer loading = null!;
private ChannelListing channelListing = null!;
private ChatTextBar textBar = null!;
private Container<DrawableChannel> currentChannelContainer = null!;
private Container<ChatOverlayDrawableChannel> currentChannelContainer = null!;
private readonly BindableFloat chatHeight = new BindableFloat();
@ -117,7 +117,7 @@ namespace osu.Game.Overlays
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background4,
},
currentChannelContainer = new Container<DrawableChannel>
currentChannelContainer = new Container<ChatOverlayDrawableChannel>
{
RelativeSizeAxes = Axes.Both,
},
@ -249,7 +249,7 @@ namespace osu.Game.Overlays
textBar.ShowSearch.Value = false;
loading.Show();
LoadComponentAsync(new DrawableChannel(newChannel), loaded =>
LoadComponentAsync(new ChatOverlayDrawableChannel(newChannel), loaded =>
{
currentChannelContainer.Clear();
currentChannelContainer.Add(loaded);

View File

@ -33,6 +33,7 @@ using osu.Game.Overlays.Notifications;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects;
using osu.Game.Screens.Edit.Components;
using osu.Game.Screens.Edit.Components.Menus;
using osu.Game.Screens.Edit.Components.Timelines.Summary;
@ -474,6 +475,44 @@ namespace osu.Game.Screens.Edit
case Key.Right:
seek(e, 1);
return true;
// Track traversal keys.
// Matching osu-stable implementations.
case Key.Z:
// Seek to first object time, or track start if already there.
double? firstObjectTime = editorBeatmap.HitObjects.FirstOrDefault()?.StartTime;
if (firstObjectTime == null || clock.CurrentTime == firstObjectTime)
clock.Seek(0);
else
clock.Seek(firstObjectTime.Value);
return true;
case Key.X:
// Restart playback from beginning of track.
clock.Seek(0);
clock.Start();
return true;
case Key.C:
// Pause or resume.
if (clock.IsRunning)
clock.Stop();
else
clock.Start();
return true;
case Key.V:
// Seek to last object time, or track end if already there.
// Note that in osu-stable subsequent presses when at track end won't return to last object.
// This has intentionally been changed to make it more useful.
double? lastObjectTime = editorBeatmap.HitObjects.LastOrDefault()?.GetEndTime();
if (lastObjectTime == null || clock.CurrentTime == lastObjectTime)
clock.Seek(clock.TrackLength);
else
clock.Seek(lastObjectTime.Value);
return true;
}
return base.OnKeyDown(e);

View File

@ -36,7 +36,7 @@
</PackageReference>
<PackageReference Include="Realm" Version="10.12.0" />
<PackageReference Include="ppy.osu.Framework" Version="2022.511.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.422.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.513.0" />
<PackageReference Include="Sentry" Version="3.17.1" />
<PackageReference Include="SharpCompress" Version="0.31.0" />
<PackageReference Include="NUnit" Version="3.13.3" />

View File

@ -62,7 +62,7 @@
</ItemGroup>
<ItemGroup Label="Package References">
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.511.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.422.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.513.0" />
</ItemGroup>
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net6.0) -->
<PropertyGroup>