mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Determine SampleInfo defaults in DrawableHitObject
This commit is contained in:
@ -15,40 +15,19 @@ namespace osu.Game.Audio
|
||||
public const string HIT_NORMAL = @"hitnormal";
|
||||
public const string HIT_CLAP = @"hitclap";
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="SoundControlPoint"/> that is used for <see cref="Bank"/> and <see cref="Volume"/>
|
||||
/// if the values have not already been provided by the hitobject.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public SoundControlPoint ControlPoint;
|
||||
|
||||
private string bank;
|
||||
/// <summary>
|
||||
/// The bank to load the sample from.
|
||||
/// </summary>
|
||||
public string Bank
|
||||
{
|
||||
get { return string.IsNullOrEmpty(bank) ? (ControlPoint?.SampleBank ?? "normal") : bank; }
|
||||
set { bank = value; }
|
||||
}
|
||||
|
||||
public bool ShouldSerializeBank() => Bank != ControlPoint.SampleBank;
|
||||
public string Bank;
|
||||
|
||||
/// <summary>
|
||||
/// The name of the sample to load.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
public string Name;
|
||||
|
||||
private int volume;
|
||||
/// <summary>
|
||||
/// The sample volume.
|
||||
/// </summary>
|
||||
public int Volume
|
||||
{
|
||||
get { return volume == 0 ? (ControlPoint?.SampleVolume ?? 0) : volume; }
|
||||
set { volume = value; }
|
||||
}
|
||||
|
||||
public bool ShouldSerializeVolume() => Volume != ControlPoint.SampleVolume;
|
||||
public int Volume;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user