mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 11:02:54 +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)
|
public bool OnPressed(KeyBindingPressEvent<TaikoAction> e)
|
||||||
{
|
{
|
||||||
if (e.Action == TaikoAction.LeftRim)
|
switch (e.Action)
|
||||||
{
|
{
|
||||||
leftRimSampleTriggerSource.Play(HitType.Rim);
|
case TaikoAction.LeftRim:
|
||||||
}
|
leftRimSampleTriggerSource.Play(HitType.Rim);
|
||||||
else if (e.Action == TaikoAction.LeftCentre)
|
break;
|
||||||
{
|
case TaikoAction.LeftCentre:
|
||||||
leftCentreSampleTriggerSource.Play(HitType.Centre);
|
leftCentreSampleTriggerSource.Play(HitType.Centre);
|
||||||
}
|
break;
|
||||||
else if (e.Action == TaikoAction.RightCentre)
|
case TaikoAction.RightCentre:
|
||||||
{
|
rightCentreSampleTriggerSource.Play(HitType.Centre);
|
||||||
rightCentreSampleTriggerSource.Play(HitType.Centre);
|
break;
|
||||||
}
|
case TaikoAction.RightRim:
|
||||||
else if (e.Action == TaikoAction.RightRim)
|
rightRimSampleTriggerSource.Play(HitType.Rim);
|
||||||
{
|
break;
|
||||||
rightRimSampleTriggerSource.Play(HitType.Rim);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
public class DrumTouchInputArea : Container
|
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)
|
// 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 InputDrum touchInputDrum;
|
||||||
private Circle drumBackground;
|
private Circle drumBackground;
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
{
|
{
|
||||||
Padding = new MarginPadding {
|
Padding = new MarginPadding {
|
||||||
Top = TaikoPlayfield.DEFAULT_HEIGHT * 2f, // Visual elements should start right below the playfield
|
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