1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:03:08 +08:00

Fix bananas not playing sounds

This commit is contained in:
smoogipoo 2020-12-02 15:22:45 +09:00
parent 297283491a
commit 946613e803

View File

@ -1,6 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable enable
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Utils; using osu.Framework.Utils;
@ -8,6 +10,7 @@ using osu.Game.Audio;
using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Catch.Judgements;
using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Objects.Types;
using osu.Game.Utils;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Rulesets.Catch.Objects namespace osu.Game.Rulesets.Catch.Objects
@ -53,19 +56,22 @@ namespace osu.Game.Rulesets.Catch.Objects
private class BananaHitSampleInfo : HitSampleInfo, IEquatable<BananaHitSampleInfo> private class BananaHitSampleInfo : HitSampleInfo, IEquatable<BananaHitSampleInfo>
{ {
private static readonly string[] lookup_names = { "metronomelow", "catch-banana" }; private static readonly string[] lookup_names = { "Gameplay/metronomelow", "Gameplay/catch-banana" };
public override IEnumerable<string> LookupNames => lookup_names; public override IEnumerable<string> LookupNames => lookup_names;
public BananaHitSampleInfo() public BananaHitSampleInfo(int volume = 0)
: base(string.Empty) : base(string.Empty, volume: volume)
{ {
} }
public bool Equals(BananaHitSampleInfo other) public sealed override HitSampleInfo With(Optional<string> newName = default, Optional<string?> newBank = default, Optional<string?> newSuffix = default, Optional<int> newVolume = default)
=> new BananaHitSampleInfo(newVolume.GetOr(Volume));
public bool Equals(BananaHitSampleInfo? other)
=> other != null; => other != null;
public override bool Equals(object obj) public override bool Equals(object? obj)
=> obj is BananaHitSampleInfo other && Equals(other); => obj is BananaHitSampleInfo other && Equals(other);
public override int GetHashCode() => lookup_names.GetHashCode(); public override int GetHashCode() => lookup_names.GetHashCode();