Skip to content

Commit

Permalink
Correct display names for PS4/5 guitars
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNathannator committed May 9, 2024
1 parent 135b3fb commit b3c2ce0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ internal struct PSRiffmasterGuitarLayout : IInputStateTypeInfo
{
public FourCC format => TranslatedRiffmasterGuitarState.Format;

[InputControl(name = "startButton", layout = "Button", bit = (int)TranslatedRiffmasterGuitarButton.Start, displayName = "Options")]
[InputControl(name = "selectButton", layout = "Button", bit = (int)TranslatedRiffmasterGuitarButton.Select, displayName = "Share")]
[InputControl(name = "systemButton", layout = "Button", bit = (int)TranslatedRiffmasterGuitarButton.System, displayName = "PlayStation")]
public TranslatedRiffmasterGuitarState state;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ internal unsafe struct PS3WiiRockBandGuitarState_ReportId : IRockBandGuitarState
}

[StructLayout(LayoutKind.Sequential, Pack = 1)]
internal struct PSRockBandGuitarLayout : IInputStateTypeInfo
internal struct PS3RockBandGuitarLayout : IInputStateTypeInfo
{
public FourCC format => TranslatedRockBandGuitarState.Format;

[InputControl(name = "systemButton", layout = "Button", bit = (int)TranslatedRockBandGuitarButton.System, displayName = "PlayStation")]
public TranslatedRockBandGuitarState state;
}

[InputControlLayout(stateType = typeof(PSRockBandGuitarLayout), displayName = "PlayStation 3 Rock Band Guitar")]
[InputControlLayout(stateType = typeof(PS3RockBandGuitarLayout), displayName = "PlayStation 3 Rock Band Guitar")]
internal class PS3RockBandGuitar : TranslatingRockBandGuitar_Flags_NullState<PS3WiiRockBandGuitarState_NoReportId>
{
internal new static void Initialize()
Expand All @@ -167,6 +167,6 @@ internal class PS3RockBandGuitar : TranslatingRockBandGuitar_Flags_NullState<PS3
}
}

[InputControlLayout(stateType = typeof(PSRockBandGuitarLayout), displayName = "PlayStation 3 Rock Band Guitar", hideInUI = true)]
[InputControlLayout(stateType = typeof(PS3RockBandGuitarLayout), displayName = "PlayStation 3 Rock Band Guitar", hideInUI = true)]
internal class PS3RockBandGuitar_ReportId : TranslatingRockBandGuitar_Flags_NullState<PS3WiiRockBandGuitarState_ReportId> { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using PlasticBand.Devices.LowLevel;
using PlasticBand.LowLevel;
using UnityEngine.InputSystem.Layouts;
using UnityEngine.InputSystem.LowLevel;
using UnityEngine.InputSystem.Utilities;

// PlasticBand reference doc:
Expand Down Expand Up @@ -195,10 +196,21 @@ internal unsafe struct PS4RockBandGuitarState_ReportId : IRockBandGuitarState_Di
public int pickupSwitch { get => state.pickupSwitch; set => state.pickupSwitch = (byte)value; }
}

[InputControlLayout(stateType = typeof(PSRockBandGuitarLayout), displayName = "PlayStation 4 Rock Band Guitar", hideInUI = true)]
[StructLayout(LayoutKind.Sequential, Pack = 1)]
internal struct PS4RockBandGuitarLayout : IInputStateTypeInfo
{
public FourCC format => TranslatedRockBandGuitarState.Format;

[InputControl(name = "startButton", layout = "Button", bit = (int)TranslatedRockBandGuitarButton.Start, displayName = "Options")]
[InputControl(name = "selectButton", layout = "Button", bit = (int)TranslatedRockBandGuitarButton.Select, displayName = "Share")]
[InputControl(name = "systemButton", layout = "Button", bit = (int)TranslatedRockBandGuitarButton.System, displayName = "PlayStation")]
public TranslatedRockBandGuitarState state;
}

[InputControlLayout(stateType = typeof(PS4RockBandGuitarLayout), displayName = "PlayStation 4 Rock Band Guitar", hideInUI = true)]
internal class PS4RockBandGuitar_NoReportId : TranslatingRockBandGuitar_Distinct<PS4RockBandGuitarState_NoReportId> { }

[InputControlLayout(stateType = typeof(PSRockBandGuitarLayout), displayName = "PlayStation 4 Rock Band Guitar")]
[InputControlLayout(stateType = typeof(PS4RockBandGuitarLayout), displayName = "PlayStation 4 Rock Band Guitar")]
internal class PS4RockBandGuitar : TranslatingRockBandGuitar_Distinct<PS4RockBandGuitarState_ReportId>
{
internal new static void Initialize()
Expand Down

0 comments on commit b3c2ce0

Please sign in to comment.