1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 19:53:23 +08:00

Merge branch 'master' into leaderboard-nrt

This commit is contained in:
Dan Balasescu 2022-09-26 17:12:19 +09:00 committed by GitHub
commit c969afcb71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 75 additions and 187 deletions

View File

@ -4,6 +4,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs: jobs:
inspect-code: inspect-code:
name: Code Quality name: Code Quality

View File

@ -8,8 +8,12 @@ on:
workflows: ["Continuous Integration"] workflows: ["Continuous Integration"]
types: types:
- completed - completed
permissions: {}
jobs: jobs:
annotate: annotate:
permissions:
checks: write # to create checks (dorny/test-reporter)
name: Annotate CI run with test results name: Annotate CI run with test results
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'cancelled' }} if: ${{ github.event.workflow_run.conclusion != 'cancelled' }}

View File

@ -5,6 +5,9 @@ on:
tags: tags:
- '*' - '*'
permissions:
contents: read # to fetch code (actions/checkout)
jobs: jobs:
sentry_release: sentry_release:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -17,21 +17,15 @@ namespace osu.Game.Rulesets.Catch.Mods
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1; public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
[SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")] [SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
public override BindableFloat SizeMultiplier { get; } = new BindableFloat public override BindableFloat SizeMultiplier { get; } = new BindableFloat(1)
{ {
MinValue = 0.5f, MinValue = 0.5f,
MaxValue = 1.5f, MaxValue = 1.5f,
Default = 1f,
Value = 1f,
Precision = 0.1f Precision = 0.1f
}; };
[SettingSource("Change size based on combo", "Decrease the flashlight size as combo increases.")] [SettingSource("Change size based on combo", "Decrease the flashlight size as combo increases.")]
public override BindableBool ComboBasedSize { get; } = new BindableBool public override BindableBool ComboBasedSize { get; } = new BindableBool(true);
{
Default = true,
Value = true
};
public override float DefaultFlashlightSize => 350; public override float DefaultFlashlightSize => 350;

View File

@ -22,10 +22,8 @@ namespace osu.Game.Rulesets.Catch.Mods
"The combo count at which the catcher becomes completely hidden", "The combo count at which the catcher becomes completely hidden",
SettingControlType = typeof(SettingsSlider<int, HiddenComboSlider>) SettingControlType = typeof(SettingsSlider<int, HiddenComboSlider>)
)] )]
public override BindableInt HiddenComboCount { get; } = new BindableInt public override BindableInt HiddenComboCount { get; } = new BindableInt(10)
{ {
Default = 10,
Value = 10,
MinValue = 0, MinValue = 0,
MaxValue = 50, MaxValue = 50,
}; };

View File

@ -18,21 +18,15 @@ namespace osu.Game.Rulesets.Mania.Mods
public override Type[] IncompatibleMods => new[] { typeof(ModHidden) }; public override Type[] IncompatibleMods => new[] { typeof(ModHidden) };
[SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")] [SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
public override BindableFloat SizeMultiplier { get; } = new BindableFloat public override BindableFloat SizeMultiplier { get; } = new BindableFloat(1)
{ {
MinValue = 0.5f, MinValue = 0.5f,
MaxValue = 3f, MaxValue = 3f,
Default = 1f,
Value = 1f,
Precision = 0.1f Precision = 0.1f
}; };
[SettingSource("Change size based on combo", "Decrease the flashlight size as combo increases.")] [SettingSource("Change size based on combo", "Decrease the flashlight size as combo increases.")]
public override BindableBool ComboBasedSize { get; } = new BindableBool public override BindableBool ComboBasedSize { get; } = new BindableBool();
{
Default = false,
Value = false
};
public override float DefaultFlashlightSize => 50; public override float DefaultFlashlightSize => 50;

View File

@ -19,12 +19,10 @@ namespace osu.Game.Rulesets.Osu.Mods
public override LocalisableString Description => "Hit them at the right size!"; public override LocalisableString Description => "Hit them at the right size!";
[SettingSource("Starting Size", "The initial size multiplier applied to all objects.")] [SettingSource("Starting Size", "The initial size multiplier applied to all objects.")]
public override BindableNumber<float> StartScale { get; } = new BindableFloat public override BindableNumber<float> StartScale { get; } = new BindableFloat(2)
{ {
MinValue = 1f, MinValue = 1f,
MaxValue = 25f, MaxValue = 25f,
Default = 2f,
Value = 2f,
Precision = 0.1f, Precision = 0.1f,
}; };
} }

