Skip to content

Commit

Permalink
Merge pull request #589 from andy840119/update-nuget
Browse files Browse the repository at this point in the history
Update NuGet
  • Loading branch information
andy840119 authored May 2, 2021
2 parents 9bc6d40 + a415874 commit a1fa8d2
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ItemGroup Label="Package References">
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="NUnit" Version="3.13.1" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Karaoke.Edit.Components.Timeline
/// <summary>
/// This is the copy version of official <see cref="TimelineBlueprintContainer"/> because it's mark as internal
/// </summary>
public class TimelineBlueprintContainer : BlueprintContainer
public class TimelineBlueprintContainer : EditorBlueprintContainer
{
[Resolved(CanBeNull = true)]
private Game.Screens.Edit.Compose.Components.Timeline.Timeline timeline { get; set; }
Expand All @@ -35,7 +35,7 @@ public class TimelineBlueprintContainer : BlueprintContainer

private Bindable<HitObject> placement;

private SelectionBlueprint placementBlueprint;
private SelectionBlueprint<HitObject> placementBlueprint;

public TimelineBlueprintContainer(HitObjectComposer composer)
: base(composer)
Expand Down Expand Up @@ -83,7 +83,7 @@ private void placementChanged(ValueChangedEvent<HitObject> obj)
}
}

protected override Container<SelectionBlueprint> CreateSelectionBlueprintContainer() => new TimelineSelectionBlueprintContainer { RelativeSizeAxes = Axes.Both };
protected override Container<SelectionBlueprint<HitObject>> CreateSelectionBlueprintContainer() => new TimelineSelectionBlueprintContainer { RelativeSizeAxes = Axes.Both };

protected override void OnDrag(DragEvent e)
{
Expand All @@ -107,9 +107,9 @@ protected override void Update()
base.Update();
}

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

protected override SelectionBlueprint CreateBlueprintFor(HitObject hitObject) => new TimelineHitObjectBlueprint(hitObject)
protected override SelectionBlueprint<HitObject> CreateBlueprintFor(HitObject hitObject) => new TimelineHitObjectBlueprint(hitObject)
{
OnDragHandled = handleScrollViaDrag
};
Expand All @@ -136,10 +136,10 @@ private void handleScrollViaDrag(DragEvent e)
}
}

internal class TimelineSelectionHandler : SelectionHandler
internal class TimelineSelectionHandler : EditorSelectionHandler
{
// for now we always allow movement. snapping is provided by the timeline "distance" snap implementation
public override bool HandleMovement(MoveSelectionEvent moveEvent) => true;
public override bool HandleMovement(MoveSelectionEvent<HitObject> moveEvent) => true;
}

private class TimelineDragBox : DragBox
Expand Down Expand Up @@ -178,13 +178,13 @@ public override bool HandleDrag(MouseButtonEvent e)
}
}

