mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 11:42:56 +08:00
Formatting, renaming
This commit is contained in:
parent
d9f5b578bf
commit
d5feb8353d
@ -131,7 +131,7 @@ namespace osu.Game.Tests.Visual.Settings
|
||||
|
||||
AddUntilStep("restore button hidden", () => settingsKeyBindingRow.ChildrenOfType<RestoreDefaultValueButton<bool>>().First().Alpha == 0);
|
||||
|
||||
AddAssert("binding cleared", () => settingsKeyBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().ElementAt(0).KeyBinding.KeyCombination.Equals(settingsKeyBindingRow.BasicKeyBindingRow.Defaults.ElementAt(0)));
|
||||
AddAssert("binding cleared", () => settingsKeyBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().ElementAt(0).KeyBinding.KeyCombination.Equals(settingsKeyBindingRow.KeyBindingRow.Defaults.ElementAt(0)));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -160,7 +160,7 @@ namespace osu.Game.Tests.Visual.Settings
|
||||
|
||||
AddUntilStep("restore button hidden", () => settingsKeyBindingRow.ChildrenOfType<RestoreDefaultValueButton<bool>>().First().Alpha == 0);
|
||||
|
||||
AddAssert("binding cleared", () => settingsKeyBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().ElementAt(0).KeyBinding.KeyCombination.Equals(settingsKeyBindingRow.BasicKeyBindingRow.Defaults.ElementAt(0)));
|
||||
AddAssert("binding cleared", () => settingsKeyBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().ElementAt(0).KeyBinding.KeyCombination.Equals(settingsKeyBindingRow.KeyBindingRow.Defaults.ElementAt(0)));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Overlays.KeyBinding
|
||||
|
||||
Add(new ResetButton
|
||||
{
|
||||
Action = () => Children.OfType<RestorableKeyBindingRow>().ForEach(k => k.BasicKeyBindingRow.RestoreDefaults())
|
||||
Action = () => Children.OfType<RestorableKeyBindingRow>().ForEach(k => k.KeyBindingRow.RestoreDefaults())
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ namespace osu.Game.Overlays.KeyBinding
|
||||
{
|
||||
private readonly object key;
|
||||
private readonly ICollection<Input.Bindings.DatabasedKeyBinding> bindings;
|
||||
public readonly KeyBindingRow BasicKeyBindingRow;
|
||||
public readonly KeyBindingRow KeyBindingRow;
|
||||
|
||||
private bool matchingFilter;
|
||||
|
||||
@ -32,7 +32,8 @@ namespace osu.Game.Overlays.KeyBinding
|
||||
|
||||
public IEnumerable<string> FilterTerms => bindings.Select(b => b.KeyCombination.ReadableString()).Prepend(key.ToString());
|
||||
|
||||
public RestorableKeyBindingRow(object key, ICollection<Input.Bindings.DatabasedKeyBinding> bindings, RulesetInfo ruleset, IEnumerable<KeyCombination> defaults) {
|
||||
public RestorableKeyBindingRow(object key, ICollection<Input.Bindings.DatabasedKeyBinding> bindings, RulesetInfo ruleset, IEnumerable<KeyCombination> defaults)
|
||||
{
|
||||
this.key = key;
|
||||
this.bindings = bindings;
|
||||
|
||||
@ -44,15 +45,15 @@ namespace osu.Game.Overlays.KeyBinding
|
||||
{
|
||||
new RestoreDefaultValueButton<bool>()
|
||||
{
|
||||
Current = BasicKeyBindingRow.IsDefault,
|
||||
Action = () => { BasicKeyBindingRow.RestoreDefaults(); }
|
||||
Current = KeyBindingRow.IsDefault,
|
||||
Action = () => { KeyBindingRow.RestoreDefaults(); }
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Padding = new MarginPadding { Left = SettingsPanel.CONTENT_MARGINS },
|
||||
Child = BasicKeyBindingRow = new KeyBindingRow(key, bindings.Where(b => ((int)b.Action).Equals((int)key)))
|
||||
Child = KeyBindingRow = new KeyBindingRow(key, bindings.Where(b => ((int)b.Action).Equals((int)key)))
|
||||
{
|
||||
AllowMainMouseButtons = ruleset != null,
|
||||
Defaults = defaults
|
||||
|
Loading…
Reference in New Issue
Block a user