View File

@ -33,21 +33,15 @@ namespace osu.Game.Rulesets.Osu.Mods
}; };
[SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")] [SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
public override BindableFloat SizeMultiplier { get; } = new BindableFloat public override BindableFloat SizeMultiplier { get; } = new BindableFloat(1)
{ {
MinValue = 0.5f, MinValue = 0.5f,
MaxValue = 2f, MaxValue = 2f,
Default = 1f,
Value = 1f,
Precision = 0.1f Precision = 0.1f
}; };
[SettingSource("Change size based on combo", "Decrease the flashlight size as combo increases.")] [SettingSource("Change size based on combo", "Decrease the flashlight size as combo increases.")]
public override BindableBool ComboBasedSize { get; } = new BindableBool public override BindableBool ComboBasedSize { get; } = new BindableBool(true);
{
Default = true,
Value = true
};
public override float DefaultFlashlightSize => 180; public override float DefaultFlashlightSize => 180;

View File

@ -19,12 +19,10 @@ namespace osu.Game.Rulesets.Osu.Mods
public override LocalisableString Description => "Hit them at the right size!"; public override LocalisableString Description => "Hit them at the right size!";
[SettingSource("Starting Size", "The initial size multiplier applied to all objects.")] [SettingSource("Starting Size", "The initial size multiplier applied to all objects.")]
public override BindableNumber<float> StartScale { get; } = new BindableFloat public override BindableNumber<float> StartScale { get; } = new BindableFloat(0.5f)
{ {
MinValue = 0f, MinValue = 0f,
MaxValue = 0.99f, MaxValue = 0.99f,
Default = 0.5f,
Value = 0.5f,
Precision = 0.01f, Precision = 0.01f,
}; };
} }

View File

@ -27,10 +27,8 @@ namespace osu.Game.Rulesets.Osu.Mods
"The combo count at which the cursor becomes completely hidden", "The combo count at which the cursor becomes completely hidden",
SettingControlType = typeof(SettingsSlider<int, HiddenComboSlider>) SettingControlType = typeof(SettingsSlider<int, HiddenComboSlider>)
)] )]
public override BindableInt HiddenComboCount { get; } = new BindableInt public override BindableInt HiddenComboCount { get; } = new BindableInt(10)
{ {
Default = 10,
Value = 10,
MinValue = 0, MinValue = 0,
MaxValue = 50, MaxValue = 50,
}; };

View File

@ -29,10 +29,8 @@ namespace osu.Game.Rulesets.Osu.Mods
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModTarget)).ToArray(); public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModTarget)).ToArray();
[SettingSource("Angle sharpness", "How sharp angles should be", SettingControlType = typeof(SettingsSlider<float>))] [SettingSource("Angle sharpness", "How sharp angles should be", SettingControlType = typeof(SettingsSlider<float>))]
public BindableFloat AngleSharpness { get; } = new BindableFloat public BindableFloat AngleSharpness { get; } = new BindableFloat(7)
{ {
Default = 7,
Value = 7,
MinValue = 1, MinValue = 1,
MaxValue = 10, MaxValue = 10,
Precision = 0.1f Precision = 0.1f

View File

@ -53,11 +53,7 @@ namespace osu.Game.Rulesets.Osu.Mods
}).ToArray(); }).ToArray();
[SettingSource("Seed", "Use a custom seed instead of a random one", SettingControlType = typeof(SettingsNumberBox))] [SettingSource("Seed", "Use a custom seed instead of a random one", SettingControlType = typeof(SettingsNumberBox))]
public Bindable<int?> Seed { get; } = new Bindable<int?> public Bindable<int?> Seed { get; } = new Bindable<int?>();
{
Default = null,
Value = null
};
[SettingSource("Metronome ticks", "Whether a metronome beat should play in the background")] [SettingSource("Metronome ticks", "Whether a metronome beat should play in the background")]
public Bindable<bool> Metronome { get; } = new BindableBool(true); public Bindable<bool> Metronome { get; } = new BindableBool(true);

