mirror of
https://github.com/ppy/osu.git
synced 2025-03-01 02:22:55 +08:00
Make hit sounds into consts.
This commit is contained in:
parent
c65ab5b6f1
commit
4cc309e5a7
@ -59,7 +59,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
|||||||
// Old osu! used hit sounding to determine various hit type information
|
// Old osu! used hit sounding to determine various hit type information
|
||||||
List<SampleInfo> samples = obj.Samples;
|
List<SampleInfo> samples = obj.Samples;
|
||||||
|
|
||||||
bool strong = samples.Any(s => s.Name == @"hitfinish");
|
bool strong = samples.Any(s => s.Name == SampleInfo.HIT_FINISH);
|
||||||
|
|
||||||
if (distanceData != null)
|
if (distanceData != null)
|
||||||
{
|
{
|
||||||
@ -133,7 +133,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool isRim = samples.Any(s => s.Name == @"hitclap" || s.Name == @"hitwhistle");
|
bool isRim = samples.Any(s => s.Name == SampleInfo.HIT_CLAP || s.Name == SampleInfo.HIT_WHISTLE);
|
||||||
|
|
||||||
if (isRim)
|
if (isRim)
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,7 @@ using osu.Game.Tests.Resources;
|
|||||||
using osu.Game.Modes.Osu;
|
using osu.Game.Modes.Osu;
|
||||||
using osu.Game.Modes.Objects.Legacy;
|
using osu.Game.Modes.Objects.Legacy;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Game.Audio;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Beatmaps.Formats
|
namespace osu.Game.Tests.Beatmaps.Formats
|
||||||
{
|
{
|
||||||
@ -136,12 +137,12 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.IsNotNull(slider);
|
Assert.IsNotNull(slider);
|
||||||
Assert.AreEqual(new Vector2(192, 168), slider.Position);
|
Assert.AreEqual(new Vector2(192, 168), slider.Position);
|
||||||
Assert.AreEqual(956, slider.StartTime);
|
Assert.AreEqual(956, slider.StartTime);
|
||||||
Assert.IsTrue(slider.Samples.Any(s => s.Name == @"hitnormal"));
|
Assert.IsTrue(slider.Samples.Any(s => s.Name == SampleInfo.HIT_NORMAL));
|
||||||
var hit = beatmap.HitObjects[1] as LegacyHit;
|
var hit = beatmap.HitObjects[1] as LegacyHit;
|
||||||
Assert.IsNotNull(hit);
|
Assert.IsNotNull(hit);
|
||||||
Assert.AreEqual(new Vector2(304, 56), hit.Position);
|
Assert.AreEqual(new Vector2(304, 56), hit.Position);
|
||||||
Assert.AreEqual(1285, hit.StartTime);
|
Assert.AreEqual(1285, hit.StartTime);
|
||||||
Assert.IsTrue(hit.Samples.Any(s => s.Name == @"hitclap"));
|
Assert.IsTrue(hit.Samples.Any(s => s.Name == SampleInfo.HIT_CLAP));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,11 @@ namespace osu.Game.Audio
|
|||||||
{
|
{
|
||||||
public class SampleInfo
|
public class SampleInfo
|
||||||
{
|
{
|
||||||
|
public const string HIT_WHISTLE = @"hitwhistle";
|
||||||
|
public const string HIT_FINISH = @"hitfinish";
|
||||||
|
public const string HIT_NORMAL = @"hitnormal";
|
||||||
|
public const string HIT_CLAP = @"hitclap";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The bank to load the sample from.
|
/// The bank to load the sample from.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -129,7 +129,7 @@ namespace osu.Game.Modes.Objects
|
|||||||
result.Samples.Add(new SampleInfo
|
result.Samples.Add(new SampleInfo
|
||||||
{
|
{
|
||||||
Bank = normalSampleBank,
|
Bank = normalSampleBank,
|
||||||
Name = "hitnormal",
|
Name = SampleInfo.HIT_NORMAL,
|
||||||
Volume = sampleVolume
|
Volume = sampleVolume
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ namespace osu.Game.Modes.Objects
|
|||||||
result.Samples.Add(new SampleInfo
|
result.Samples.Add(new SampleInfo
|
||||||
{
|
{
|
||||||
Bank = addSampleBank,
|
Bank = addSampleBank,
|
||||||
Name = "hitfinish",
|
Name = SampleInfo.HIT_FINISH,
|
||||||
Volume = sampleVolume
|
Volume = sampleVolume
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ namespace osu.Game.Modes.Objects
|
|||||||
result.Samples.Add(new SampleInfo
|
result.Samples.Add(new SampleInfo
|
||||||
{
|
{
|
||||||
Bank = addSampleBank,
|
Bank = addSampleBank,
|
||||||
Name = "hitwhistle",
|
Name = SampleInfo.HIT_WHISTLE,
|
||||||
Volume = sampleVolume
|
Volume = sampleVolume
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -158,7 +158,7 @@ namespace osu.Game.Modes.Objects
|
|||||||
result.Samples.Add(new SampleInfo
|
result.Samples.Add(new SampleInfo
|
||||||
{
|
{
|
||||||
Bank = addSampleBank,
|
Bank = addSampleBank,
|
||||||
Name = "hitclap",
|
Name = SampleInfo.HIT_CLAP,
|
||||||
Volume = sampleVolume
|
Volume = sampleVolume
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user