mirror of
https://github.com/ppy/osu
synced 2025-01-05 21:59:46 +00: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);
|
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]
|
[Test]
|
||||||
@ -160,7 +160,7 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
|
|
||||||
AddUntilStep("restore button hidden", () => settingsKeyBindingRow.ChildrenOfType<RestoreDefaultValueButton<bool>>().First().Alpha == 0);
|
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]
|
[Test]
|
||||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
|
|
||||||
Add(new ResetButton
|
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 object key;
|
||||||
private readonly ICollection<Input.Bindings.DatabasedKeyBinding> bindings;
|
private readonly ICollection<Input.Bindings.DatabasedKeyBinding> bindings;
|
||||||
public readonly KeyBindingRow BasicKeyBindingRow;
|
public readonly KeyBindingRow KeyBindingRow;
|
||||||
|
|
||||||
private bool matchingFilter;
|
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 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.key = key;
|
||||||
this.bindings = bindings;
|
this.bindings = bindings;
|
||||||
|
|
||||||
@ -44,15 +45,15 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
{
|
{
|
||||||
new RestoreDefaultValueButton<bool>()
|
new RestoreDefaultValueButton<bool>()
|
||||||
{
|
{
|
||||||
Current = BasicKeyBindingRow.IsDefault,
|
Current = KeyBindingRow.IsDefault,
|
||||||
Action = () => { BasicKeyBindingRow.RestoreDefaults(); }
|
Action = () => { KeyBindingRow.RestoreDefaults(); }
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Padding = new MarginPadding { Left = SettingsPanel.CONTENT_MARGINS },
|
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,
|
AllowMainMouseButtons = ruleset != null,
|
||||||
Defaults = defaults
|
Defaults = defaults
|
||||||
|
Loading…
Reference in New Issue
Block a user