View File

@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
}; };
accentColour = hitObject.AccentColour.GetBoundCopy(); accentColour = hitObject.AccentColour.GetBoundCopy();
accentColour.BindValueChanged(accent => BorderColour = accent.NewValue); accentColour.BindValueChanged(accent => BorderColour = accent.NewValue, true);
} }
} }
} }

View File

@ -18,21 +18,15 @@ namespace osu.Game.Rulesets.Taiko.Mods
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1; public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
[SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")] [SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
public override BindableFloat SizeMultiplier { get; } = new BindableFloat public override BindableFloat SizeMultiplier { get; } = new BindableFloat(1)
{ {
MinValue = 0.5f, MinValue = 0.5f,
MaxValue = 1.5f, MaxValue = 1.5f,
Default = 1f,
Value = 1f,
Precision = 0.1f Precision = 0.1f
}; };
[SettingSource("Change size based on combo", "Decrease the flashlight size as combo increases.")] [SettingSource("Change size based on combo", "Decrease the flashlight size as combo increases.")]
public override BindableBool ComboBasedSize { get; } = new BindableBool public override BindableBool ComboBasedSize { get; } = new BindableBool(true);
{
Default = true,
Value = true
};
public override float DefaultFlashlightSize => 250; public override float DefaultFlashlightSize => 250;

View File

@ -204,31 +204,23 @@ namespace osu.Game.Tests.Online
public override double ScoreMultiplier => 1; public override double ScoreMultiplier => 1;
[SettingSource("Initial rate", "The starting speed of the track")] [SettingSource("Initial rate", "The starting speed of the track")]
public override BindableNumber<double> InitialRate { get; } = new BindableDouble public override BindableNumber<double> InitialRate { get; } = new BindableDouble(1.5)
{ {
MinValue = 1, MinValue = 1,
MaxValue = 2, MaxValue = 2,
Default = 1.5,
Value = 1.5,
Precision = 0.01, Precision = 0.01,
}; };
[SettingSource("Final rate", "The speed increase to ramp towards")] [SettingSource("Final rate", "The speed increase to ramp towards")]
public override BindableNumber<double> FinalRate { get; } = new BindableDouble public override BindableNumber<double> FinalRate { get; } = new BindableDouble(0.5)
{ {
MinValue = 0, MinValue = 0,
MaxValue = 1, MaxValue = 1,
Default = 0.5,
Value = 0.5,
Precision = 0.01, Precision = 0.01,
}; };
[SettingSource("Adjust pitch", "Should pitch be adjusted with speed")] [SettingSource("Adjust pitch", "Should pitch be adjusted with speed")]
public override BindableBool AdjustPitch { get; } = new BindableBool public override BindableBool AdjustPitch { get; } = new BindableBool(true);
{
Default = true,
Value = true
};
} }
private class TestModDifficultyAdjust : ModDifficultyAdjust private class TestModDifficultyAdjust : ModDifficultyAdjust

View File

@ -124,31 +124,23 @@ namespace osu.Game.Tests.Online
public override double ScoreMultiplier => 1; public override double ScoreMultiplier => 1;
[SettingSource("Initial rate", "The starting speed of the track")] [SettingSource("Initial rate", "The starting speed of the track")]
public override BindableNumber<double> InitialRate { get; } = new BindableDouble public override BindableNumber<double> InitialRate { get; } = new BindableDouble(1.5)
{ {
MinValue = 1, MinValue = 1,
MaxValue = 2, MaxValue = 2,
Default = 1.5,
Value = 1.5,
Precision = 0.01, Precision = 0.01,
}; };
[SettingSource("Final rate", "The speed increase to ramp towards")] [SettingSource("Final rate", "The speed increase to ramp towards")]
public override BindableNumber<double> FinalRate { get; } = new BindableDouble public override BindableNumber<double> FinalRate { get; } = new BindableDouble(0.5)
{ {
MinValue = 0, MinValue = 0,
MaxValue = 1, MaxValue = 1,
Default = 0.5,
Value = 0.5,
Precision = 0.01, Precision = 0.01,
}; };
[SettingSource("Adjust pitch", "Should pitch be adjusted with speed")] [SettingSource("Adjust pitch", "Should pitch be adjusted with speed")]
public override BindableBool AdjustPitch { get; } = new BindableBool public override BindableBool AdjustPitch { get; } = new BindableBool(true);
{
Default = true,
Value = true
};
} }
private class TestModEnum : Mod private class TestModEnum : Mod

