Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ProjectReference Include="..\osu.Game.Rulesets.Karaoke.Tests\osu.Game.Rulesets.Karaoke.Tests.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="TngTech.ArchUnitNET" Version="0.11.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>
<ItemGroup Label="Package References">
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,13 @@ public class KaraokeDifficultyAttributes : DifficultyAttributes
foreach (var v in base.ToDatabaseAttributes())
yield return v;

// Todo: osu!mania doesn't output MaxCombo attribute for some reason.
yield return (ATTRIB_ID_DIFFICULTY, StarRating);
yield return (ATTRIB_ID_GREAT_HIT_WINDOW, GreatHitWindow);
yield return (ATTRIB_ID_SCORE_MULTIPLIER, ScoreMultiplier);
}

public override void FromDatabaseAttributes(IReadOnlyDictionary<int, double> values, IBeatmapOnlineInfo onlineInfo)
{
base.FromDatabaseAttributes(values, onlineInfo);

StarRating = values[ATTRIB_ID_DIFFICULTY];
GreatHitWindow = values[ATTRIB_ID_GREAT_HIT_WINDOW];
ScoreMultiplier = values[ATTRIB_ID_SCORE_MULTIPLIER];
}
}
6 changes: 6 additions & 0 deletions osu.Game.Rulesets.Karaoke/Edit/KaraokeBlueprintContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Collections.Generic;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Karaoke.Edit.Blueprints.Lyrics;
using osu.Game.Rulesets.Karaoke.Edit.Blueprints.Notes;
using osu.Game.Rulesets.Karaoke.Objects;
using osu.Game.Rulesets.Objects;
using osu.Game.Screens.Edit.Compose.Components;
using osuTK;

namespace osu.Game.Rulesets.Karaoke.Edit;

Expand All @@ -27,4 +30,7 @@ public override HitObjectSelectionBlueprint CreateHitObjectBlueprintFor(HitObjec
};

protected override SelectionHandler<HitObject> CreateSelectionHandler() => new KaraokeSelectionHandler();

protected override bool TryMoveBlueprints(DragEvent e, IList<(SelectionBlueprint<HitObject> blueprint, Vector2[] originalSnapPositions)> blueprints)
=> false;
}
10 changes: 0 additions & 10 deletions osu.Game.Rulesets.Karaoke/Edit/KaraokeHitObjectComposer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,6 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl
return null;
}

public override SnapResult FindSnappedPositionAndTime(Vector2 screenSpacePosition, SnapType snapType = SnapType.All)
{
var result = base.FindSnappedPositionAndTime(screenSpacePosition, snapType);

// should not affect x position and time if dragging object in note playfield.
return result.Playfield is EditorNotePlayfield
? new SnapResult(screenSpacePosition, null, result.Playfield)
: result;
}

