mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 18:13:09 +08:00
Make SettingsItem conform to IHasCurrentValue
This commit is contained in:
parent
461fa22e74
commit
9d7880afda
@ -29,12 +29,12 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
new SettingsEnumDropdown<ManiaScrollingDirection>
|
new SettingsEnumDropdown<ManiaScrollingDirection>
|
||||||
{
|
{
|
||||||
LabelText = "Scrolling direction",
|
LabelText = "Scrolling direction",
|
||||||
Bindable = config.GetBindable<ManiaScrollingDirection>(ManiaRulesetSetting.ScrollDirection)
|
Current = config.GetBindable<ManiaScrollingDirection>(ManiaRulesetSetting.ScrollDirection)
|
||||||
},
|
},
|
||||||
new SettingsSlider<double, TimeSlider>
|
new SettingsSlider<double, TimeSlider>
|
||||||
{
|
{
|
||||||
LabelText = "Scroll speed",
|
LabelText = "Scroll speed",
|
||||||
Bindable = config.GetBindable<double>(ManiaRulesetSetting.ScrollTime),
|
Current = config.GetBindable<double>(ManiaRulesetSetting.ScrollTime),
|
||||||
KeyboardStep = 5
|
KeyboardStep = 5
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -27,17 +27,17 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Snaking in sliders",
|
LabelText = "Snaking in sliders",
|
||||||
Bindable = config.GetBindable<bool>(OsuRulesetSetting.SnakingInSliders)
|
Current = config.GetBindable<bool>(OsuRulesetSetting.SnakingInSliders)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Snaking out sliders",
|
LabelText = "Snaking out sliders",
|
||||||
Bindable = config.GetBindable<bool>(OsuRulesetSetting.SnakingOutSliders)
|
Current = config.GetBindable<bool>(OsuRulesetSetting.SnakingOutSliders)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Cursor trail",
|
LabelText = "Cursor trail",
|
||||||
Bindable = config.GetBindable<bool>(OsuRulesetSetting.ShowCursorTrail)
|
Current = config.GetBindable<bool>(OsuRulesetSetting.ShowCursorTrail)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -10,34 +10,34 @@ namespace osu.Game.Tournament.Components
|
|||||||
{
|
{
|
||||||
public class DateTextBox : SettingsTextBox
|
public class DateTextBox : SettingsTextBox
|
||||||
{
|
{
|
||||||
public new Bindable<DateTimeOffset> Bindable
|
public new Bindable<DateTimeOffset> Current
|
||||||
{
|
{
|
||||||
get => bindable;
|
get => current;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
bindable = value.GetBoundCopy();
|
current = value.GetBoundCopy();
|
||||||
bindable.BindValueChanged(dto =>
|
current.BindValueChanged(dto =>
|
||||||
base.Bindable.Value = dto.NewValue.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"), true);
|
base.Current.Value = dto.NewValue.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// hold a reference to the provided bindable so we don't have to in every settings section.
|
// hold a reference to the provided bindable so we don't have to in every settings section.
|
||||||
private Bindable<DateTimeOffset> bindable = new Bindable<DateTimeOffset>();
|
private Bindable<DateTimeOffset> current = new Bindable<DateTimeOffset>();
|
||||||
|
|
||||||
public DateTextBox()
|
public DateTextBox()
|
||||||
{
|
{
|
||||||
base.Bindable = new Bindable<string>();
|
base.Current = new Bindable<string>();
|
||||||
|
|
||||||
((OsuTextBox)Control).OnCommit += (sender, newText) =>
|
((OsuTextBox)Control).OnCommit += (sender, newText) =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bindable.Value = DateTimeOffset.Parse(sender.Text);
|
current.Value = DateTimeOffset.Parse(sender.Text);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
// reset textbox content to its last valid state on a parse failure.
|
// reset textbox content to its last valid state on a parse failure.
|
||||||
bindable.TriggerChange();
|
current.TriggerChange();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -63,25 +63,25 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
{
|
{
|
||||||
LabelText = "Name",
|
LabelText = "Name",
|
||||||
Width = 0.33f,
|
Width = 0.33f,
|
||||||
Bindable = Model.Name
|
Current = Model.Name
|
||||||
},
|
},
|
||||||
new SettingsTextBox
|
new SettingsTextBox
|
||||||
{
|
{
|
||||||
LabelText = "Description",
|
LabelText = "Description",
|
||||||
Width = 0.33f,
|
Width = 0.33f,
|
||||||
Bindable = Model.Description
|
Current = Model.Description
|
||||||
},
|
},
|
||||||
new DateTextBox
|
new DateTextBox
|
||||||
{
|
{
|
||||||
LabelText = "Start Time",
|
LabelText = "Start Time",
|
||||||
Width = 0.33f,
|
Width = 0.33f,
|
||||||
Bindable = Model.StartDate
|
Current = Model.StartDate
|
||||||
},
|
},
|
||||||
new SettingsSlider<int>
|
new SettingsSlider<int>
|
||||||
{
|
{
|
||||||
LabelText = "Best of",
|
LabelText = "Best of",
|
||||||
Width = 0.33f,
|
Width = 0.33f,
|
||||||
Bindable = Model.BestOf
|
Current = Model.BestOf
|
||||||
},
|
},
|
||||||
new SettingsButton
|
new SettingsButton
|
||||||
{
|
{
|
||||||
@ -186,14 +186,14 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
LabelText = "Beatmap ID",
|
LabelText = "Beatmap ID",
|
||||||
RelativeSizeAxes = Axes.None,
|
RelativeSizeAxes = Axes.None,
|
||||||
Width = 200,
|
Width = 200,
|
||||||
Bindable = beatmapId,
|
Current = beatmapId,
|
||||||
},
|
},
|
||||||
new SettingsTextBox
|
new SettingsTextBox
|
||||||
{
|
{
|
||||||
LabelText = "Mods",
|
LabelText = "Mods",
|
||||||
RelativeSizeAxes = Axes.None,
|
RelativeSizeAxes = Axes.None,
|
||||||
Width = 200,
|
Width = 200,
|
||||||
Bindable = mods,
|
Current = mods,
|
||||||
},
|
},
|
||||||
drawableContainer = new Container
|
drawableContainer = new Container
|
||||||
{
|
{
|
||||||
|
@ -74,13 +74,13 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
{
|
{
|
||||||
LabelText = "Mod",
|
LabelText = "Mod",
|
||||||
Width = 0.33f,
|
Width = 0.33f,
|
||||||
Bindable = Model.Mod
|
Current = Model.Mod
|
||||||
},
|
},
|
||||||
new SettingsSlider<int>
|
new SettingsSlider<int>
|
||||||
{
|
{
|
||||||
LabelText = "Seed",
|
LabelText = "Seed",
|
||||||
Width = 0.33f,
|
Width = 0.33f,
|
||||||
Bindable = Model.Seed
|
Current = Model.Seed
|
||||||
},
|
},
|
||||||
new SettingsButton
|
new SettingsButton
|
||||||
{
|
{
|
||||||
@ -187,21 +187,21 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
LabelText = "Beatmap ID",
|
LabelText = "Beatmap ID",
|
||||||
RelativeSizeAxes = Axes.None,
|
RelativeSizeAxes = Axes.None,
|
||||||
Width = 200,
|
Width = 200,
|
||||||
Bindable = beatmapId,
|
Current = beatmapId,
|
||||||
},
|
},
|
||||||
new SettingsSlider<int>
|
new SettingsSlider<int>
|
||||||
{
|
{
|
||||||
LabelText = "Seed",
|
LabelText = "Seed",
|
||||||
RelativeSizeAxes = Axes.None,
|
RelativeSizeAxes = Axes.None,
|
||||||
Width = 200,
|
Width = 200,
|
||||||
Bindable = beatmap.Seed
|
Current = beatmap.Seed
|
||||||
},
|
},
|
||||||
new SettingsTextBox
|
new SettingsTextBox
|
||||||
{
|
{
|
||||||
LabelText = "Score",
|
LabelText = "Score",
|
||||||
RelativeSizeAxes = Axes.None,
|
RelativeSizeAxes = Axes.None,
|
||||||
Width = 200,
|
Width = 200,
|
||||||
Bindable = score,
|
Current = score,
|
||||||
},
|
},
|
||||||
drawableContainer = new Container
|
drawableContainer = new Container
|
||||||
{
|
{
|
||||||
|
@ -102,31 +102,31 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
{
|
{
|
||||||
LabelText = "Name",
|
LabelText = "Name",
|
||||||
Width = 0.2f,
|
Width = 0.2f,
|
||||||
Bindable = Model.FullName
|
Current = Model.FullName
|
||||||
},
|
},
|
||||||
new SettingsTextBox
|
new SettingsTextBox
|
||||||
{
|
{
|
||||||
LabelText = "Acronym",
|
LabelText = "Acronym",
|
||||||
Width = 0.2f,
|
Width = 0.2f,
|
||||||
Bindable = Model.Acronym
|
Current = Model.Acronym
|
||||||
},
|
},
|
||||||
new SettingsTextBox
|
new SettingsTextBox
|
||||||
{
|
{
|
||||||
LabelText = "Flag",
|
LabelText = "Flag",
|
||||||
Width = 0.2f,
|
Width = 0.2f,
|
||||||
Bindable = Model.FlagName
|
Current = Model.FlagName
|
||||||
},
|
},
|
||||||
new SettingsTextBox
|
new SettingsTextBox
|
||||||
{
|
{
|
||||||
LabelText = "Seed",
|
LabelText = "Seed",
|
||||||
Width = 0.2f,
|
Width = 0.2f,
|
||||||
Bindable = Model.Seed
|
Current = Model.Seed
|
||||||
},
|
},
|
||||||
new SettingsSlider<int>
|
new SettingsSlider<int>
|
||||||
{
|
{
|
||||||
LabelText = "Last Year Placement",
|
LabelText = "Last Year Placement",
|
||||||
Width = 0.33f,
|
Width = 0.33f,
|
||||||
Bindable = Model.LastYearPlacing
|
Current = Model.LastYearPlacing
|
||||||
},
|
},
|
||||||
new SettingsButton
|
new SettingsButton
|
||||||
{
|
{
|
||||||
@ -247,7 +247,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
LabelText = "User ID",
|
LabelText = "User ID",
|
||||||
RelativeSizeAxes = Axes.None,
|
RelativeSizeAxes = Axes.None,
|
||||||
Width = 200,
|
Width = 200,
|
||||||
Bindable = userId,
|
Current = userId,
|
||||||
},
|
},
|
||||||
drawableContainer = new Container
|
drawableContainer = new Container
|
||||||
{
|
{
|
||||||
|
@ -113,13 +113,13 @@ namespace osu.Game.Tournament.Screens.Gameplay
|
|||||||
new SettingsSlider<int>
|
new SettingsSlider<int>
|
||||||
{
|
{
|
||||||
LabelText = "Chroma width",
|
LabelText = "Chroma width",
|
||||||
Bindable = LadderInfo.ChromaKeyWidth,
|
Current = LadderInfo.ChromaKeyWidth,
|
||||||
KeyboardStep = 1,
|
KeyboardStep = 1,
|
||||||
},
|
},
|
||||||
new SettingsSlider<int>
|
new SettingsSlider<int>
|
||||||
{
|
{
|
||||||
LabelText = "Players per team",
|
LabelText = "Players per team",
|
||||||
Bindable = LadderInfo.PlayersPerTeam,
|
Current = LadderInfo.PlayersPerTeam,
|
||||||
KeyboardStep = 1,
|
KeyboardStep = 1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,15 +51,15 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
|
|
||||||
editorInfo.Selected.ValueChanged += selection =>
|
editorInfo.Selected.ValueChanged += selection =>
|
||||||
{
|
{
|
||||||
roundDropdown.Bindable = selection.NewValue?.Round;
|
roundDropdown.Current = selection.NewValue?.Round;
|
||||||
losersCheckbox.Current = selection.NewValue?.Losers;
|
losersCheckbox.Current = selection.NewValue?.Losers;
|
||||||
dateTimeBox.Bindable = selection.NewValue?.Date;
|
dateTimeBox.Current = selection.NewValue?.Date;
|
||||||
|
|
||||||
team1Dropdown.Bindable = selection.NewValue?.Team1;
|
team1Dropdown.Current = selection.NewValue?.Team1;
|
||||||
team2Dropdown.Bindable = selection.NewValue?.Team2;
|
team2Dropdown.Current = selection.NewValue?.Team2;
|
||||||
};
|
};
|
||||||
|
|
||||||
roundDropdown.Bindable.ValueChanged += round =>
|
roundDropdown.Current.ValueChanged += round =>
|
||||||
{
|
{
|
||||||
if (editorInfo.Selected.Value?.Date.Value < round.NewValue?.StartDate.Value)
|
if (editorInfo.Selected.Value?.Date.Value < round.NewValue?.StartDate.Value)
|
||||||
{
|
{
|
||||||
@ -88,7 +88,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
{
|
{
|
||||||
public SettingsRoundDropdown(BindableList<TournamentRound> rounds)
|
public SettingsRoundDropdown(BindableList<TournamentRound> rounds)
|
||||||
{
|
{
|
||||||
Bindable = new Bindable<TournamentRound>();
|
Current = new Bindable<TournamentRound>();
|
||||||
|
|
||||||
foreach (var r in rounds.Prepend(new TournamentRound()))
|
foreach (var r in rounds.Prepend(new TournamentRound()))
|
||||||
add(r);
|
add(r);
|
||||||
|
@ -61,7 +61,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro
|
|||||||
new SettingsTeamDropdown(LadderInfo.Teams)
|
new SettingsTeamDropdown(LadderInfo.Teams)
|
||||||
{
|
{
|
||||||
LabelText = "Show specific team",
|
LabelText = "Show specific team",
|
||||||
Bindable = currentTeam,
|
Current = currentTeam,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ namespace osu.Game.Configuration
|
|||||||
yield return new SettingsSlider<float>
|
yield return new SettingsSlider<float>
|
||||||
{
|
{
|
||||||
LabelText = attr.Label,
|
LabelText = attr.Label,
|
||||||
Bindable = bNumber,
|
Current = bNumber,
|
||||||
KeyboardStep = 0.1f,
|
KeyboardStep = 0.1f,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ namespace osu.Game.Configuration
|
|||||||
yield return new SettingsSlider<double>
|
yield return new SettingsSlider<double>
|
||||||
{
|
{
|
||||||
LabelText = attr.Label,
|
LabelText = attr.Label,
|
||||||
Bindable = bNumber,
|
Current = bNumber,
|
||||||
KeyboardStep = 0.1f,
|
KeyboardStep = 0.1f,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ namespace osu.Game.Configuration
|
|||||||
yield return new SettingsSlider<int>
|
yield return new SettingsSlider<int>
|
||||||
{
|
{
|
||||||
LabelText = attr.Label,
|
LabelText = attr.Label,
|
||||||
Bindable = bNumber
|
Current = bNumber
|
||||||
};
|
};
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -86,7 +86,7 @@ namespace osu.Game.Configuration
|
|||||||
yield return new SettingsCheckbox
|
yield return new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = attr.Label,
|
LabelText = attr.Label,
|
||||||
Bindable = bBool
|
Current = bBool
|
||||||
};
|
};
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -95,7 +95,7 @@ namespace osu.Game.Configuration
|
|||||||
yield return new SettingsTextBox
|
yield return new SettingsTextBox
|
||||||
{
|
{
|
||||||
LabelText = attr.Label,
|
LabelText = attr.Label,
|
||||||
Bindable = bString
|
Current = bString
|
||||||
};
|
};
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -105,7 +105,7 @@ namespace osu.Game.Configuration
|
|||||||
var dropdown = (Drawable)Activator.CreateInstance(dropdownType);
|
var dropdown = (Drawable)Activator.CreateInstance(dropdownType);
|
||||||
|
|
||||||
dropdownType.GetProperty(nameof(SettingsDropdown<object>.LabelText))?.SetValue(dropdown, attr.Label);
|
dropdownType.GetProperty(nameof(SettingsDropdown<object>.LabelText))?.SetValue(dropdown, attr.Label);
|
||||||
dropdownType.GetProperty(nameof(SettingsDropdown<object>.Bindable))?.SetValue(dropdown, bindable);
|
dropdownType.GetProperty(nameof(SettingsDropdown<object>.Current))?.SetValue(dropdown, bindable);
|
||||||
|
|
||||||
yield return dropdown;
|
yield return dropdown;
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
|||||||
|
|
||||||
updateItems();
|
updateItems();
|
||||||
|
|
||||||
dropdown.Bindable = audio.AudioDevice;
|
dropdown.Current = audio.AudioDevice;
|
||||||
|
|
||||||
audio.OnNewDevice += onDeviceChanged;
|
audio.OnNewDevice += onDeviceChanged;
|
||||||
audio.OnLostDevice += onDeviceChanged;
|
audio.OnLostDevice += onDeviceChanged;
|
||||||
|
@ -21,23 +21,23 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
|||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Interface voices",
|
LabelText = "Interface voices",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.MenuVoice)
|
Current = config.GetBindable<bool>(OsuSetting.MenuVoice)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "osu! music theme",
|
LabelText = "osu! music theme",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.MenuMusic)
|
Current = config.GetBindable<bool>(OsuSetting.MenuMusic)
|
||||||
},
|
},
|
||||||
new SettingsDropdown<IntroSequence>
|
new SettingsDropdown<IntroSequence>
|
||||||
{
|
{
|
||||||
LabelText = "Intro sequence",
|
LabelText = "Intro sequence",
|
||||||
Bindable = config.GetBindable<IntroSequence>(OsuSetting.IntroSequence),
|
Current = config.GetBindable<IntroSequence>(OsuSetting.IntroSequence),
|
||||||
Items = Enum.GetValues(typeof(IntroSequence)).Cast<IntroSequence>()
|
Items = Enum.GetValues(typeof(IntroSequence)).Cast<IntroSequence>()
|
||||||
},
|
},
|
||||||
new SettingsDropdown<BackgroundSource>
|
new SettingsDropdown<BackgroundSource>
|
||||||
{
|
{
|
||||||
LabelText = "Background source",
|
LabelText = "Background source",
|
||||||
Bindable = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource),
|
Current = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource),
|
||||||
Items = Enum.GetValues(typeof(BackgroundSource)).Cast<BackgroundSource>()
|
Items = Enum.GetValues(typeof(BackgroundSource)).Cast<BackgroundSource>()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
|||||||
new SettingsSlider<double, OffsetSlider>
|
new SettingsSlider<double, OffsetSlider>
|
||||||
{
|
{
|
||||||
LabelText = "Audio offset",
|
LabelText = "Audio offset",
|
||||||
Bindable = config.GetBindable<double>(OsuSetting.AudioOffset),
|
Current = config.GetBindable<double>(OsuSetting.AudioOffset),
|
||||||
KeyboardStep = 1f
|
KeyboardStep = 1f
|
||||||
},
|
},
|
||||||
new SettingsButton
|
new SettingsButton
|
||||||
|
@ -20,28 +20,28 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
|||||||
new SettingsSlider<double>
|
new SettingsSlider<double>
|
||||||
{
|
{
|
||||||
LabelText = "Master",
|
LabelText = "Master",
|
||||||
Bindable = audio.Volume,
|
Current = audio.Volume,
|
||||||
KeyboardStep = 0.01f,
|
KeyboardStep = 0.01f,
|
||||||
DisplayAsPercentage = true
|
DisplayAsPercentage = true
|
||||||
},
|
},
|
||||||
new SettingsSlider<double>
|
new SettingsSlider<double>
|
||||||
{
|
{
|
||||||
LabelText = "Master (window inactive)",
|
LabelText = "Master (window inactive)",
|
||||||
Bindable = config.GetBindable<double>(OsuSetting.VolumeInactive),
|
Current = config.GetBindable<double>(OsuSetting.VolumeInactive),
|
||||||
KeyboardStep = 0.01f,
|
KeyboardStep = 0.01f,
|
||||||
DisplayAsPercentage = true
|
DisplayAsPercentage = true
|
||||||
},
|
},
|
||||||
new SettingsSlider<double>
|
new SettingsSlider<double>
|
||||||
{
|
{
|
||||||
LabelText = "Effect",
|
LabelText = "Effect",
|
||||||
Bindable = audio.VolumeSample,
|
Current = audio.VolumeSample,
|
||||||
KeyboardStep = 0.01f,
|
KeyboardStep = 0.01f,
|
||||||
DisplayAsPercentage = true
|
DisplayAsPercentage = true
|
||||||
},
|
},
|
||||||
new SettingsSlider<double>
|
new SettingsSlider<double>
|
||||||
{
|
{
|
||||||
LabelText = "Music",
|
LabelText = "Music",
|
||||||
Bindable = audio.VolumeTrack,
|
Current = audio.VolumeTrack,
|
||||||
KeyboardStep = 0.01f,
|
KeyboardStep = 0.01f,
|
||||||
DisplayAsPercentage = true
|
DisplayAsPercentage = true
|
||||||
},
|
},
|
||||||
|
@ -19,12 +19,12 @@ namespace osu.Game.Overlays.Settings.Sections.Debug
|
|||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Show log overlay",
|
LabelText = "Show log overlay",
|
||||||
Bindable = frameworkConfig.GetBindable<bool>(FrameworkSetting.ShowLogOverlay)
|
Current = frameworkConfig.GetBindable<bool>(FrameworkSetting.ShowLogOverlay)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Bypass front-to-back render pass",
|
LabelText = "Bypass front-to-back render pass",
|
||||||
Bindable = config.GetBindable<bool>(DebugSetting.BypassFrontToBackPass)
|
Current = config.GetBindable<bool>(DebugSetting.BypassFrontToBackPass)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -21,62 +21,62 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
|||||||
new SettingsSlider<double>
|
new SettingsSlider<double>
|
||||||
{
|
{
|
||||||
LabelText = "Background dim",
|
LabelText = "Background dim",
|
||||||
Bindable = config.GetBindable<double>(OsuSetting.DimLevel),
|
Current = config.GetBindable<double>(OsuSetting.DimLevel),
|
||||||
KeyboardStep = 0.01f,
|
KeyboardStep = 0.01f,
|
||||||
DisplayAsPercentage = true
|
DisplayAsPercentage = true
|
||||||
},
|
},
|
||||||
new SettingsSlider<double>
|
new SettingsSlider<double>
|
||||||
{
|
{
|
||||||
LabelText = "Background blur",
|
LabelText = "Background blur",
|
||||||
Bindable = config.GetBindable<double>(OsuSetting.BlurLevel),
|
Current = config.GetBindable<double>(OsuSetting.BlurLevel),
|
||||||
KeyboardStep = 0.01f,
|
KeyboardStep = 0.01f,
|
||||||
DisplayAsPercentage = true
|
DisplayAsPercentage = true
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Lighten playfield during breaks",
|
LabelText = "Lighten playfield during breaks",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.LightenDuringBreaks)
|
Current = config.GetBindable<bool>(OsuSetting.LightenDuringBreaks)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Show score overlay",
|
LabelText = "Show score overlay",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.ShowInterface)
|
Current = config.GetBindable<bool>(OsuSetting.ShowInterface)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Show difficulty graph on progress bar",
|
LabelText = "Show difficulty graph on progress bar",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.ShowProgressGraph)
|
Current = config.GetBindable<bool>(OsuSetting.ShowProgressGraph)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Show health display even when you can't fail",
|
LabelText = "Show health display even when you can't fail",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.ShowHealthDisplayWhenCantFail),
|
Current = config.GetBindable<bool>(OsuSetting.ShowHealthDisplayWhenCantFail),
|
||||||
Keywords = new[] { "hp", "bar" }
|
Keywords = new[] { "hp", "bar" }
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Fade playfield to red when health is low",
|
LabelText = "Fade playfield to red when health is low",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.FadePlayfieldWhenHealthLow),
|
Current = config.GetBindable<bool>(OsuSetting.FadePlayfieldWhenHealthLow),
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Always show key overlay",
|
LabelText = "Always show key overlay",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.KeyOverlay)
|
Current = config.GetBindable<bool>(OsuSetting.KeyOverlay)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Positional hitsounds",
|
LabelText = "Positional hitsounds",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.PositionalHitSounds)
|
Current = config.GetBindable<bool>(OsuSetting.PositionalHitSounds)
|
||||||
},
|
},
|
||||||
new SettingsEnumDropdown<ScoreMeterType>
|
new SettingsEnumDropdown<ScoreMeterType>
|
||||||
{
|
{
|
||||||
LabelText = "Score meter type",
|
LabelText = "Score meter type",
|
||||||
Bindable = config.GetBindable<ScoreMeterType>(OsuSetting.ScoreMeter)
|
Current = config.GetBindable<ScoreMeterType>(OsuSetting.ScoreMeter)
|
||||||
},
|
},
|
||||||
new SettingsEnumDropdown<ScoringMode>
|
new SettingsEnumDropdown<ScoringMode>
|
||||||
{
|
{
|
||||||
LabelText = "Score display mode",
|
LabelText = "Score display mode",
|
||||||
Bindable = config.GetBindable<ScoringMode>(OsuSetting.ScoreDisplayMode)
|
Current = config.GetBindable<ScoringMode>(OsuSetting.ScoreDisplayMode)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
|||||||
Add(new SettingsCheckbox
|
Add(new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Disable Windows key during gameplay",
|
LabelText = "Disable Windows key during gameplay",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.GameplayDisableWinKey)
|
Current = config.GetBindable<bool>(OsuSetting.GameplayDisableWinKey)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
|||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Increase visibility of first object when visual impairment mods are enabled",
|
LabelText = "Increase visibility of first object when visual impairment mods are enabled",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.IncreaseFirstObjectVisibility),
|
Current = config.GetBindable<bool>(OsuSetting.IncreaseFirstObjectVisibility),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -31,31 +31,31 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
|||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Right mouse drag to absolute scroll",
|
LabelText = "Right mouse drag to absolute scroll",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.SongSelectRightMouseScroll),
|
Current = config.GetBindable<bool>(OsuSetting.SongSelectRightMouseScroll),
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Show converted beatmaps",
|
LabelText = "Show converted beatmaps",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps),
|
Current = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps),
|
||||||
},
|
},
|
||||||
new SettingsSlider<double, StarsSlider>
|
new SettingsSlider<double, StarsSlider>
|
||||||
{
|
{
|
||||||
LabelText = "Display beatmaps from",
|
LabelText = "Display beatmaps from",
|
||||||
Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMinimum),
|
Current = config.GetBindable<double>(OsuSetting.DisplayStarsMinimum),
|
||||||
KeyboardStep = 0.1f,
|
KeyboardStep = 0.1f,
|
||||||
Keywords = new[] { "minimum", "maximum", "star", "difficulty" }
|
Keywords = new[] { "minimum", "maximum", "star", "difficulty" }
|
||||||
},
|
},
|
||||||
new SettingsSlider<double, MaximumStarsSlider>
|
new SettingsSlider<double, MaximumStarsSlider>
|
||||||
{
|
{
|
||||||
LabelText = "up to",
|
LabelText = "up to",
|
||||||
Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMaximum),
|
Current = config.GetBindable<double>(OsuSetting.DisplayStarsMaximum),
|
||||||
KeyboardStep = 0.1f,
|
KeyboardStep = 0.1f,
|
||||||
Keywords = new[] { "minimum", "maximum", "star", "difficulty" }
|
Keywords = new[] { "minimum", "maximum", "star", "difficulty" }
|
||||||
},
|
},
|
||||||
new SettingsEnumDropdown<RandomSelectAlgorithm>
|
new SettingsEnumDropdown<RandomSelectAlgorithm>
|
||||||
{
|
{
|
||||||
LabelText = "Random selection algorithm",
|
LabelText = "Random selection algorithm",
|
||||||
Bindable = config.GetBindable<RandomSelectAlgorithm>(OsuSetting.RandomSelectAlgorithm),
|
Current = config.GetBindable<RandomSelectAlgorithm>(OsuSetting.RandomSelectAlgorithm),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Prefer metadata in original language",
|
LabelText = "Prefer metadata in original language",
|
||||||
Bindable = frameworkConfig.GetBindable<bool>(FrameworkSetting.ShowUnicode)
|
Current = frameworkConfig.GetBindable<bool>(FrameworkSetting.ShowUnicode)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -240,12 +240,12 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Remember username",
|
LabelText = "Remember username",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.SaveUsername),
|
Current = config.GetBindable<bool>(OsuSetting.SaveUsername),
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Stay signed in",
|
LabelText = "Stay signed in",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.SavePassword),
|
Current = config.GetBindable<bool>(OsuSetting.SavePassword),
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
Add(new SettingsEnumDropdown<ReleaseStream>
|
Add(new SettingsEnumDropdown<ReleaseStream>
|
||||||
{
|
{
|
||||||
LabelText = "Release stream",
|
LabelText = "Release stream",
|
||||||
Bindable = config.GetBindable<ReleaseStream>(OsuSetting.ReleaseStream),
|
Current = config.GetBindable<ReleaseStream>(OsuSetting.ReleaseStream),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (updateManager?.CanCheckForUpdate == true)
|
if (updateManager?.CanCheckForUpdate == true)
|
||||||
|
@ -19,22 +19,22 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Storyboard / Video",
|
LabelText = "Storyboard / Video",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.ShowStoryboard)
|
Current = config.GetBindable<bool>(OsuSetting.ShowStoryboard)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Hit Lighting",
|
LabelText = "Hit Lighting",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.HitLighting)
|
Current = config.GetBindable<bool>(OsuSetting.HitLighting)
|
||||||
},
|
},
|
||||||
new SettingsEnumDropdown<ScreenshotFormat>
|
new SettingsEnumDropdown<ScreenshotFormat>
|
||||||
{
|
{
|
||||||
LabelText = "Screenshot format",
|
LabelText = "Screenshot format",
|
||||||
Bindable = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat)
|
Current = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Show menu cursor in screenshots",
|
LabelText = "Show menu cursor in screenshots",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.ScreenshotCaptureMenuCursor)
|
Current = config.GetBindable<bool>(OsuSetting.ScreenshotCaptureMenuCursor)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
windowModeDropdown = new SettingsDropdown<WindowMode>
|
windowModeDropdown = new SettingsDropdown<WindowMode>
|
||||||
{
|
{
|
||||||
LabelText = "Screen mode",
|
LabelText = "Screen mode",
|
||||||
Bindable = config.GetBindable<WindowMode>(FrameworkSetting.WindowMode),
|
Current = config.GetBindable<WindowMode>(FrameworkSetting.WindowMode),
|
||||||
ItemSource = windowModes,
|
ItemSource = windowModes,
|
||||||
},
|
},
|
||||||
resolutionSettingsContainer = new Container
|
resolutionSettingsContainer = new Container
|
||||||
@ -74,14 +74,14 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
{
|
{
|
||||||
LabelText = "UI Scaling",
|
LabelText = "UI Scaling",
|
||||||
TransferValueOnCommit = true,
|
TransferValueOnCommit = true,
|
||||||
Bindable = osuConfig.GetBindable<float>(OsuSetting.UIScale),
|
Current = osuConfig.GetBindable<float>(OsuSetting.UIScale),
|
||||||
KeyboardStep = 0.01f,
|
KeyboardStep = 0.01f,
|
||||||
Keywords = new[] { "scale", "letterbox" },
|
Keywords = new[] { "scale", "letterbox" },
|
||||||
},
|
},
|
||||||
new SettingsEnumDropdown<ScalingMode>
|
new SettingsEnumDropdown<ScalingMode>
|
||||||
{
|
{
|
||||||
LabelText = "Screen Scaling",
|
LabelText = "Screen Scaling",
|
||||||
Bindable = osuConfig.GetBindable<ScalingMode>(OsuSetting.Scaling),
|
Current = osuConfig.GetBindable<ScalingMode>(OsuSetting.Scaling),
|
||||||
Keywords = new[] { "scale", "letterbox" },
|
Keywords = new[] { "scale", "letterbox" },
|
||||||
},
|
},
|
||||||
scalingSettings = new FillFlowContainer<SettingsSlider<float>>
|
scalingSettings = new FillFlowContainer<SettingsSlider<float>>
|
||||||
@ -97,28 +97,28 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
new SettingsSlider<float>
|
new SettingsSlider<float>
|
||||||
{
|
{
|
||||||
LabelText = "Horizontal position",
|
LabelText = "Horizontal position",
|
||||||
Bindable = scalingPositionX,
|
Current = scalingPositionX,
|
||||||
KeyboardStep = 0.01f,
|
KeyboardStep = 0.01f,
|
||||||
DisplayAsPercentage = true
|
DisplayAsPercentage = true
|
||||||
},
|
},
|
||||||
new SettingsSlider<float>
|
new SettingsSlider<float>
|
||||||
{
|
{
|
||||||
LabelText = "Vertical position",
|
LabelText = "Vertical position",
|
||||||
Bindable = scalingPositionY,
|
Current = scalingPositionY,
|
||||||
KeyboardStep = 0.01f,
|
KeyboardStep = 0.01f,
|
||||||
DisplayAsPercentage = true
|
DisplayAsPercentage = true
|
||||||
},
|
},
|
||||||
new SettingsSlider<float>
|
new SettingsSlider<float>
|
||||||
{
|
{
|
||||||
LabelText = "Horizontal scale",
|
LabelText = "Horizontal scale",
|
||||||
Bindable = scalingSizeX,
|
Current = scalingSizeX,
|
||||||
KeyboardStep = 0.01f,
|
KeyboardStep = 0.01f,
|
||||||
DisplayAsPercentage = true
|
DisplayAsPercentage = true
|
||||||
},
|
},
|
||||||
new SettingsSlider<float>
|
new SettingsSlider<float>
|
||||||
{
|
{
|
||||||
LabelText = "Vertical scale",
|
LabelText = "Vertical scale",
|
||||||
Bindable = scalingSizeY,
|
Current = scalingSizeY,
|
||||||
KeyboardStep = 0.01f,
|
KeyboardStep = 0.01f,
|
||||||
DisplayAsPercentage = true
|
DisplayAsPercentage = true
|
||||||
},
|
},
|
||||||
@ -126,7 +126,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
scalingSettings.ForEach(s => bindPreviewEvent(s.Bindable));
|
scalingSettings.ForEach(s => bindPreviewEvent(s.Current));
|
||||||
|
|
||||||
var resolutions = getResolutions();
|
var resolutions = getResolutions();
|
||||||
|
|
||||||
@ -137,10 +137,10 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
LabelText = "Resolution",
|
LabelText = "Resolution",
|
||||||
ShowsDefaultIndicator = false,
|
ShowsDefaultIndicator = false,
|
||||||
Items = resolutions,
|
Items = resolutions,
|
||||||
Bindable = sizeFullscreen
|
Current = sizeFullscreen
|
||||||
};
|
};
|
||||||
|
|
||||||
windowModeDropdown.Bindable.BindValueChanged(mode =>
|
windowModeDropdown.Current.BindValueChanged(mode =>
|
||||||
{
|
{
|
||||||
if (mode.NewValue == WindowMode.Fullscreen)
|
if (mode.NewValue == WindowMode.Fullscreen)
|
||||||
{
|
{
|
||||||
|
@ -23,17 +23,17 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
new SettingsEnumDropdown<FrameSync>
|
new SettingsEnumDropdown<FrameSync>
|
||||||
{
|
{
|
||||||
LabelText = "Frame limiter",
|
LabelText = "Frame limiter",
|
||||||
Bindable = config.GetBindable<FrameSync>(FrameworkSetting.FrameSync)
|
Current = config.GetBindable<FrameSync>(FrameworkSetting.FrameSync)
|
||||||
},
|
},
|
||||||
new SettingsEnumDropdown<ExecutionMode>
|
new SettingsEnumDropdown<ExecutionMode>
|
||||||
{
|
{
|
||||||
LabelText = "Threading mode",
|
LabelText = "Threading mode",
|
||||||
Bindable = config.GetBindable<ExecutionMode>(FrameworkSetting.ExecutionMode)
|
Current = config.GetBindable<ExecutionMode>(FrameworkSetting.ExecutionMode)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Show FPS",
|
LabelText = "Show FPS",
|
||||||
Bindable = osuConfig.GetBindable<bool>(OsuSetting.ShowFpsDisplay)
|
Current = osuConfig.GetBindable<bool>(OsuSetting.ShowFpsDisplay)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -20,17 +20,17 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Rotate cursor when dragging",
|
LabelText = "Rotate cursor when dragging",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.CursorRotation)
|
Current = config.GetBindable<bool>(OsuSetting.CursorRotation)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Parallax",
|
LabelText = "Parallax",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.MenuParallax)
|
Current = config.GetBindable<bool>(OsuSetting.MenuParallax)
|
||||||
},
|
},
|
||||||
new SettingsSlider<float, TimeSlider>
|
new SettingsSlider<float, TimeSlider>
|
||||||
{
|
{
|
||||||
LabelText = "Hold-to-confirm activation time",
|
LabelText = "Hold-to-confirm activation time",
|
||||||
Bindable = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay),
|
Current = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay),
|
||||||
KeyboardStep = 50
|
KeyboardStep = 50
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -35,32 +35,32 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Raw input",
|
LabelText = "Raw input",
|
||||||
Bindable = rawInputToggle
|
Current = rawInputToggle
|
||||||
},
|
},
|
||||||
new SensitivitySetting
|
new SensitivitySetting
|
||||||
{
|
{
|
||||||
LabelText = "Cursor sensitivity",
|
LabelText = "Cursor sensitivity",
|
||||||
Bindable = sensitivityBindable
|
Current = sensitivityBindable
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Map absolute input to window",
|
LabelText = "Map absolute input to window",
|
||||||
Bindable = config.GetBindable<bool>(FrameworkSetting.MapAbsoluteInputToWindow)
|
Current = config.GetBindable<bool>(FrameworkSetting.MapAbsoluteInputToWindow)
|
||||||
},
|
},
|
||||||
new SettingsEnumDropdown<ConfineMouseMode>
|
new SettingsEnumDropdown<ConfineMouseMode>
|
||||||
{
|
{
|
||||||
LabelText = "Confine mouse cursor to window",
|
LabelText = "Confine mouse cursor to window",
|
||||||
Bindable = config.GetBindable<ConfineMouseMode>(FrameworkSetting.ConfineMouseMode),
|
Current = config.GetBindable<ConfineMouseMode>(FrameworkSetting.ConfineMouseMode),
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Disable mouse wheel during gameplay",
|
LabelText = "Disable mouse wheel during gameplay",
|
||||||
Bindable = osuConfig.GetBindable<bool>(OsuSetting.MouseDisableWheel)
|
Current = osuConfig.GetBindable<bool>(OsuSetting.MouseDisableWheel)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Disable mouse buttons during gameplay",
|
LabelText = "Disable mouse buttons during gameplay",
|
||||||
Bindable = osuConfig.GetBindable<bool>(OsuSetting.MouseDisableButtons)
|
Current = osuConfig.GetBindable<bool>(OsuSetting.MouseDisableButtons)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,13 +19,13 @@ namespace osu.Game.Overlays.Settings.Sections.Online
|
|||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Warn about opening external links",
|
LabelText = "Warn about opening external links",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.ExternalLinkWarning)
|
Current = config.GetBindable<bool>(OsuSetting.ExternalLinkWarning)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Prefer downloads without video",
|
LabelText = "Prefer downloads without video",
|
||||||
Keywords = new[] { "no-video" },
|
Keywords = new[] { "no-video" },
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.PreferNoVideo)
|
Current = config.GetBindable<bool>(OsuSetting.PreferNoVideo)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -47,29 +47,29 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
new SettingsSlider<float, SizeSlider>
|
new SettingsSlider<float, SizeSlider>
|
||||||
{
|
{
|
||||||
LabelText = "Menu cursor size",
|
LabelText = "Menu cursor size",
|
||||||
Bindable = config.GetBindable<float>(OsuSetting.MenuCursorSize),
|
Current = config.GetBindable<float>(OsuSetting.MenuCursorSize),
|
||||||
KeyboardStep = 0.01f
|
KeyboardStep = 0.01f
|
||||||
},
|
},
|
||||||
new SettingsSlider<float, SizeSlider>
|
new SettingsSlider<float, SizeSlider>
|
||||||
{
|
{
|
||||||
LabelText = "Gameplay cursor size",
|
LabelText = "Gameplay cursor size",
|
||||||
Bindable = config.GetBindable<float>(OsuSetting.GameplayCursorSize),
|
Current = config.GetBindable<float>(OsuSetting.GameplayCursorSize),
|
||||||
KeyboardStep = 0.01f
|
KeyboardStep = 0.01f
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Adjust gameplay cursor size based on current beatmap",
|
LabelText = "Adjust gameplay cursor size based on current beatmap",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.AutoCursorSize)
|
Current = config.GetBindable<bool>(OsuSetting.AutoCursorSize)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Beatmap skins",
|
LabelText = "Beatmap skins",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.BeatmapSkins)
|
Current = config.GetBindable<bool>(OsuSetting.BeatmapSkins)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Beatmap hitsounds",
|
LabelText = "Beatmap hitsounds",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds)
|
Current = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
|
|
||||||
config.BindWith(OsuSetting.Skin, configBindable);
|
config.BindWith(OsuSetting.Skin, configBindable);
|
||||||
|
|
||||||
skinDropdown.Bindable = dropdownBindable;
|
skinDropdown.Current = dropdownBindable;
|
||||||
skinDropdown.Items = skins.GetAllUsableSkins().ToArray();
|
skinDropdown.Items = skins.GetAllUsableSkins().ToArray();
|
||||||
|
|
||||||
// Todo: This should not be necessary when OsuConfigManager is databased
|
// Todo: This should not be necessary when OsuConfigManager is databased
|
||||||
|
@ -21,7 +21,7 @@ using osuTK;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.Settings
|
namespace osu.Game.Overlays.Settings
|
||||||
{
|
{
|
||||||
public abstract class SettingsItem<T> : Container, IFilterable, ISettingsItem
|
public abstract class SettingsItem<T> : Container, IFilterable, ISettingsItem, IHasCurrentValue<T>
|
||||||
{
|
{
|
||||||
protected abstract Drawable CreateControl();
|
protected abstract Drawable CreateControl();
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual Bindable<T> Bindable
|
public virtual Bindable<T> Current
|
||||||
{
|
{
|
||||||
get => controlWithCurrent.Current;
|
get => controlWithCurrent.Current;
|
||||||
set => controlWithCurrent.Current = value;
|
set => controlWithCurrent.Current = value;
|
||||||
|
@ -11,7 +11,7 @@ using osu.Game.Overlays.Settings;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Timing
|
namespace osu.Game.Screens.Edit.Timing
|
||||||
{
|
{
|
||||||
internal class SliderWithTextBoxInput<T> : CompositeDrawable, IHasCurrentValue<T>
|
public class SliderWithTextBoxInput<T> : CompositeDrawable, IHasCurrentValue<T>
|
||||||
where T : struct, IEquatable<T>, IComparable<T>, IConvertible
|
where T : struct, IEquatable<T>, IComparable<T>, IConvertible
|
||||||
{
|
{
|
||||||
private readonly SettingsSlider<T> slider;
|
private readonly SettingsSlider<T> slider;
|
||||||
@ -51,7 +51,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
slider.Bindable.Parse(t.Text);
|
slider.Current.Parse(t.Text);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@ -71,8 +71,8 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
public Bindable<T> Current
|
public Bindable<T> Current
|
||||||
{
|
{
|
||||||
get => slider.Bindable;
|
get => slider.Current;
|
||||||
set => slider.Bindable = value;
|
set => slider.Current = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,14 +36,14 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
{
|
{
|
||||||
if (point.NewValue != null)
|
if (point.NewValue != null)
|
||||||
{
|
{
|
||||||
bpmSlider.Bindable = point.NewValue.BeatLengthBindable;
|
bpmSlider.Current = point.NewValue.BeatLengthBindable;
|
||||||
bpmSlider.Bindable.BindValueChanged(_ => ChangeHandler?.SaveState());
|
bpmSlider.Current.BindValueChanged(_ => ChangeHandler?.SaveState());
|
||||||
|
|
||||||
bpmTextEntry.Bindable = point.NewValue.BeatLengthBindable;
|
bpmTextEntry.Bindable = point.NewValue.BeatLengthBindable;
|
||||||
// no need to hook change handler here as it's the same bindable as above
|
// no need to hook change handler here as it's the same bindable as above
|
||||||
|
|
||||||
timeSignature.Bindable = point.NewValue.TimeSignatureBindable;
|
timeSignature.Current = point.NewValue.TimeSignatureBindable;
|
||||||
timeSignature.Bindable.BindValueChanged(_ => ChangeHandler?.SaveState());
|
timeSignature.Current.BindValueChanged(_ => ChangeHandler?.SaveState());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,14 +121,14 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
beatLengthBindable.BindValueChanged(beatLength => updateCurrent(beatLengthToBpm(beatLength.NewValue)), true);
|
beatLengthBindable.BindValueChanged(beatLength => updateCurrent(beatLengthToBpm(beatLength.NewValue)), true);
|
||||||
bpmBindable.BindValueChanged(bpm => beatLengthBindable.Value = beatLengthToBpm(bpm.NewValue));
|
bpmBindable.BindValueChanged(bpm => beatLengthBindable.Value = beatLengthToBpm(bpm.NewValue));
|
||||||
|
|
||||||
base.Bindable = bpmBindable;
|
base.Current = bpmBindable;
|
||||||
|
|
||||||
TransferValueOnCommit = true;
|
TransferValueOnCommit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Bindable<double> Bindable
|
public override Bindable<double> Current
|
||||||
{
|
{
|
||||||
get => base.Bindable;
|
get => base.Current;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
// incoming will be beat length, not bpm
|
// incoming will be beat length, not bpm
|
||||||
|
@ -51,14 +51,14 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
rateSlider = new PlayerSliderBar<double> { Bindable = UserPlaybackRate }
|
rateSlider = new PlayerSliderBar<double> { Current = UserPlaybackRate }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
rateSlider.Bindable.BindValueChanged(multiplier => multiplierText.Text = $"{multiplier.NewValue:0.0}x", true);
|
rateSlider.Current.BindValueChanged(multiplier => multiplierText.Text = $"{multiplier.NewValue:0.0}x", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,8 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
dimSliderBar.Bindable = config.GetBindable<double>(OsuSetting.DimLevel);
|
dimSliderBar.Current = config.GetBindable<double>(OsuSetting.DimLevel);
|
||||||
blurSliderBar.Bindable = config.GetBindable<double>(OsuSetting.BlurLevel);
|
blurSliderBar.Current = config.GetBindable<double>(OsuSetting.BlurLevel);
|
||||||
showStoryboardToggle.Current = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
showStoryboardToggle.Current = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
||||||
beatmapSkinsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
|
beatmapSkinsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
|
||||||
beatmapHitsoundsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
|
beatmapHitsoundsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
|
||||||
|
Loading…
Reference in New Issue
Block a user