View File

@ -29,11 +29,7 @@ namespace osu.Game.Tests.Visual.Settings
{ {
Child = textBox = new SettingsTextBox Child = textBox = new SettingsTextBox
{ {
Current = new Bindable<string> Current = new Bindable<string>("test")
{
Default = "test",
Value = "test"
}
}; };
}); });
AddUntilStep("wait for loaded", () => textBox.IsLoaded); AddUntilStep("wait for loaded", () => textBox.IsLoaded);
@ -59,11 +55,7 @@ namespace osu.Game.Tests.Visual.Settings
{ {
Child = textBox = new SettingsTextBox Child = textBox = new SettingsTextBox
{ {
Current = new Bindable<string> Current = new Bindable<string>("test")
{
Default = "test",
Value = "test"
}
}; };
}); });
AddUntilStep("wait for loaded", () => textBox.IsLoaded); AddUntilStep("wait for loaded", () => textBox.IsLoaded);

View File

@ -67,11 +67,7 @@ namespace osu.Game.Tests.Visual.Settings
}; };
[SettingSource("Sample number textbox", "Textbox number entry", SettingControlType = typeof(SettingsNumberBox))] [SettingSource("Sample number textbox", "Textbox number entry", SettingControlType = typeof(SettingsNumberBox))]
public Bindable<int?> IntTextBoxBindable { get; } = new Bindable<int?> public Bindable<int?> IntTextBoxBindable { get; } = new Bindable<int?>();
{
Default = null,
Value = null
};
} }
private enum TestEnum private enum TestEnum

View File

@ -24,7 +24,6 @@ namespace osu.Game.Beatmaps.ControlPoints
public readonly BindableDouble SliderVelocityBindable = new BindableDouble(1) public readonly BindableDouble SliderVelocityBindable = new BindableDouble(1)
{ {
Precision = 0.01, Precision = 0.01,
Default = 1,
MinValue = 0.1, MinValue = 0.1,
MaxValue = 10 MaxValue = 10
}; };

View File

@ -28,7 +28,6 @@ namespace osu.Game.Beatmaps.ControlPoints
public readonly BindableDouble ScrollSpeedBindable = new BindableDouble(1) public readonly BindableDouble ScrollSpeedBindable = new BindableDouble(1)
{ {
Precision = 0.01, Precision = 0.01,
Default = 1,
MinValue = 0.01, MinValue = 0.01,
MaxValue = 10 MaxValue = 10
}; };

View File

@ -45,7 +45,6 @@ namespace osu.Game.Beatmaps.ControlPoints
{ {
MinValue = 0, MinValue = 0,
MaxValue = 100, MaxValue = 100,
Default = 100
}; };
/// <summary> /// <summary>

View File

@ -49,7 +49,6 @@ namespace osu.Game.Beatmaps.ControlPoints
/// </summary> /// </summary>
public readonly BindableDouble BeatLengthBindable = new BindableDouble(DEFAULT_BEAT_LENGTH) public readonly BindableDouble BeatLengthBindable = new BindableDouble(DEFAULT_BEAT_LENGTH)
{ {
Default = DEFAULT_BEAT_LENGTH,
MinValue = 6, MinValue = 6,
MaxValue = 60000 MaxValue = 60000
}; };

View File

