Skip to content

Commit

Permalink
Merge branch 'master' into stacking-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Aug 5, 2024
2 parents 37a296b + 136cdcf commit 117d6bf
Show file tree
Hide file tree
Showing 182 changed files with 4,332 additions and 1,480 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
]
},
"ppy.localisationanalyser.tools": {
"version": "2024.517.0",
"version": "2024.802.0",
"commands": [
"localisation"
]
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ jobs:
matrix:
os:
- { prettyname: Windows, fullname: windows-latest }
- { prettyname: macOS, fullname: macos-latest }
# macOS runner performance has gotten unbearably slow so let's turn them off temporarily.
# - { prettyname: macOS, fullname: macos-latest }
- { prettyname: Linux, fullname: ubuntu-latest }
threadingMode: ['SingleThread', 'MultiThreaded']
timeout-minutes: 60
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ When in doubt, it's probably best to start with a discussion first. We will esca

While pull requests from unaffiliated contributors are welcome, please note that due to significant community interest and limited review throughput, the core team's primary focus is on the issues which are currently [on the roadmap](https://github.com/orgs/ppy/projects/7/views/6). Reviewing PRs that fall outside of the scope of the roadmap is done on a best-effort basis, so please be aware that it may take a while before a core maintainer gets around to review your change.

The [issue tracker](https://github.com/ppy/osu/issues) should provide plenty of issues to start with. We also have a [`good-first-issue`](https://github.com/ppy/osu/issues?q=is%3Aissue+is%3Aopen+label%3Agood-first-issue) label, although from experience it is not used very often, as it is relatively rare that we can spot an issue that will definitively be a good first issue for a new contributor regardless of their programming experience.
The [issue tracker](https://github.com/ppy/osu/issues) should provide plenty of issues to start with. We also have a [`good first issue`](https://github.com/ppy/osu/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label, although from experience it is not used very often, as it is relatively rare that we can spot an issue that will definitively be a good first issue for a new contributor regardless of their programming experience.

In the case of simple issues, a direct PR is okay. However, if you decide to work on an existing issue which doesn't seem trivial, **please ask us first**. This way we can try to estimate if it is a good fit for you and provide the correct direction on how to address it. In addition, note that while we do not rule out external contributors from working on roadmapped issues, we will generally prefer to handle them ourselves unless they're not very time sensitive.

Expand Down
2 changes: 1 addition & 1 deletion osu.Android.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.Android" Version="2024.702.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2024.802.0" />
</ItemGroup>
<PropertyGroup>
<!-- Fody does not handle Android build well, and warns when unchanged.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public void TestVertexDrag()

AddMouseMoveStep(-100, 100);
addVertexCheckStep(3, 1, times[0], positions[0]);
addDragEndStep();
}

[Test]
Expand All @@ -100,6 +101,9 @@ public void TestMultipleDrag()
AddMouseMoveStep(times[2] - 50, positions[2] - 50);
addVertexCheckStep(4, 1, times[1] - 50, positions[1] - 50);
addVertexCheckStep(4, 2, times[2] - 50, positions[2] - 50);

AddStep("release control", () => InputManager.ReleaseKey(Key.ControlLeft));
addDragEndStep();
}

[Test]
Expand All @@ -113,6 +117,7 @@ public void TestSliderVelocityChange()
addDragStartStep(times[1], positions[1]);
AddMouseMoveStep(times[1], 400);
AddAssert("slider velocity changed", () => !hitObject.SliderVelocityMultiplierBindable.IsDefault);
addDragEndStep();
}

[Test]
Expand All @@ -129,6 +134,7 @@ public void TestScrollWhileDrag()
AddStep("scroll playfield", () => manualClock.CurrentTime += 200);
AddMouseMoveStep(times[1] + 200, positions[1] + 100);
addVertexCheckStep(2, 1, times[1] + 200, positions[1] + 100);
addDragEndStep();
}

[Test]
Expand Down Expand Up @@ -161,18 +167,18 @@ public void TestAddVertex()
addAddVertexSteps(500, 150);
addVertexCheckStep(3, 1, 500, 150);

addAddVertexSteps(90, 200);
addVertexCheckStep(4, 1, times[0], positions[0]);
addAddVertexSteps(160, 200);
addVertexCheckStep(4, 1, 160, 200);

