Skip to content

Commit

Permalink
Upgrade the lazer to the latest.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Jun 25, 2024
1 parent ec366b7 commit 25686b0
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ public MockEditorChangeHandler(EditorBeatmap editorBeatmap)
editorBeatmap.SaveStateTriggered += SaveState;
}

public void RestoreState(int direction)
{
}

protected override void UpdateState()
{
OnStateChange?.Invoke();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected override void OnSelectionChanged()
base.OnSelectionChanged();

// only select one ruby tag can let user drag to change start and end index.
SelectionBox.CanScaleX = SelectedItems.Count == 1;
ScaleHandler.CanScaleX.Value = SelectedItems.Count == 1;

// should clear delta size before change start/end index.
deltaScaleSize = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,8 @@ private void assignBottomEditor(BottomEditorType? bottomEditorType)
const double new_animation_time = 200;

bool hasOldButtonEditor = bottomEditorContainer.Children.Any();
var newButtonEditor = createBottomEditor(bottomEditorType).With(x =>
var newButtonEditor = createBottomEditor(bottomEditorType)?.With(x =>
{
if (x == null)
return;

x.RelativePositionAxes = Axes.Y;
x.Y = -1;
x.Alpha = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ private void focus()
// Make sure that view is visible in the scroll container.
// Give the top spacing larger space to let use able to see the previous item or the description text.
var parentScrollContainer = this.FindClosestParent<OsuScrollContainer>();
if (parentScrollContainer == null)
throw new InvalidOperationException("Should have a parent scroll container.");

parentScrollContainer.ScrollIntoViewWithSpacing(this, new MarginPadding { Top = 150, Bottom = 50 });

if (IsFocused(focusedDrawable))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ private void load(ISkinSource skin, IScrollingInfo scrollingInfo)
if (tmp is IFramedAnimation { FrameCount: > 0 } tmpAnimation)
frameLength = Math.Max(1000 / 60.0, 170.0 / tmpAnimation.FrameCount);

explosion = skin.GetAnimation(imageName, true, false, frameLength: frameLength).With(d =>
explosion = skin.GetAnimation(imageName, true, false, frameLength: frameLength)?.With(d =>
{
if (d == null)
return;

d.Origin = Anchor.Centre;
d.Blending = BlendingParameters.Additive;
d.Scale = new Vector2(explosionScale);
Expand Down
20 changes: 4 additions & 16 deletions osu.Game.Rulesets.Karaoke/Skinning/Legacy/LegacyNotePiece.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,14 @@ private LayerContainer createLayer(string name, ISkin skin, LegacyKaraokeSkinNot
Name = name,
Children = new[]
{
getSpriteFromLookup(skin, LegacyKaraokeSkinConfigurationLookups.NoteHeadImage, layer).With(d =>
getSpriteFromLookup(skin, LegacyKaraokeSkinConfigurationLookups.NoteHeadImage, layer)?.With(d =>
{
if (d == null)
return;

d.Name = "Head";
d.Anchor = Anchor.CentreLeft;
d.Origin = Anchor.Centre;
}),
getSpriteFromLookup(skin, LegacyKaraokeSkinConfigurationLookups.NoteBodyImage, layer).With(d =>
getSpriteFromLookup(skin, LegacyKaraokeSkinConfigurationLookups.NoteBodyImage, layer)?.With(d =>
{
if (d == null)
return;

d.Name = "Body";
d.Anchor = Anchor.Centre;
d.Origin = Anchor.Centre;
Expand All @@ -164,11 +158,8 @@ private LayerContainer createLayer(string name, ISkin skin, LegacyKaraokeSkinNot

d.Height = d.Texture?.DisplayHeight ?? 0;
}),
getSpriteFromLookup(skin, LegacyKaraokeSkinConfigurationLookups.NoteTailImage, layer).With(d =>
getSpriteFromLookup(skin, LegacyKaraokeSkinConfigurationLookups.NoteTailImage, layer)?.With(d =>
{
if (d == null)
return;

d.Name = "Tail";
d.Anchor = Anchor.CentreRight;
d.Origin = Anchor.Centre;
Expand All @@ -195,13 +186,10 @@ private LayerContainer createLayer(string name, ISkin skin, LegacyKaraokeSkinNot
return null;
}

Sprite? getSpriteByName(string spriteName) => (Sprite?)skin.GetAnimation(spriteName, true, true).With(d =>
Sprite? getSpriteByName(string spriteName) => (Sprite?)skin.GetAnimation(spriteName, true, true)?.With(d =>
{
switch (d)
{
case null:
return;

case TextureAnimation animation:
animation.IsPlaying = false;
break;
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Karaoke/UI/DrawableNoteJudgement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public override void PlayAnimation()
.ScaleTo(0.75f, 250)
.FadeOut(200);

// osu!mania uses a custom fade length, so the base call is intentionally omitted.
// karaoke uses a custom fade length, so the base call is intentionally omitted.
break;
}
}
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 @@ -17,7 +17,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ppy.osu.Game" Version="2024.523.0" />
<PackageReference Include="ppy.osu.Game" Version="2024.625.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.0.3" />
Expand Down

0 comments on commit 25686b0

Please sign in to comment.