@ -36,32 +36,24 @@ namespace osu.Game.Rulesets.Mods
public override Type[] IncompatibleMods => new[] { typeof(ModRateAdjust), typeof(ModTimeRamp), typeof(ModAutoplay) }; public override Type[] IncompatibleMods => new[] { typeof(ModRateAdjust), typeof(ModTimeRamp), typeof(ModAutoplay) };
[SettingSource("Initial rate", "The starting speed of the track")] [SettingSource("Initial rate", "The starting speed of the track")]
public BindableNumber<double> InitialRate { get; } = new BindableDouble public BindableNumber<double> InitialRate { get; } = new BindableDouble(1)
{ {
MinValue = 0.5, MinValue = 0.5,
MaxValue = 2, MaxValue = 2,
Default = 1,
Value = 1,
Precision = 0.01 Precision = 0.01
}; };
[SettingSource("Adjust pitch", "Should pitch be adjusted with speed")] [SettingSource("Adjust pitch", "Should pitch be adjusted with speed")]
public BindableBool AdjustPitch { get; } = new BindableBool public BindableBool AdjustPitch { get; } = new BindableBool(true);
{
Default = true,
Value = true
};
/// <summary> /// <summary>
/// The instantaneous rate of the track. /// The instantaneous rate of the track.
/// Every frame this mod will attempt to smoothly adjust this to meet <see cref="targetRate"/>. /// Every frame this mod will attempt to smoothly adjust this to meet <see cref="targetRate"/>.
/// </summary> /// </summary>
public BindableNumber<double> SpeedChange { get; } = new BindableDouble public BindableNumber<double> SpeedChange { get; } = new BindableDouble(1)
{ {
MinValue = min_allowable_rate, MinValue = min_allowable_rate,
MaxValue = max_allowable_rate, MaxValue = max_allowable_rate,
Default = 1,
Value = 1
}; };
// The two constants below denote the maximum allowable range of rates that `SpeedChange` can take. // The two constants below denote the maximum allowable range of rates that `SpeedChange` can take.

View File

@ -18,12 +18,10 @@ namespace osu.Game.Rulesets.Mods
public override LocalisableString Description => "Zoooooooooom..."; public override LocalisableString Description => "Zoooooooooom...";
[SettingSource("Speed increase", "The actual increase to apply")] [SettingSource("Speed increase", "The actual increase to apply")]
public override BindableNumber<double> SpeedChange { get; } = new BindableDouble public override BindableNumber<double> SpeedChange { get; } = new BindableDouble(1.5)
{ {
MinValue = 1.01, MinValue = 1.01,
MaxValue = 2, MaxValue = 2,
Default = 1.5,
Value = 1.5,
Precision = 0.01, Precision = 0.01,
}; };
} }

View File

@ -18,12 +18,10 @@ namespace osu.Game.Rulesets.Mods
public override LocalisableString Description => "Less zoom..."; public override LocalisableString Description => "Less zoom...";
[SettingSource("Speed decrease", "The actual decrease to apply")] [SettingSource("Speed decrease", "The actual decrease to apply")]
public override BindableNumber<double> SpeedChange { get; } = new BindableDouble public override BindableNumber<double> SpeedChange { get; } = new BindableDouble(0.75)
{ {
MinValue = 0.5, MinValue = 0.5,
MaxValue = 0.99, MaxValue = 0.99,
Default = 0.75,
Value = 0.75,
Precision = 0.01, Precision = 0.01,
}; };
} }

View File