addAddVertexSteps(750, 180);
addVertexCheckStep(5, 4, 750, 180);
addVertexCheckStep(5, 4, 800, 160);
AddAssert("duration is changed", () => Precision.AlmostEquals(hitObject.Duration, 800 - times[0], 1e-3));
}

[Test]
public void TestDeleteVertex()
{
double[] times = { 100, 300, 500 };
double[] times = { 100, 300, 400 };
float[] positions = { 100, 200, 150 };
addBlueprintStep(times, positions);

Expand Down Expand Up @@ -265,7 +271,7 @@ private void addDeleteVertexSteps(double time, float x)
AddStep("delete vertex", () =>
{
InputManager.PressKey(Key.ShiftLeft);
InputManager.Click(MouseButton.Left);
InputManager.Click(MouseButton.Right);
InputManager.ReleaseKey(Key.ShiftLeft);
});
}
Expand Down
16 changes: 14 additions & 2 deletions osu.Game.Rulesets.Catch/Edit/Blueprints/Components/EditablePath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Screens.Edit;
using osuTK;

namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components
Expand Down Expand Up @@ -42,6 +43,9 @@ public abstract partial class EditablePath : CompositeDrawable
[Resolved]
private IBeatSnapProvider? beatSnapProvider { get; set; }

[Resolved]
protected EditorBeatmap? EditorBeatmap { get; private set; }

protected EditablePath(Func<float, double> positionToTime)
{
PositionToTime = positionToTime;
Expand Down Expand Up @@ -103,15 +107,23 @@ public void UpdateHitObjectFromPath(JuiceStream hitObject)
//
// The value is clamped here by the bindable min and max values.
// In case the required velocity is too large, the path is not preserved.
double previousVelocity = svBindable.Value;
svBindable.Value = Math.Ceiling(requiredVelocity / svToVelocityFactor);

path.ConvertToSliderPath(hitObject.Path, hitObject.LegacyConvertedY, hitObject.Velocity);
// adjust velocity locally, so that once the SV change is applied by applying defaults
// (triggered by `EditorBeatmap.Update()` call at end of method),
// it results in the outcome desired by the user.
double relativeChange = svBindable.Value / previousVelocity;
double localVelocity = hitObject.Velocity * relativeChange;
path.ConvertToSliderPath(hitObject.Path, hitObject.LegacyConvertedY, localVelocity);

if (beatSnapProvider == null) return;

double endTime = hitObject.StartTime + path.Duration;
double snappedEndTime = beatSnapProvider.SnapTime(endTime, hitObject.StartTime);
hitObject.Path.ExpectedDistance.Value = (snappedEndTime - hitObject.StartTime) * hitObject.Velocity;
hitObject.Path.ExpectedDistance.Value = (snappedEndTime - hitObject.StartTime) * localVelocity;

EditorBeatmap?.Update(hitObject);
}

public Vector2 ToRelativePosition(Vector2 screenSpacePosition)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Edit;
using osu.Game.Rulesets.Catch.Objects;
using osuTK;
using osuTK.Input;

Expand All @@ -19,22 +18,27 @@ public partial class SelectionEditablePath : EditablePath, IHasContextMenu
{
public MenuItem[] ContextMenuItems => getContextMenuItems().ToArray();

private readonly JuiceStream juiceStream;

// To handle when the editor is scrolled while dragging.
private Vector2 dragStartPosition;

[Resolved]
private IEditorChangeHandler? changeHandler { get; set; }

public SelectionEditablePath(Func<float, double> positionToTime)
public SelectionEditablePath(JuiceStream juiceStream, Func<float, double> positionToTime)
: base(positionToTime)
{
this.juiceStream = juiceStream;
}

public void AddVertex(Vector2 relativePosition)
{
EditorBeatmap?.BeginChange();

double time = Math.Max(0, PositionToTime(relativePosition.Y));
int index = AddVertex(time, relativePosition.X);
UpdateHitObjectFromPath(juiceStream);
selectOnly(index);

EditorBeatmap?.EndChange();
}

public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => InternalChildren.Any(d => d.ReceivePositionalInputAt(screenSpacePos));
Expand All @@ -45,9 +49,13 @@ protected override bool OnMouseDown(MouseDownEvent e)
if (index == -1 || VertexStates[index].IsFixed)
return false;

if (e.Button == MouseButton.Left && e.ShiftPressed)
if (e.Button == MouseButton.Right && e.ShiftPressed)
{
EditorBeatmap?.BeginChange();
RemoveVertex(index);
UpdateHitObjectFromPath(juiceStream);
EditorBeatmap?.EndChange();

return true;
}

Expand All @@ -74,7 +82,7 @@ protected override bool OnDragStart(DragStartEvent e)
for (int i = 0; i < VertexCount; i++)
VertexStates[i].VertexBeforeChange = Vertices[i];

changeHandler?.BeginChange();
EditorBeatmap?.BeginChange();
return true;
}

