Skip to content

Commit

Permalink
I'm bad at syncing branches (#31)
Browse files Browse the repository at this point in the history
* Some fixes (#29)

* Mapeadas flechas del teclado y añadida pulsacion del gatillo en modo serie 

-Se han mapeado las flechas del teclado y se han asignado al Dpad mientras la pistola está en modo Ratón+Teclado

-Se ha añadido el botón "trigger" en modo mando mientras está activa la comunicación serie (mamehook) ya que anteriormente si se activaba la comunicación serie mientras la pistola estaba en modo "mando" dejaba de funcionar el gatillo

* Algunas correcciones de como se muestra la vida (barra de vida) en la pantalla oled

-Ahora calcula el porcentaje de "vida" y lo muestra correctamente.
-Cambiado el tipo de variable usada para leer la "vida" de uint8_t cuyo valor máximo es 255 a uint16_t para mostrar correctamente la "vida en juegos que usen un valor mayor como Aliens Armageddon que usa de valor máximo 1000

* Reset SamcoEnhanced.ino

Reset file to begin PR

* Fix trigger in Gamepad mode + Serial

-Added trigger button to work when serial comunication is enabled and gun is in Gamepad mode

* Fix for life% shown in lifebar

- Fix for life% shown in lifebar
- Changed "serialLifeCount" from uint8_t to uint16_t, for handle life values higher than  255

* Translated some variable to maintain language consistency

- Translated some variable to maintain language consistency

* Consistency, slight cleanup

* Bump Arduino-cli

* Forgot this one.

---------

Co-authored-by: kikexx <[email protected]>
  • Loading branch information
SeongGino and kikexx authored Sep 27, 2024
1 parent 4ee6153 commit 68e1b1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/arduino-cli-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
submodules: true

- name: Install Arduino-cli
uses: arduino/setup-arduino-cli@v1
uses: arduino/setup-arduino-cli@v2

# arduino nano uses this just to access LEDs, grr...
- name: Install Arduino Nano Connect library
Expand Down
20 changes: 7 additions & 13 deletions SamcoEnhanced/SamcoEnhanced.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3789,12 +3789,12 @@ void TriggerFireSimple()
if(!buttonPressed && // Have we not fired the last cycle,
offscreenButtonSerial && buttons.offScreen) { // and are pointing the gun off screen WITH the offScreen button mode set?
if(buttons.analogOutput) { Gamepad16.press(LightgunButtons::ButtonDesc[BtnIdx_A].reportCode3); }
else { AbsMouse5.press(MOUSE_RIGHT); }
else { AbsMouse5.press(MOUSE_RIGHT); }
offscreenBShot = true; // Mark we pressed the right button via offscreen shot mode,
buttonPressed = true; // Mark so we're not spamming these press events.
} else if(!buttonPressed) { // Else, have we simply not fired the last cycle?
if(buttons.analogOutput) { Gamepad16.press(LightgunButtons::ButtonDesc[BtnIdx_Trigger].reportCode3); }
else { AbsMouse5.press(MOUSE_LEFT); }
if(buttons.analogOutput) { Gamepad16.press(LightgunButtons::ButtonDesc[BtnIdx_Trigger].reportCode3); }
else { AbsMouse5.press(MOUSE_LEFT); }
buttonPressed = true; // Set this so we won't spam a repeat press event again.
}
}
Expand All @@ -3804,18 +3804,12 @@ void TriggerNotFireSimple()
{
if(buttonPressed) { // Just to make sure we aren't spamming mouse button events.
if(offscreenBShot) { // if it was marked as an offscreen button shot,
if(buttons.analogOutput) { //Check if gamepad mode is enabled
Gamepad16.release(LightgunButtons::ButtonDesc[BtnIdx_A].reportCode3); //If gamepad mode is enabled release A Button
} else {
AbsMouse5.release(MOUSE_RIGHT); // Release the right mouse,
}
if(buttons.analogOutput) { Gamepad16.release(LightgunButtons::ButtonDesc[BtnIdx_A].reportCode3); }
else { AbsMouse5.release(MOUSE_RIGHT); }
offscreenBShot = false; // And set it off.
} else { // Else,
if(buttons.analogOutput) { //Check if gamepad mode is enabled
Gamepad16.release(LightgunButtons::ButtonDesc[BtnIdx_Trigger].reportCode3); // If gamepad mode is enabled release the Trigger button
} else {
AbsMouse5.release(MOUSE_LEFT); // It was a normal shot, so just release the left mouse button.
}
if(buttons.analogOutput) { Gamepad16.release(LightgunButtons::ButtonDesc[BtnIdx_Trigger].reportCode3); }
else { AbsMouse5.release(MOUSE_LEFT); }
}
buttonPressed = false; // Unset the button pressed bit.
}
Expand Down

0 comments on commit 68e1b1d

Please sign in to comment.