@ -36,34 +36,20 @@ namespace osu.Game.Rulesets.Mods
private readonly BindableNumber<int> currentCombo = new BindableInt(); private readonly BindableNumber<int> currentCombo = new BindableInt();
[SettingSource("Enable metronome", "Add a metronome beat to help you keep track of the rhythm.")] [SettingSource("Enable metronome", "Add a metronome beat to help you keep track of the rhythm.")]
public BindableBool EnableMetronome { get; } = new BindableBool public BindableBool EnableMetronome { get; } = new BindableBool(true);
{
Default = true,
Value = true
};
[SettingSource("Final volume at combo", "The combo count at which point the track reaches its final volume.", SettingControlType = typeof(SettingsSlider<int, MuteComboSlider>))] [SettingSource("Final volume at combo", "The combo count at which point the track reaches its final volume.", SettingControlType = typeof(SettingsSlider<int, MuteComboSlider>))]
public BindableInt MuteComboCount { get; } = new BindableInt public BindableInt MuteComboCount { get; } = new BindableInt(100)
{ {
Default = 100,
Value = 100,
MinValue = 0, MinValue = 0,
MaxValue = 500, MaxValue = 500,
}; };
[SettingSource("Start muted", "Increase volume as combo builds.")] [SettingSource("Start muted", "Increase volume as combo builds.")]
public BindableBool InverseMuting { get; } = new BindableBool public BindableBool InverseMuting { get; } = new BindableBool();
{
Default = false,
Value = false
};
[SettingSource("Mute hit sounds", "Hit sounds are also muted alongside the track.")] [SettingSource("Mute hit sounds", "Hit sounds are also muted alongside the track.")]
public BindableBool AffectsHitSounds { get; } = new BindableBool public BindableBool AffectsHitSounds { get; } = new BindableBool(true);
{
Default = true,
Value = true
};
protected ModMuted() protected ModMuted()
{ {

View File

@ -18,10 +18,6 @@ namespace osu.Game.Rulesets.Mods
public override double ScoreMultiplier => 1; public override double ScoreMultiplier => 1;
[SettingSource("Seed", "Use a custom seed instead of a random one", SettingControlType = typeof(SettingsNumberBox))] [SettingSource("Seed", "Use a custom seed instead of a random one", SettingControlType = typeof(SettingsNumberBox))]
public Bindable<int?> Seed { get; } = new Bindable<int?> public Bindable<int?> Seed { get; } = new Bindable<int?>();
{
Default = null,
Value = null
};
} }
} }

View File

@ -39,10 +39,8 @@ namespace osu.Game.Rulesets.Mods
private double finalRateTime; private double finalRateTime;
private double beginRampTime; private double beginRampTime;
public BindableNumber<double> SpeedChange { get; } = new BindableDouble public BindableNumber<double> SpeedChange { get; } = new BindableDouble(1)
{ {
Default = 1,
Value = 1,
Precision = 0.01, Precision = 0.01,
}; };

View File

@ -18,31 +18,23 @@ namespace osu.Game.Rulesets.Mods
public override IconUsage? Icon => FontAwesome.Solid.ChevronCircleDown; public override IconUsage? Icon => FontAwesome.Solid.ChevronCircleDown;
[SettingSource("Initial rate", "The starting speed of the track")] [SettingSource("Initial rate", "The starting speed of the track")]
public override BindableNumber<double> InitialRate { get; } = new BindableDouble public override BindableNumber<double> InitialRate { get; } = new BindableDouble(1)
{ {
MinValue = 0.51, MinValue = 0.51,
MaxValue = 2, MaxValue = 2,
Default = 1,
Value = 1,
Precision = 0.01, Precision = 0.01,
}; };
[SettingSource("Final rate", "The speed increase to ramp towards")] [SettingSource("Final rate", "The speed increase to ramp towards")]
public override BindableNumber<double> FinalRate { get; } = new BindableDouble public override BindableNumber<double> FinalRate { get; } = new BindableDouble(0.75)
{ {
MinValue = 0.5, MinValue = 0.5,
MaxValue = 1.99, MaxValue = 1.99,
Default = 0.75,
Value = 0.75,
Precision = 0.01, Precision = 0.01,
}; };
[SettingSource("Adjust pitch", "Should pitch be adjusted with speed")] [SettingSource("Adjust pitch", "Should pitch be adjusted with speed")]
public override BindableBool AdjustPitch { get; } = new BindableBool public override BindableBool AdjustPitch { get; } = new BindableBool(true);
{
Default = true,
Value = true
};
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModWindUp)).ToArray(); public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModWindUp)).ToArray();

View File

