Skip to content

Commit

Permalink
Added saturation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcos-diaz committed Feb 11, 2025
1 parent e908088 commit aa1c94f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
15 changes: 14 additions & 1 deletion src/components/profile/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,19 @@ <h2>{{getSectionTitle()}}</h2>
<option [value]='ThumbstickDistanceMode.RADIAL'>Radial</option>
</select>
</div>
<div class='block' *ngIf='thumbstick.mode==ThumbstickMode.DIR4 || thumbstick.mode==ThumbstickMode.DIR8'>
<div class='subtitle'>Saturation:</div>
<div class='island'>
<app-input-number
[value]='thumbstick.saturation'
(update)='thumbstick.saturation=$event; save()'
[unit]="'%'"
[min]='1'
[max]='100'
[step]='1'
/>
</div>
</div>
<div class='block' *ngIf='thumbstick.mode == ThumbstickMode.DIR4'>
<div class='subtitle'>Axis overlap:</div>
<div class='island'>
Expand Down Expand Up @@ -222,7 +235,7 @@ <h2>{{getSectionTitle()}}</h2>
/>
</div>
</div>
<div class='block' *ngIf='thumbstick.mode==ThumbstickMode.DIR4 || thumbstick.mode==ThumbstickMode.DIR8'>
<div class='block' *ngIf='thumbstick.mode==ThumbstickMode.DIR4'>
<div class='subtitle'>Anti-deadzone:</div>
<div class='island'>
<app-input-number
Expand Down
5 changes: 4 additions & 1 deletion src/lib/ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ export class CtrlThumbstick extends CtrlSection {
public overlap : number,
public deadzone_override: boolean,
public antideadzone: number,
public saturation: number,
) {
super(1, DeviceId.ALPAKKA, MessageType.SECTION_SHARE)
}
Expand All @@ -575,7 +576,8 @@ export class CtrlThumbstick extends CtrlSection {
data[8], // Deadzone.
data[9] <= 128 ? data[9] : data[9]-256, // Axis overlap (unsigned to signed).
Boolean(data[10]), // Deadzone override.
data[11], // Antideadzone.
data[11], // Antideadzone.
data[12], // Saturation.
)
}

Expand All @@ -589,6 +591,7 @@ export class CtrlThumbstick extends CtrlSection {
this.overlap,
Number(this.deadzone_override),
this.antideadzone,
this.saturation,
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class Profile {
public buttonR2: CtrlButton = new CtrlButton(0, 0, 0),
public buttonR4: CtrlButton = new CtrlButton(0, 0, 0),
// Left stick.
public settingsLStick: CtrlThumbstick = new CtrlThumbstick(0, 0, 0, 0, 0, 0, false, 0),
public settingsLStick: CtrlThumbstick = new CtrlThumbstick(0, 0, 0, 0, 0, 0, false, 0, 0),
public buttonLStickLeft: CtrlButton = new CtrlButton(0, 0, 0),
public buttonLStickRight: CtrlButton = new CtrlButton(0, 0, 0),
public buttonLStickUp: CtrlButton = new CtrlButton(0, 0, 0),
Expand All @@ -43,7 +43,7 @@ export class Profile {
public buttonLStickInner: CtrlButton = new CtrlButton(0, 0, 0),
public buttonLStickOuter: CtrlButton = new CtrlButton(0, 0, 0),
// Right stick (stick or dhat).
public settingsRStick: CtrlThumbstick = new CtrlThumbstick(0, 0, 0, 0, 0, 0, false, 0),
public settingsRStick: CtrlThumbstick = new CtrlThumbstick(0, 0, 0, 0, 0, 0, false, 0, 0),
public buttonRStickLeft: CtrlButton = new CtrlButton(0, 0, 0),
public buttonRStickRight: CtrlButton = new CtrlButton(0, 0, 0),
public buttonRStickUp: CtrlButton = new CtrlButton(0, 0, 0),
Expand Down

0 comments on commit aa1c94f

Please sign in to comment.