Expand All @@ -88,7 +96,7 @@ protected override void OnDrag(DragEvent e)

protected override void OnDragEnd(DragEndEvent e)
{
changeHandler?.EndChange();
EditorBeatmap?.EndChange();
}

private int getMouseTargetVertex(Vector2 screenSpacePosition)
Expand Down Expand Up @@ -118,11 +126,17 @@ private void selectOnly(int index)

private void deleteSelectedVertices()
{
EditorBeatmap?.BeginChange();

for (int i = VertexCount - 1; i >= 0; i--)
{
if (VertexStates[i].IsSelected)
RemoveVertex(i);
}

UpdateHitObjectFromPath(juiceStream);

EditorBeatmap?.EndChange();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osuTK;

namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components
{
public partial class VertexPiece : Circle
{
private VertexState state = new VertexState();

[Resolved]
private OsuColour osuColour { get; set; } = null!;

Expand All @@ -24,7 +27,32 @@ public VertexPiece()

public void UpdateFrom(VertexState state)
{
Colour = state.IsSelected ? osuColour.Yellow.Lighten(1) : osuColour.Yellow;
this.state = state;
updateMarkerDisplay();
}

protected override bool OnHover(HoverEvent e)
{
updateMarkerDisplay();
return false;
}

protected override void OnHoverLost(HoverLostEvent e)
{
updateMarkerDisplay();
}

/// <summary>
/// Updates the state of the circular control point marker.
/// </summary>
private void updateMarkerDisplay()
{
var colour = osuColour.Yellow;

if (IsHovered || state.IsSelected)
colour = colour.Lighten(1);

Colour = colour;
Alpha = state.IsFixed ? 0.5f : 1;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public JuiceStreamSelectionBlueprint(JuiceStream hitObject)
{
scrollingPath = new ScrollingPath(),
nestedOutlineContainer = new NestedOutlineContainer(),
editablePath = new SelectionEditablePath(positionToTime)
editablePath = new SelectionEditablePath(hitObject, positionToTime)
};
}

Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace osu.Game.Rulesets.Catch.Objects
{
public abstract class CatchHitObject : HitObject, IHasPosition, IHasComboInformation
public abstract class CatchHitObject : HitObject, IHasPosition, IHasComboInformation, IHasTimePreempt
{
public const float OBJECT_RADIUS = 64;

Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModHoldOff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ManiaModHoldOff : Mod, IApplicableAfterBeatmapConversion

public override ModType Type => ModType.Conversion;

public override Type[] IncompatibleMods => new[] { typeof(ManiaModInvert) };
public override Type[] IncompatibleMods => new[] { typeof(ManiaModInvert), typeof(ManiaModNoRelease) };

public void ApplyToBeatmap(IBeatmap beatmap)
{
Expand Down
3 changes: 3 additions & 0 deletions osu.Game.Rulesets.Mania/Mods/ManiaModNoRelease.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Linq;
using System.Threading;
using osu.Framework.Localisation;
Expand All @@ -27,6 +28,8 @@ public partial class ManiaModNoRelease : Mod, IApplicableAfterBeatmapConversion,

public override ModType Type => ModType.DifficultyReduction;

public override Type[] IncompatibleMods => new[] { typeof(ManiaModHoldOff) };

public void ApplyToBeatmap(IBeatmap beatmap)
{
var maniaBeatmap = (ManiaBeatmap)beatmap;
Expand Down
11 changes: 7 additions & 4 deletions osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,14 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
ApplyMaxResult();
else
MissForcefully();
}

// Make sure that the hold note is fully judged by giving the body a judgement.
if (Tail.AllJudged && !Body.AllJudged)
Body.TriggerResult(Tail.IsHit);
// Make sure that the hold note is fully judged by giving the body a judgement.
if (!Body.AllJudged)
Body.TriggerResult(Tail.IsHit);

// Important that this is always called when a result is applied.
endHold();
}
}

public override void MissForcefully()
Expand Down
Loading

0 comments on commit 117d6bf

Please sign in to comment.