@ -18,31 +18,23 @@ namespace osu.Game.Rulesets.Mods
public override IconUsage? Icon => FontAwesome.Solid.ChevronCircleUp; public override IconUsage? Icon => FontAwesome.Solid.ChevronCircleUp;
[SettingSource("Initial rate", "The starting speed of the track")] [SettingSource("Initial rate", "The starting speed of the track")]
public override BindableNumber<double> InitialRate { get; } = new BindableDouble public override BindableNumber<double> InitialRate { get; } = new BindableDouble(1)
{ {
MinValue = 0.5, MinValue = 0.5,
MaxValue = 1.99, MaxValue = 1.99,
Default = 1,
Value = 1,
Precision = 0.01, Precision = 0.01,
}; };
[SettingSource("Final rate", "The speed increase to ramp towards")] [SettingSource("Final rate", "The speed increase to ramp towards")]
public override BindableNumber<double> FinalRate { get; } = new BindableDouble public override BindableNumber<double> FinalRate { get; } = new BindableDouble(1.5)
{ {
MinValue = 0.51, MinValue = 0.51,
MaxValue = 2, MaxValue = 2,
Default = 1.5,
Value = 1.5,
Precision = 0.01, Precision = 0.01,
}; };
[SettingSource("Adjust pitch", "Should pitch be adjusted with speed")] [SettingSource("Adjust pitch", "Should pitch be adjusted with speed")]
public override BindableBool AdjustPitch { get; } = new BindableBool public override BindableBool AdjustPitch { get; } = new BindableBool(true);
{
Default = true,
Value = true
};
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModWindDown)).ToArray(); public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModWindDown)).ToArray();

View File

@ -60,7 +60,6 @@ namespace osu.Game.Rulesets.UI.Scrolling
/// </summary> /// </summary>
protected readonly BindableDouble TimeRange = new BindableDouble(time_span_default) protected readonly BindableDouble TimeRange = new BindableDouble(time_span_default)
{ {
Default = time_span_default,
MinValue = time_span_min, MinValue = time_span_min,
MaxValue = time_span_max MaxValue = time_span_max
}; };

View File

@ -424,7 +424,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
private void hideError() => ErrorText.FadeOut(50); private void hideError() => ErrorText.FadeOut(50);
private void onSuccess(Room room) private void onSuccess(Room room) => Schedule(() =>
{ {
Debug.Assert(applyingSettingsOperation != null); Debug.Assert(applyingSettingsOperation != null);
@ -432,9 +432,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
applyingSettingsOperation.Dispose(); applyingSettingsOperation.Dispose();
applyingSettingsOperation = null; applyingSettingsOperation = null;
} });
private void onError(string text) private void onError(string text) => Schedule(() =>
{ {
Debug.Assert(applyingSettingsOperation != null); Debug.Assert(applyingSettingsOperation != null);
@ -455,7 +455,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
applyingSettingsOperation.Dispose(); applyingSettingsOperation.Dispose();
applyingSettingsOperation = null; applyingSettingsOperation = null;
} });
} }
public class CreateOrUpdateButton : TriangleButton public class CreateOrUpdateButton : TriangleButton

View File

@ -1,8 +1,6 @@
// 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 disable
using System; using System;
using osu.Framework.Timing; using osu.Framework.Timing;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;

View File