protected override DrawableRuleset<KaraokeHitObject> CreateDrawableRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods)
{
drawableRuleset = new DrawableKaraokeEditorRuleset(ruleset, beatmap, mods);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Input.Events;
using osu.Framework.Logging;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Lyrics;
Expand Down Expand Up @@ -38,6 +39,9 @@ protected override SelectionBlueprint<RubyTag> CreateBlueprintFor(RubyTag item)
protected override IEnumerable<SelectionBlueprint<RubyTag>> SortForMovement(IReadOnlyList<SelectionBlueprint<RubyTag>> blueprints)
=> blueprints.OrderBy(b => b.Item.StartIndex);

protected override bool TryMoveBlueprints(DragEvent e, IList<(SelectionBlueprint<RubyTag> blueprint, Vector2[] originalSnapPositions)> blueprints)
=> false;

protected partial class RubyTagSelectionHandler : LyricPropertySelectionHandler<IEditRubyModeState>
{
[Resolved]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Lyrics;
using osu.Game.Rulesets.Karaoke.Objects;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States.Modes;
using osu.Game.Screens.Edit.Compose.Components;
using osuTK;

namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Content.Components.Lyrics.Blueprints;

Expand All @@ -28,6 +30,9 @@ protected override SelectionHandler<TimeTag> CreateSelectionHandler()
protected override SelectionBlueprint<TimeTag> CreateBlueprintFor(TimeTag item)
=> new TimeTagSelectionBlueprint(item);

protected override bool TryMoveBlueprints(DragEvent e, IList<(SelectionBlueprint<TimeTag> blueprint, Vector2[] originalSnapPositions)> blueprints)
=> false;

protected partial class TimeTagSelectionHandler : LyricPropertySelectionHandler<IEditTimeTagModeState>
{
[Resolved]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using osu.Game.Screens.Edit;
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
using osu.Game.Screens.Edit.Compose.Components;
using osuTK;

namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Content.Compose.BottomEditor.AdjustTimeTags;

Expand All @@ -44,15 +45,14 @@ private void load(BindableList<TimeTag> timeTags)
protected override IEnumerable<SelectionBlueprint<TimeTag>> SortForMovement(IReadOnlyList<SelectionBlueprint<TimeTag>> blueprints)
=> blueprints.OrderBy(b => b.Item.Index);

protected override bool ApplySnapResult(SelectionBlueprint<TimeTag>[] blueprints, SnapResult result)
protected override bool TryMoveBlueprints(DragEvent e, IList<(SelectionBlueprint<TimeTag> blueprint, Vector2[] originalSnapPositions)> blueprints)
{
if (!base.ApplySnapResult(blueprints, result))
return false;
var result = timeline.FindSnappedPositionAndTime(e.ScreenSpaceMousePosition);

if (result.Time == null)
return false;

var timeTags = blueprints.OfType<AdjustTimeTagSelectionBlueprint>().Select(x => x.Item).ToArray();
var timeTags = blueprints.Select(x => x.blueprint).OfType<AdjustTimeTagSelectionBlueprint>().Select(x => x.Item).ToArray();
var firstTimeTag = timeTags.FirstOrDefault();
if (firstTimeTag == null)
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Content.Compose.BottomEditor.AdjustTimeTags;

[Cached]
public partial class AdjustTimeTagScrollContainer : TimeTagScrollContainer, IPositionSnapProvider
public partial class AdjustTimeTagScrollContainer : TimeTagScrollContainer
{
public const float TIMELINE_HEIGHT = 38;

Expand Down Expand Up @@ -85,7 +85,7 @@ protected override void UpdateAfterChildren()
currentTimeMarker?.MoveToX(position);
}

public SnapResult FindSnappedPositionAndTime(Vector2 screenSpacePosition, SnapType snapType = SnapType.All)
public SnapResult FindSnappedPositionAndTime(Vector2 screenSpacePosition)
{
double time = TimeAtPosition(Content.ToLocalSpace(screenSpacePosition).X);
return new SnapResult(screenSpacePosition, time);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Karaoke.Objects;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States.Modes;
using osu.Game.Screens.Edit.Compose.Components;
using osuTK;

namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Content.Compose.BottomEditor.Notes;

Expand All @@ -18,6 +20,12 @@ protected override SelectionBlueprint<Note> CreateBlueprintFor(Note hitObject)

protected override SelectionHandler<Note> CreateSelectionHandler() => new NoteEditorSelectionHandler();

protected override bool TryMoveBlueprints(DragEvent e, IList<(SelectionBlueprint<Note> blueprint, Vector2[] originalSnapPositions)> blueprints)
{
// todo: implement able to drag to change the tone.
return false;
}

[BackgroundDependencyLoader]
private void load(BindableList<Note> notes)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Components.Timeline;

[Cached]
public partial class EditableTimeline : BindableScrollContainer, IPositionSnapProvider
public partial class EditableTimeline : BindableScrollContainer
{
[Resolved]
private EditorClock editorClock { get; set; } = null!;
Expand Down Expand Up @@ -63,7 +63,7 @@ public float PositionAtTime(double time)
return (float)(time / editorClock.TrackLength * Content.DrawWidth);
}

public SnapResult FindSnappedPositionAndTime(Vector2 screenSpacePosition, SnapType snapType = SnapType.All)
public SnapResult FindSnappedPositionAndTime(Vector2 screenSpacePosition)
{
double time = TimeAtPosition(Content.ToLocalSpace(screenSpacePosition).X);
return new SnapResult(screenSpacePosition, time);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
using osu.Game.Rulesets.Edit;
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
using osu.Game.Screens.Edit.Compose.Components;
using osuTK;

namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Components.Timeline;

public partial class EditableTimelineBlueprintContainer<TItem> : BlueprintContainer<TItem> where TItem : class
{
[Resolved]
private EditableTimeline timeline { get; set; } = null!;

protected readonly IBindableList<TItem> Items = new BindableList<TItem>();

public EditableTimelineBlueprintContainer()
Expand Down Expand Up @@ -46,15 +50,14 @@ protected override void SelectAll()
SelectedItems.AddRange(Items);
}

protected sealed override bool ApplySnapResult(SelectionBlueprint<TItem>[] blueprints, SnapResult result)
protected override bool TryMoveBlueprints(DragEvent e, IList<(SelectionBlueprint<TItem> blueprint, Vector2[] originalSnapPositions)> blueprints)
{
if (!base.ApplySnapResult(blueprints, result))
return false;
var result = timeline.FindSnappedPositionAndTime(e.ScreenSpaceMousePosition);

if (result.Time == null)
return false;

var items = blueprints.Select(x => x.Item).ToArray();
var items = blueprints.Select(x => x.blueprint.Item).ToArray();
double time = result.Time.Value;
return ApplyOffsetResult(items, time);
}
Expand Down
8 changes: 4 additions & 4 deletions osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
<ItemGroup>
<PackageReference Include="osu.Game.Rulesets.Karaoke.Resources" Version="2022.611.0" />
<PackageReference Include="LanguageDetection.karaoke-dev" Version="1.3.3-alpha" />
<PackageReference Include="LrcParser" Version="2024.728.2" />
<PackageReference Include="LrcParser" Version="2025.228.1" />
<PackageReference Include="Octokit" Version="14.0.0" />
<PackageReference Include="osu.Framework.KaraokeFont" Version="2025.120.0" />
<PackageReference Include="osu.Framework.Microphone" Version="2024.219.0" />
<PackageReference Include="ppy.LocalisationAnalyser" Version="2024.802.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ppy.osu.Game" Version="2025.122.0" />
<PackageReference Include="ppy.osu.Game" Version="2025.227.0" />
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00016" />
<PackageReference Include="Lucene.Net.Analysis.Kuromoji" Version="4.8.0-beta00016" />
<PackageReference Include="SixLabors.Fonts" Version="2.1.0" />
<PackageReference Include="SixLabors.Fonts" Version="2.1.2" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.5" />
<!--install because it might cause "Could not load file or assembly" error, might be removed eventually-->
<PackageReference Include="System.Text.Encodings.Web" Version="9.0.1" />
<PackageReference Include="System.Text.Encodings.Web" Version="9.0.2" />
<PackageReference Include="WanaKanaSharp" Version="0.2.0" />
<PackageReference Include="Zipangu" Version="1.1.8" />
</ItemGroup>
Expand Down
Loading