mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 21:03:21 +08:00
osu!Taiko touch implementation code cleanup
This commit is contained in:
parent
0f83308f7b
commit
1ed06f30e7
@ -28,21 +28,20 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
|
||||
public bool OnPressed(KeyBindingPressEvent<TaikoAction> e)
|
||||
{
|
||||
if (e.Action == TaikoAction.LeftRim)
|
||||
switch (e.Action)
|
||||
{
|
||||
leftRimSampleTriggerSource.Play(HitType.Rim);
|
||||
}
|
||||
else if (e.Action == TaikoAction.LeftCentre)
|
||||
{
|
||||
leftCentreSampleTriggerSource.Play(HitType.Centre);
|
||||
}
|
||||
else if (e.Action == TaikoAction.RightCentre)
|
||||
{
|
||||
rightCentreSampleTriggerSource.Play(HitType.Centre);
|
||||
}
|
||||
else if (e.Action == TaikoAction.RightRim)
|
||||
{
|
||||
rightRimSampleTriggerSource.Play(HitType.Rim);
|
||||
case TaikoAction.LeftRim:
|
||||
leftRimSampleTriggerSource.Play(HitType.Rim);
|
||||
break;
|
||||
case TaikoAction.LeftCentre:
|
||||
leftCentreSampleTriggerSource.Play(HitType.Centre);
|
||||
break;
|
||||
case TaikoAction.RightCentre:
|
||||
rightCentreSampleTriggerSource.Play(HitType.Centre);
|
||||
break;
|
||||
case TaikoAction.RightRim:
|
||||
rightRimSampleTriggerSource.Play(HitType.Rim);
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
public class DrumTouchInputArea : Container
|
||||
{
|
||||
// The percent of the drum that extends past the bottom of the screen (set to 0.0f to show the full drum)
|
||||
private const float overhangPercent = 0.35f;
|
||||
private const float offscreenPercent = 0.35f;
|
||||
private InputDrum touchInputDrum;
|
||||
private Circle drumBackground;
|
||||
|
||||
@ -68,7 +68,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
{
|
||||
Padding = new MarginPadding {
|
||||
Top = TaikoPlayfield.DEFAULT_HEIGHT * 2f, // Visual elements should start right below the playfield
|
||||
Bottom = -touchInputDrum.DrawHeight * overhangPercent, // The drum should go past the bottom of the screen so that it can be wider
|
||||
Bottom = -touchInputDrum.DrawHeight * offscreenPercent, // The drum should go past the bottom of the screen so that it can be wider
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user