1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-09 02:24:10 +08:00

Addressed code formatting issues

This commit is contained in:
OpenSauce04 2023-01-12 19:04:37 +00:00
parent 92def3daf4
commit 25a920732f
2 changed files with 16 additions and 8 deletions

View File

@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
{ {
private DrumTouchInputArea drumTouchInputArea = null!; private DrumTouchInputArea drumTouchInputArea = null!;
private void createDrum(TaikoTouchControlScheme _forcedControlScheme) private void createDrum(TaikoTouchControlScheme forcedControlScheme)
{ {
Child = new TaikoInputManager(new TaikoRuleset().RulesetInfo) Child = new TaikoInputManager(new TaikoRuleset().RulesetInfo)
{ {
@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
{ {
Anchor = Anchor.BottomCentre, Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre, Origin = Anchor.BottomCentre,
ForceControlScheme = _forcedControlScheme ForceControlScheme = forcedControlScheme
} }
} }
}; };

View File

@ -25,6 +25,7 @@ namespace osu.Game.Rulesets.Taiko.UI
public partial class DrumTouchInputArea : VisibilityContainer public partial class DrumTouchInputArea : VisibilityContainer
{ {
public TaikoTouchControlScheme? ForceControlScheme { get; set; } public TaikoTouchControlScheme? ForceControlScheme { get; set; }
// visibility state affects our child. we always want to handle input. // visibility state affects our child. we always want to handle input.
public override bool PropagatePositionalInputSubTree => true; public override bool PropagatePositionalInputSubTree => true;
public override bool PropagateNonPositionalInputSubTree => true; public override bool PropagateNonPositionalInputSubTree => true;
@ -62,10 +63,12 @@ namespace osu.Game.Rulesets.Taiko.UI
var taikoAction = getTaikoActionFromDrumSegment(drumSegment); var taikoAction = getTaikoActionFromDrumSegment(drumSegment);
return new DrumSegmentProperties(taikoAction, getColourFromTaikoAction(taikoAction)); return new DrumSegmentProperties(taikoAction, getColourFromTaikoAction(taikoAction));
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(TaikoInputManager taikoInputManager, TaikoRulesetConfigManager config) private void load(TaikoInputManager taikoInputManager, TaikoRulesetConfigManager config)
{ {
Debug.Assert(taikoInputManager.KeyBindingContainer != null); Debug.Assert(taikoInputManager.KeyBindingContainer != null);
keyBindingContainer = taikoInputManager.KeyBindingContainer; keyBindingContainer = taikoInputManager.KeyBindingContainer;
// Container should handle input everywhere. // Container should handle input everywhere.
@ -187,14 +190,14 @@ namespace osu.Game.Rulesets.Taiko.UI
{ {
Show(); Show();
TaikoAction TaikoAction = getTaikoActionFromPosition(position); TaikoAction taikoAction = getTaikoActionFromPosition(position);
// Not too sure how this can happen, but let's avoid throwing. // Not too sure how this can happen, but let's avoid throwing.
if (trackedActions.ContainsKey(source)) if (trackedActions.ContainsKey(source))
return; return;
trackedActions.Add(source, TaikoAction); trackedActions.Add(source, taikoAction);
keyBindingContainer.TriggerPressed(TaikoAction); keyBindingContainer.TriggerPressed(taikoAction);
} }
private void handleUp(object source) private void handleUp(object source)
@ -236,20 +239,25 @@ namespace osu.Game.Rulesets.Taiko.UI
{ {
case TaikoAction.LeftRim: case TaikoAction.LeftRim:
case TaikoAction.RightRim: case TaikoAction.RightRim:
return colours.Blue; return colours.Blue;
case TaikoAction.LeftCentre: case TaikoAction.LeftCentre:
case TaikoAction.RightCentre: case TaikoAction.RightCentre:
return colours.Red; return colours.Red;
} }
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
} }
private partial class DrumSegment : CompositeDrawable, IKeyBindingHandler<TaikoAction> private partial class DrumSegment : CompositeDrawable, IKeyBindingHandler<TaikoAction>
{ {
private TaikoAction handledAction; private TaikoAction handledAction;
private Circle overlay; private readonly Circle overlay;
private Circle circle; private readonly Circle circle;
public override bool Contains(Vector2 screenSpacePos) => circle.Contains(screenSpacePos); public override bool Contains(Vector2 screenSpacePos) => circle.Contains(screenSpacePos);