mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Merge pull request #12683 from frenzibyte/legacy-beatmap-combo-offset
Apply combo offsets "colour hax" only on beatmap skins
This commit is contained in:
@ -124,7 +124,9 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
public readonly Bindable<double> StartTimeBindable = new Bindable<double>();
|
||||
private readonly BindableList<HitSampleInfo> samplesBindable = new BindableList<HitSampleInfo>();
|
||||
private readonly Bindable<bool> userPositionalHitSounds = new Bindable<bool>();
|
||||
|
||||
private readonly Bindable<int> comboIndexBindable = new Bindable<int>();
|
||||
private readonly Bindable<int> comboIndexWithOffsetsBindable = new Bindable<int>();
|
||||
|
||||
protected override bool RequiresChildrenUpdate => true;
|
||||
|
||||
@ -185,7 +187,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
comboIndexBindable.BindValueChanged(_ => UpdateComboColour(), true);
|
||||
comboIndexBindable.BindValueChanged(_ => UpdateComboColour());
|
||||
comboIndexWithOffsetsBindable.BindValueChanged(_ => UpdateComboColour(), true);
|
||||
|
||||
updateState(ArmedState.Idle, true);
|
||||
}
|
||||
@ -250,7 +253,10 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
StartTimeBindable.BindValueChanged(onStartTimeChanged);
|
||||
|
||||
if (HitObject is IHasComboInformation combo)
|
||||
{
|
||||
comboIndexBindable.BindTo(combo.ComboIndexBindable);
|
||||
comboIndexWithOffsetsBindable.BindTo(combo.ComboIndexWithOffsetsBindable);
|
||||
}
|
||||
|
||||
samplesBindable.BindTo(HitObject.SamplesBindable);
|
||||
samplesBindable.BindCollectionChanged(onSamplesChanged, true);
|
||||
@ -275,8 +281,13 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
protected sealed override void OnFree(HitObjectLifetimeEntry entry)
|
||||
{
|
||||
StartTimeBindable.UnbindFrom(HitObject.StartTimeBindable);
|
||||
|
||||
if (HitObject is IHasComboInformation combo)
|
||||
{
|
||||
comboIndexBindable.UnbindFrom(combo.ComboIndexBindable);
|
||||
comboIndexWithOffsetsBindable.UnbindFrom(combo.ComboIndexWithOffsetsBindable);
|
||||
}
|
||||
|
||||
samplesBindable.UnbindFrom(HitObject.SamplesBindable);
|
||||
|
||||
// Changes in start time trigger state updates. When a new hitobject is applied, OnApply() automatically performs a state update anyway.
|
||||
|
@ -118,6 +118,7 @@ namespace osu.Game.Rulesets.Objects
|
||||
foreach (var n in NestedHitObjects.OfType<IHasComboInformation>())
|
||||
{
|
||||
n.ComboIndexBindable.BindTo(hasCombo.ComboIndexBindable);
|
||||
n.ComboIndexWithOffsetsBindable.BindTo(hasCombo.ComboIndexWithOffsetsBindable);
|
||||
n.IndexInCurrentComboBindable.BindTo(hasCombo.IndexInCurrentComboBindable);
|
||||
}
|
||||
}
|
||||
|
@ -15,17 +15,25 @@ namespace osu.Game.Rulesets.Objects.Types
|
||||
Bindable<int> IndexInCurrentComboBindable { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The offset of this hitobject in the current combo.
|
||||
/// The index of this hitobject in the current combo.
|
||||
/// </summary>
|
||||
int IndexInCurrentCombo { get; set; }
|
||||
|
||||
Bindable<int> ComboIndexBindable { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The offset of this combo in relation to the beatmap.
|
||||
/// The index of this combo in relation to the beatmap.
|
||||
/// </summary>
|
||||
int ComboIndex { get; set; }
|
||||
|
||||
Bindable<int> ComboIndexWithOffsetsBindable { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The index of this combo in relation to the beatmap, with all aggregate <see cref="IHasCombo.ComboOffset"/>s applied.
|
||||
/// This should be used instead of <see cref="ComboIndex"/> only when retrieving combo colours from the beatmap's skin.
|
||||
/// </summary>
|
||||
int ComboIndexWithOffsets { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether the HitObject starts a new combo.
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user