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

Rename field to match usage

This commit is contained in:
Dean Herbert 2022-11-02 17:49:52 +09:00
parent c3eb0c6330
commit 0e502de8b4
4 changed files with 11 additions and 11 deletions

View File

@ -86,7 +86,7 @@ namespace osu.Game.Tests.Visual.Editing
// this test cares about checking the background belonging to the editor specifically, so check that using reference equality // this test cares about checking the background belonging to the editor specifically, so check that using reference equality
// (as `.Equals()` cannot discern between the two, as they technically share the same database GUID). // (as `.Equals()` cannot discern between the two, as they technically share the same database GUID).
var background = this.ChildrenOfType<BackgroundScreenBeatmap>().Single(b => ReferenceEquals(b.Beatmap.BeatmapInfo, EditorBeatmap.BeatmapInfo)); var background = this.ChildrenOfType<BackgroundScreenBeatmap>().Single(b => ReferenceEquals(b.Beatmap.BeatmapInfo, EditorBeatmap.BeatmapInfo));
return background.DimAmount.Value == editorDim.Value && background.BlurAmount.Value == 0; return background.DimWhenUserSettingsIgnored.Value == editorDim.Value && background.BlurAmount.Value == 0;
}); });
AddAssert("no mods selected", () => SelectedMods.Value.Count == 0); AddAssert("no mods selected", () => SelectedMods.Value.Count == 0);
} }
@ -119,7 +119,7 @@ namespace osu.Game.Tests.Visual.Editing
// this test cares about checking the background belonging to the editor specifically, so check that using reference equality // this test cares about checking the background belonging to the editor specifically, so check that using reference equality
// (as `.Equals()` cannot discern between the two, as they technically share the same database GUID). // (as `.Equals()` cannot discern between the two, as they technically share the same database GUID).
var background = this.ChildrenOfType<BackgroundScreenBeatmap>().Single(b => ReferenceEquals(b.Beatmap.BeatmapInfo, EditorBeatmap.BeatmapInfo)); var background = this.ChildrenOfType<BackgroundScreenBeatmap>().Single(b => ReferenceEquals(b.Beatmap.BeatmapInfo, EditorBeatmap.BeatmapInfo));
return background.DimAmount.Value == editorDim.Value && background.BlurAmount.Value == 0; return background.DimWhenUserSettingsIgnored.Value == editorDim.Value && background.BlurAmount.Value == 0;
}); });
AddStep("start track", () => EditorClock.Start()); AddStep("start track", () => EditorClock.Start());

View File

@ -47,9 +47,9 @@ namespace osu.Game.Graphics.Containers
protected Bindable<double> UserDimLevel { get; private set; } = null!; protected Bindable<double> UserDimLevel { get; private set; } = null!;
/// <summary> /// <summary>
/// The amount of dim to be override if <see cref="IgnoreUserSettings"/> is true. /// The amount of dim to be used when <see cref="IgnoreUserSettings"/> is <c>true</c>.
/// </summary> /// </summary>
public Bindable<float> DimAmount { get; set; } = new Bindable<float>(); public Bindable<float> DimWhenUserSettingsIgnored { get; set; } = new Bindable<float>();
protected Bindable<bool> LightenDuringBreaks { get; private set; } = null!; protected Bindable<bool> LightenDuringBreaks { get; private set; } = null!;
@ -57,7 +57,7 @@ namespace osu.Game.Graphics.Containers
private float breakLightening => LightenDuringBreaks.Value && IsBreakTime.Value ? BREAK_LIGHTEN_AMOUNT : 0; private float breakLightening => LightenDuringBreaks.Value && IsBreakTime.Value ? BREAK_LIGHTEN_AMOUNT : 0;
protected float DimLevel => Math.Max(!IgnoreUserSettings.Value ? (float)UserDimLevel.Value - breakLightening : DimAmount.Value, 0); protected float DimLevel => Math.Max(!IgnoreUserSettings.Value ? (float)UserDimLevel.Value - breakLightening : DimWhenUserSettingsIgnored.Value, 0);
protected override Container<Drawable> Content => dimContent; protected override Container<Drawable> Content => dimContent;
@ -79,7 +79,7 @@ namespace osu.Game.Graphics.Containers
ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard); ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
UserDimLevel.ValueChanged += _ => UpdateVisuals(); UserDimLevel.ValueChanged += _ => UpdateVisuals();
DimAmount.ValueChanged += _ => UpdateVisuals(); DimWhenUserSettingsIgnored.ValueChanged += _ => UpdateVisuals();
LightenDuringBreaks.ValueChanged += _ => UpdateVisuals(); LightenDuringBreaks.ValueChanged += _ => UpdateVisuals();
IsBreakTime.ValueChanged += _ => UpdateVisuals(); IsBreakTime.ValueChanged += _ => UpdateVisuals();
ShowStoryboard.ValueChanged += _ => UpdateVisuals(); ShowStoryboard.ValueChanged += _ => UpdateVisuals();

View File

@ -44,9 +44,9 @@ namespace osu.Game.Screens.Backgrounds
public readonly Bindable<float> BlurAmount = new BindableFloat(); public readonly Bindable<float> BlurAmount = new BindableFloat();
/// <summary> /// <summary>
/// The amount of dim to be override if <see cref="IgnoreUserSettings"/> is true. /// The amount of dim to be used when <see cref="IgnoreUserSettings"/> is <c>true</c>.
/// </summary> /// </summary>
public readonly Bindable<float> DimAmount = new Bindable<float>(); public readonly Bindable<float> DimWhenUserSettingsIgnored = new Bindable<float>();
internal readonly IBindable<bool> IsBreakTime = new Bindable<bool>(); internal readonly IBindable<bool> IsBreakTime = new Bindable<bool>();
@ -63,7 +63,7 @@ namespace osu.Game.Screens.Backgrounds
dimmable.IgnoreUserSettings.BindTo(IgnoreUserSettings); dimmable.IgnoreUserSettings.BindTo(IgnoreUserSettings);
dimmable.IsBreakTime.BindTo(IsBreakTime); dimmable.IsBreakTime.BindTo(IsBreakTime);
dimmable.BlurAmount.BindTo(BlurAmount); dimmable.BlurAmount.BindTo(BlurAmount);
dimmable.DimAmount.BindTo(DimAmount); dimmable.DimWhenUserSettingsIgnored.BindTo(DimWhenUserSettingsIgnored);
StoryboardReplacesBackground.BindTo(dimmable.StoryboardReplacesBackground); StoryboardReplacesBackground.BindTo(dimmable.StoryboardReplacesBackground);
} }

View File

@ -637,7 +637,7 @@ namespace osu.Game.Screens.Edit
ApplyToBackground(b => ApplyToBackground(b =>
{ {
b.IgnoreUserSettings.Value = true; b.IgnoreUserSettings.Value = true;
b.DimAmount.Value = editorBackgroundDim.Value; b.DimWhenUserSettingsIgnored.Value = editorBackgroundDim.Value;
b.BlurAmount.Value = 0; b.BlurAmount.Value = 0;
}); });
} }
@ -668,7 +668,7 @@ namespace osu.Game.Screens.Edit
ApplyToBackground(b => ApplyToBackground(b =>
{ {
//b.DimAmount.UnbindAll(); //b.DimAmount.UnbindAll();
b.DimAmount.Value = 0; b.DimWhenUserSettingsIgnored.Value = 0;
}); });
resetTrack(); resetTrack();