protected class TimelineSelectionBlueprintContainer : Container<SelectionBlueprint>
protected class TimelineSelectionBlueprintContainer : Container<SelectionBlueprint<HitObject>>
{
protected override Container<SelectionBlueprint> Content { get; }
protected override Container<SelectionBlueprint<HitObject>> Content { get; }

public TimelineSelectionBlueprintContainer()
{
AddInternal(new TimelinePart<SelectionBlueprint>(Content = new Container<SelectionBlueprint> { RelativeSizeAxes = Axes.Both }) { RelativeSizeAxes = Axes.Both });
AddInternal(new TimelinePart<SelectionBlueprint<HitObject>>(Content = new HitObjectOrderedSelectionContainer { RelativeSizeAxes = Axes.Both }) { RelativeSizeAxes = Axes.Both });
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Karaoke/Edit/KaraokeBlueprintContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using osu.Game.Rulesets.Karaoke.Edit.Blueprints.Lyrics;
using osu.Game.Rulesets.Karaoke.Edit.Blueprints.Notes;
using osu.Game.Rulesets.Karaoke.Objects.Drawables;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Screens.Edit.Compose.Components;
using osuTK;
Expand Down Expand Up @@ -58,7 +59,7 @@ public override OverlaySelectionBlueprint CreateBlueprintFor(DrawableHitObject h
}
}

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

[BackgroundDependencyLoader]
private void load(KaraokeRulesetEditConfigManager editConfigManager)
Expand Down
14 changes: 8 additions & 6 deletions osu.Game.Rulesets.Karaoke/Edit/KaraokeSelectionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
using osu.Game.Rulesets.Karaoke.UI.Components;
using osu.Game.Rulesets.Karaoke.UI.Position;
using osu.Game.Rulesets.Karaoke.UI.Scrolling;
using osu.Game.Rulesets.Objects;
using osu.Game.Screens.Edit.Compose.Components;
using osu.Game.Skinning;

namespace osu.Game.Rulesets.Karaoke.Edit
{
public class KaraokeSelectionHandler : SelectionHandler
public class KaraokeSelectionHandler : EditorSelectionHandler
{
[Resolved]
private IPositionCalculator calculator { get; set; }
Expand All @@ -41,7 +42,7 @@ public class KaraokeSelectionHandler : SelectionHandler

protected virtual ScrollingNotePlayfield NotePlayfield => ((KaraokeHitObjectComposer)composer).Playfield.NotePlayfield;

protected override IEnumerable<MenuItem> GetContextMenuItemsForSelection(IEnumerable<SelectionBlueprint> selection)
protected override IEnumerable<MenuItem> GetContextMenuItemsForSelection(IEnumerable<SelectionBlueprint<HitObject>> selection)
{
if (selection.All(x => x is LyricSelectionBlueprint))
{
Expand Down Expand Up @@ -80,7 +81,7 @@ private MenuItem createMultiNoteDisplayPropertyMenuItem(IEnumerable<Note> select
return new OsuMenuItem($"{displayText} {selectedObject.Count()} notes.", display ? MenuItemType.Destructive : MenuItemType.Standard,
() =>
{
var selectedNotes = SelectedBlueprints.Select(x => x.HitObject).OfType<Note>().ToList();
var selectedNotes = SelectedBlueprints.Select(x => x.Item).OfType<Note>().ToList();
noteManager.ChangeDisplay(selectedNotes, !display);
});
}
Expand Down Expand Up @@ -116,7 +117,7 @@ private MenuItem createSingerMenuItem(List<Lyric> lyrics)
return new SingerContextMenu(lyricManager, lyrics, "Singer");
}

public override bool HandleMovement(MoveSelectionEvent moveEvent)
public override bool HandleMovement(MoveSelectionEvent<HitObject> moveEvent)
{
// Only note can be moved.
if (!(moveEvent.Blueprint is NoteSelectionBlueprint noteSelectionBlueprint))
Expand All @@ -128,13 +129,14 @@ public override bool HandleMovement(MoveSelectionEvent moveEvent)
return true;
}

private void performColumnMovement(Tone lastTone, MoveSelectionEvent moveEvent)
private void performColumnMovement(Tone lastTone, MoveSelectionEvent<HitObject> moveEvent)
{
if (!(moveEvent.Blueprint is NoteSelectionBlueprint))
return;

// top position
var dragHeight = NotePlayfield.ToLocalSpace(moveEvent.ScreenSpacePosition).Y;
var screenSpacePosition = moveEvent.Blueprint.ScreenSpaceSelectionPoint + moveEvent.ScreenSpaceDelta;
var dragHeight = NotePlayfield.ToLocalSpace(screenSpacePosition).Y;
var lastHeight = convertToneToHeight(lastTone);
var moveHeight = dragHeight - lastHeight;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public override OverlaySelectionBlueprint CreateBlueprintFor(DrawableHitObject h
}
}

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

internal class EditNoteSelectionHandler : KaraokeSelectionHandler
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public LyricBlueprintContainer(HitObjectComposer composer, Singer singer)
this.singer = singer;
}

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

protected override SelectionBlueprint CreateBlueprintFor(HitObject hitObject)
protected override SelectionBlueprint<HitObject> CreateBlueprintFor(HitObject hitObject)
{
if (!(hitObject is Lyric))
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public LyricTimelineHitObjectBlueprint(HitObject hitObject, Singer singer)
[BackgroundDependencyLoader]
private void load(LyricManager lyricManager)
{
if (HitObject is Lyric lyric)
if (Item is Lyric lyric)
{
lyric.SingersBindable.BindValueChanged(e =>
{
Expand All @@ -79,7 +79,7 @@ private void load(LyricManager lyricManager)
}
}

public object TooltipContent => HitObject;
public object TooltipContent => Item;

public ITooltip GetCustomTooltip() => new LyricTooltip();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using osu.Game.Rulesets.Karaoke.Edit.Components.ContextMenu;
using osu.Game.Rulesets.Karaoke.Edit.Lyrics;
using osu.Game.Rulesets.Karaoke.Objects;
using osu.Game.Rulesets.Objects;
using osu.Game.Screens.Edit.Compose.Components;
using static osu.Game.Rulesets.Karaoke.Edit.Components.Timeline.TimelineBlueprintContainer;

Expand All @@ -19,11 +20,11 @@ internal class LyricTimelineSelectionHandler : TimelineSelectionHandler
[Resolved]
private LyricManager lyricManager { get; set; }

public override bool HandleMovement(MoveSelectionEvent moveEvent) => false;
public override bool HandleMovement(MoveSelectionEvent<HitObject> moveEvent) => false;

protected override IEnumerable<MenuItem> GetContextMenuItemsForSelection(IEnumerable<SelectionBlueprint> selection)
protected override IEnumerable<MenuItem> GetContextMenuItemsForSelection(IEnumerable<SelectionBlueprint<HitObject>> selection)
{
var lyrics = selection.Select(x => x.HitObject).OfType<Lyric>().ToList();
var lyrics = selection.Select(x => x.Item).OfType<Lyric>().ToList();
var contextMenu = new SingerContextMenu(lyricManager, lyrics, "");
return contextMenu.Items;
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReference Include="Octokit" Version="0.50.0" />
<PackageReference Include="osu.Framework.KaraokeFont" Version="1.7.0" />
<PackageReference Include="osu.Framework.Microphone" Version="1.2.0" />
<PackageReference Include="ppy.osu.Game" Version="2021.424.0" />
<PackageReference Include="ppy.osu.Game" Version="2021.502.0" />
<PackageReference Include="LyricMaker" Version="1.1.1" />
<PackageReference Include="NicoKaraParser" Version="1.1.0" />
<PackageReference Include="WanaKanaSharp" Version="0.1.1" />
Expand Down

0 comments on commit a1fa8d2

Please sign in to comment.