@ -1,8 +1,6 @@
// 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 disable
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
@ -12,6 +10,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions; using osu.Framework.Extensions;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Graphics; using osu.Game.Graphics;
@ -34,19 +33,20 @@ namespace osu.Game.Screens.Play.HUD
public readonly SortedDictionary<int, BindableLong> TeamScores = new SortedDictionary<int, BindableLong>(); public readonly SortedDictionary<int, BindableLong> TeamScores = new SortedDictionary<int, BindableLong>();
[Resolved] [Resolved]
private OsuColour colours { get; set; } private OsuColour colours { get; set; } = null!;
[Resolved] [Resolved]
private SpectatorClient spectatorClient { get; set; } private SpectatorClient spectatorClient { get; set; } = null!;
[Resolved] [Resolved]
private MultiplayerClient multiplayerClient { get; set; } private MultiplayerClient multiplayerClient { get; set; } = null!;
[Resolved] [Resolved]
private UserLookupCache userLookupCache { get; set; } private UserLookupCache userLookupCache { get; set; } = null!;
private Bindable<ScoringMode> scoringMode = null!;
private readonly MultiplayerRoomUser[] playingUsers; private readonly MultiplayerRoomUser[] playingUsers;
private Bindable<ScoringMode> scoringMode;
private readonly IBindableList<int> playingUserIds = new BindableList<int>(); private readonly IBindableList<int> playingUserIds = new BindableList<int>();
@ -126,14 +126,17 @@ namespace osu.Game.Screens.Play.HUD
playingUserIds.BindCollectionChanged(playingUsersChanged); playingUserIds.BindCollectionChanged(playingUsersChanged);
} }
protected override GameplayLeaderboardScore CreateLeaderboardScoreDrawable(IUser user, bool isTracked) protected override GameplayLeaderboardScore CreateLeaderboardScoreDrawable(IUser? user, bool isTracked)
{ {
var leaderboardScore = base.CreateLeaderboardScoreDrawable(user, isTracked); var leaderboardScore = base.CreateLeaderboardScoreDrawable(user, isTracked);
if (UserScores[user.OnlineID].Team is int team) if (user != null)
{ {
leaderboardScore.BackgroundColour = getTeamColour(team).Lighten(1.2f); if (UserScores[user.OnlineID].Team is int team)
leaderboardScore.TextColour = Color4.White; {
leaderboardScore.BackgroundColour = getTeamColour(team).Lighten(1.2f);
leaderboardScore.TextColour = Color4.White;
}
} }
return leaderboardScore; return leaderboardScore;
@ -189,7 +192,7 @@ namespace osu.Game.Screens.Play.HUD
{ {
base.Dispose(isDisposing); base.Dispose(isDisposing);
if (spectatorClient != null) if (spectatorClient.IsNotNull())
{ {
foreach (var user in playingUsers) foreach (var user in playingUsers)
spectatorClient.StopWatchingUser(user.UserID); spectatorClient.StopWatchingUser(user.UserID);

View File

@ -34,7 +34,6 @@ namespace osu.Game.Screens.Play
public readonly BindableNumber<double> UserPlaybackRate = new BindableDouble(1) public readonly BindableNumber<double> UserPlaybackRate = new BindableDouble(1)
{ {
Default = 1,
MinValue = 0.5, MinValue = 0.5,
MaxValue = 2, MaxValue = 2,
Precision = 0.1, Precision = 0.1,

View File

@ -31,8 +31,6 @@ namespace osu.Game.Screens.Play.PlayerSettings
public BindableDouble Current { get; } = new BindableDouble public BindableDouble Current { get; } = new BindableDouble
{ {
Default = 0,
Value = 0,
MinValue = -50, MinValue = -50,
MaxValue = 50, MaxValue = 50,
Precision = 0.1, Precision = 0.1,

View File

@ -17,7 +17,6 @@ namespace osu.Game.Screens.Play.PlayerSettings
public readonly Bindable<double> UserPlaybackRate = new BindableDouble(1) public readonly Bindable<double> UserPlaybackRate = new BindableDouble(1)
{ {
Default = 1,
MinValue = 0.5, MinValue = 0.5,
MaxValue = 2, MaxValue = 2,
Precision = 0.1, Precision = 0.1,

View File

@ -10,7 +10,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Animations; using osu.Framework.Graphics.Animations;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using osu.Framework.Utils; using osu.Framework.Utils;
using osu.Game.Screens.Play; using osu.Game.Beatmaps;
using osu.Game.Skinning; using osu.Game.Skinning;
using osuTK; using osuTK;
@ -91,6 +91,9 @@ namespace osu.Game.Storyboards.Drawables
[Resolved] [Resolved]
private ISkinSource skin { get; set; } private ISkinSource skin { get; set; }
[Resolved]
private IBeatSyncProvider beatSyncProvider { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(TextureStore textureStore, Storyboard storyboard) private void load(TextureStore textureStore, Storyboard storyboard)
{ {
@ -116,9 +119,6 @@ namespace osu.Game.Storyboards.Drawables
Animation.ApplyTransforms(this); Animation.ApplyTransforms(this);
} }
[Resolved]
private IGameplayClock gameplayClock { get; set; }
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
@ -128,7 +128,7 @@ namespace osu.Game.Storyboards.Drawables
// //
// In the case of storyboard animations, we want to synchronise with game time perfectly // In the case of storyboard animations, we want to synchronise with game time perfectly
// so let's get a correct time based on gameplay clock and earliest transform. // so let's get a correct time based on gameplay clock and earliest transform.
PlaybackPosition = gameplayClock.CurrentTime - Animation.EarliestTransformTime; PlaybackPosition = (beatSyncProvider.Clock?.CurrentTime ?? Clock.CurrentTime) - Animation.EarliestTransformTime;
} }
private void skinSourceChanged() private void skinSourceChanged()