Skip to content

Commit

Permalink
Give second hard beat button a unique action
Browse files Browse the repository at this point in the history
  • Loading branch information
LumpBloom7 committed May 14, 2021
1 parent 084ede8 commit 857e076
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Tau/Mods/TauModRelax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private void addAction(bool hitting, bool hardhit = false)
{
if (hardhit)
{
state.PressedActions.Add(TauAction.HardButton);
state.PressedActions.Add(TauAction.HardButton1);
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Tau/Objects/Drawables/DrawableHardBeat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public class DrawableHardBeat : DrawableTauHitObject, IKeyBindingHandler<TauActi
{
protected override TauAction[] HitActions { get; set; } = new[]
{
TauAction.HardButton
TauAction.HardButton1,
TauAction.HardButton2
};

public SkinnableDrawable Circle;
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Tau/Replays/TauAutoGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public override Replay Generate()
break;

case HardBeat _:
Replay.Frames.Add(new TauReplayFrame(h.StartTime, ((TauReplayFrame)Replay.Frames.Last()).Position, TauAction.HardButton));
Replay.Frames.Add(new TauReplayFrame(h.StartTime, ((TauReplayFrame)Replay.Frames.Last()).Position, TauAction.HardButton1));
Replay.Frames.Add(new TauReplayFrame(h.StartTime + releaseDelay, ((TauReplayFrame)Replay.Frames.Last()).Position));
lastTime = h.GetEndTime() + releaseDelay;

Expand Down
6 changes: 4 additions & 2 deletions osu.Game.Rulesets.Tau/Replays/TauReplayFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public void FromLegacy(LegacyReplayFrame currentFrame, IBeatmap beatmap, ReplayF

if (currentFrame.MouseLeft1) Actions.Add(TauAction.LeftButton);
if (currentFrame.MouseRight1) Actions.Add(TauAction.RightButton);
if (currentFrame.MouseLeft2) Actions.Add(TauAction.HardButton);
if (currentFrame.MouseLeft2) Actions.Add(TauAction.HardButton1);
if (currentFrame.MouseRight2) Actions.Add(TauAction.HardButton2);
}

public LegacyReplayFrame ToLegacy(IBeatmap beatmap)
Expand All @@ -38,7 +39,8 @@ public LegacyReplayFrame ToLegacy(IBeatmap beatmap)

if (Actions.Contains(TauAction.LeftButton)) state |= ReplayButtonState.Left1;
if (Actions.Contains(TauAction.RightButton)) state |= ReplayButtonState.Right1;
if (Actions.Contains(TauAction.HardButton)) state |= ReplayButtonState.Left2;
if (Actions.Contains(TauAction.HardButton1)) state |= ReplayButtonState.Left2;
if (Actions.Contains(TauAction.HardButton2)) state |= ReplayButtonState.Right2;

return new LegacyReplayFrame(Time, Position.X, Position.Y, state);
}
Expand Down
9 changes: 6 additions & 3 deletions osu.Game.Rulesets.Tau/TauInputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected override KeyBindingContainer<TauAction> CreateKeyBindingContainer(Rule
=> new TauKeyBindingContainer(ruleset, variant, unique);

public TauInputManager(RulesetInfo ruleset)
: base(ruleset, 0, SimultaneousBindingMode.All)
: base(ruleset, 0, SimultaneousBindingMode.Unique)
{
}

Expand Down Expand Up @@ -62,7 +62,10 @@ public enum TauAction
[Description("Right tick button")]
RightButton,

[Description("Hard beat button")]
HardButton
[Description("Hard beat button 1")]
HardButton1,

[Description("Hard beat button 2")]
HardButton2,
}
}
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Tau/TauRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0) =
new KeyBinding(InputKey.X, TauAction.RightButton),
new KeyBinding(InputKey.MouseLeft, TauAction.LeftButton),
new KeyBinding(InputKey.MouseRight, TauAction.RightButton),
new KeyBinding(InputKey.Space, TauAction.HardButton),
new KeyBinding(InputKey.LShift, TauAction.HardButton),
new KeyBinding(InputKey.Space, TauAction.HardButton1),
new KeyBinding(InputKey.LShift, TauAction.HardButton2),
};

public override StatisticRow[] CreateStatisticsForScore(ScoreInfo score, IBeatmap playableBeatmap) => new[]
Expand Down

0 comments on commit 857e076

Please sign in to comment.