Skip to content

Commit

Permalink
Merge pull request #26 from Touille/beta
Browse files Browse the repository at this point in the history
2.2.03.3b
  • Loading branch information
Touille authored Feb 3, 2017
2 parents fb1f21c + e6b91bc commit d9535a4
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 73 deletions.
55 changes: 29 additions & 26 deletions Thrustmaster Warthog Script/ED+HCS v2.2_Functions_CORE.tmh
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,23 @@
if(y == SYS){
if (x == ENG){if(vOptimalPIP != 1){vOptimalPIP = 1; vPIP=!vPIP;}} //4 ENG 2 SYS (1)
else if(x == WEP){if(vOptimalPIP != 6){vOptimalPIP = 6; vPIP=!vPIP;}} //4 WEP 2 SYS (6)
}else if(y == ENG){
}
else if(y == ENG){
if (x == SYS){if(vOptimalPIP != 3){vOptimalPIP = 3; vPIP=!vPIP;}} //4 SYS 2 ENG (3)
else if(x == WEP){if(vOptimalPIP != 5){vOptimalPIP = 5; vPIP=!vPIP;}} //4 WEP 2 ENG (5)
}else if(y == WEP){
}
else if(y == WEP){
if (x == SYS){if(vOptimalPIP != 4){vOptimalPIP = 4; vPIP=!vPIP;}} //4 SYS 2 WEP (4)
else if(x == ENG){if(vOptimalPIP != 2){vOptimalPIP = 2; vPIP=!vPIP;}} //4 ENG 2 WEP (2)
}
}else if(y == 0){
}
else if(y == 0){
if (x == SYS){if(vOptimalPIP != 10){vOptimalPIP = 10; vPIP=!vPIP;}} //4 SYS 1 ENG 1 WEP (10)
else if(x == ENG){if(vOptimalPIP != 11){vOptimalPIP = 11; vPIP=!vPIP;}} //4 ENG 1 SYS 1 WEP (11)
else if(x == WEP){if(vOptimalPIP != 12){vOptimalPIP = 12; vPIP=!vPIP;}} //4 WEP 1 SYS 1 ENG (12)
}
}else if(z == MID){
}
else if(z == MID){
if (y == SYS & x == ENG | y == ENG & x == SYS){if(vOptimalPIP != 7){vOptimalPIP = 7; vPIP=!vPIP;}} //3 SYS 3 ENG (7)
else if(y == ENG & x == WEP | y == WEP & x == ENG){if(vOptimalPIP != 8){vOptimalPIP = 8; vPIP=!vPIP;}} //3 ENG 3 WEP (8)
else if(y == SYS | x == WEP | y == WEP | x == SYS){if(vOptimalPIP != 9){vOptimalPIP = 9; vPIP=!vPIP;}} //3 SYS 3 WEP (9)
Expand Down Expand Up @@ -81,7 +85,8 @@
//With Lock
ActKey(KEYON+ CHAIN(LOCK+PULSE+ BalancePower, D(PIPPulseDelay),PIPx, D(PIPPulseDelay),PIPy, D(PIPPulseDelay),PIPx, D(PIPPulseDelay),PIPx, D(PIPPulseDelay),PIPz, LOCK));

}else{
}
else{
//if(DebugMode) printf("This PIP is Already Pushed [%d]\x0a", vOptimalPIP);
}
}
Expand All @@ -104,7 +109,8 @@
else if(j == 10)initPIPPower(SYS); //4 SYS 1 ENG 1 WEP (10)
else if(j == 11)initPIPPower(ENG); //4 ENG 1 SYS 1 WEP (11)
else if(j == 12)initPIPPower(WEP); //4 WEP 1 SYS 1 ENG (12)
}else{
}
else{
//if(DebugMode) printf("This PIP is Already OK [%d]\x0a", vOptimalPIP);
}
}
Expand Down Expand Up @@ -177,10 +183,8 @@
if(sExplorerMode & (ExploreModeFire == 0 | ExploreModeFire == 2)){
DeferCall(TG1ScanDelay, &ActKey, KEYON+UP+PrimaryFire);
//if(DebugMode) printf("TG1 Up ExplorerMode\x0a");
}else{
ActKey(KEYON+UP+PrimaryFire);
//if(DebugMode) printf("TG1 Up\x0a");
}
else{ActKey(KEYON+UP+PrimaryFire);} //if(DebugMode) printf("TG1 Up\x0a");
vPrimaryFire=!vPrimaryFire;
}
}
Expand All @@ -196,10 +200,8 @@
if(sExplorerMode & (ExploreModeFire == 1 | ExploreModeFire == 2)){
DeferCall(S2ScanDelay, &ActKey, KEYON+UP+SecondaryFire);
//if(DebugMode) printf("S2 Up ExplorerMode\x0a");
}else{
ActKey(KEYON+UP+SecondaryFire);
//if(DebugMode) printf("S2 Up\x0a");
}
else{ActKey(KEYON+UP+SecondaryFire);} //if(DebugMode) printf("S2 Up\x0a");
vSecondaryFire=!vSecondaryFire;
}
}
Expand All @@ -210,7 +212,7 @@
int initJettisonCargo(){
if(Throttle[APUON]){
if(sCargo){ActKey(KEYON+PULSE+JettisonAllCargo);if(DebugMode | DebugMMode) printf("Jettison All Cargo\x0a");}
else {if(DebugMode | DebugMMode) printf("Jettison Need Cargo Scoop Open\x0a");}
else { if(DebugMode | DebugMMode) printf("Jettison Need Cargo Scoop Open\x0a");}
}
}

Expand Down Expand Up @@ -254,7 +256,8 @@
initSecureRectract();
ActKey(KEYON+PULSE+Supercruise);
if(DebugMode | DebugMMode) printf("SuperCruise On Throttle Engaged\x0a");
}else{
}
else{
ActKey(KEYON+PULSE+EngineBoost);
if(DebugMode | DebugMMode) printf("Engine Boost\x0a");
}
Expand All @@ -279,7 +282,7 @@
DeferCall(11000, &ActKey, KEYON+PULSE+EXEC("initBACKLIGHT(Throttle_BL, vThrottleLightBackup, 250);")); //Throttle BackLigtt Flashing OFF, we need to Send it again to toggle the flag and stop the flashing
//END OF TEST
if(!SecureRetract){ //if SecureRetract is Disable
if(DebugMode | DebugMMode) printf("Secure Retract was OFF we switch it to ON for 2 sec for Escaping Fight\x0a");
if(DebugMode | DebugMMode){printf("Secure Retract was OFF we switch it to ON for 2 sec for Escaping Fight\x0a");}
SecureRetract=!SecureRetract; //we Enable it
DeferCall(2000, &ActKey, KEYON+PULSE+EXEC("SecureRetract=!SecureRetract;")); //Then we Disable it after the initSecureRectract() below is done (2s should be ok)
}
Expand Down Expand Up @@ -332,36 +335,36 @@

//FUNCTION: Capture Video
int initCaptureVideo(){
if (GFXVideo == 1){ //Nvidia Shadowplay
if(GFXVideo == 1){ //Nvidia Shadowplay
sNVidiaCaptureVideo=!sNVidiaCaptureVideo;
ActKey(KEYON+PULSE+NVidiaCaptureVideo);
initLED(NVidiaCaptureVideo_LED, sNVidiaCaptureVideo, 500);
if(DebugMode | DebugMMode)printf("NVidia ShadowPlay Capture Video [%d]\x0a", sNVidiaCaptureVideo);
}else if (GFXVideo == 2){ //AMD Relive
}
else if(GFXVideo == 2){ //AMD Relive
sAMDCaptureVideo=!sAMDCaptureVideo;
ActKey(KEYON+PULSE+AMDCaptureVideo);
initLED(AMDCaptureVideo_LED, sAMDCaptureVideo, 500);
if(DebugMode | DebugMMode)printf("AMD Relive Capture Video [%d]\x0a", sAMDCaptureVideo);
}else{ //None
if(DebugMode | DebugMMode)printf("No Software selected for Capture Video\x0a");
}
else { if(DebugMode | DebugMMode)printf("No Software selected for Capture Video\x0a");} //None
}

//FUNCTION: Streaming Video
int initStreamingVideo(){
if (GFXVideo == 1){ //Nvidia Shadowplay
if(GFXVideo == 1){ //Nvidia Shadowplay
sNVidiaStreaming=!sNVidiaStreaming;
ActKey(KEYON+PULSE+NVidiaStreaming);
initLED(NVidiaStreaming_LED, sNVidiaStreaming, 250);
if(DebugMode | DebugMMode)printf("NVidia ShadowPlay Streaming [%d]\x0a", sNVidiaStreaming);
}else if (GFXVideo == 2){ //AMD Relive
}
else if(GFXVideo == 2){ //AMD Relive
sAMDStreaming=!sAMDStreaming;
ActKey(KEYON+PULSE+AMDStreaming);
initLED(AMDStreaming_LED, sAMDStreaming, 250);
if(DebugMode | DebugMMode)printf("AMD Relive Streaming [%d]\x0a", sAMDStreaming);
}else{ //None
if(DebugMode | DebugMMode)printf("No Software selected for Streaming\x0a");
}
else { if(DebugMode | DebugMMode)printf("No Software selected for Streaming\x0a");} //None
}

//FUNCTION: Screenshot
Expand All @@ -374,7 +377,8 @@
ActKey(KEYON+PULSE+Screenshot);
if(DebugMode | DebugMMode)printf("Screenshot\x0a");
//}
}else{
}
else{
ActKey(KEYON+PULSE+TakeSteamScreenshot);
if(DebugMode | DebugMMode)printf("Steam Screenshot\x0a");
}
Expand All @@ -390,9 +394,8 @@
vVoice=!vVoice;
ActKey(KEYON+PULSE+vPTT);
if(DebugMode) printf("Mic Toggle [%d] [Actived[1] DesActived[0] / PTT [%d] [External:[0]Internal:[1]] / Mode [%d] [HOLD:[0] TOGGLE:[1]]\x0a", vVoicePTT, sPTTState, sPTTMode);
}else{ //Talk [HOLD]
ActKey(KEYON+DOWN+vPTT);
}
else{ActKey(KEYON+DOWN+vPTT);} //Talk [HOLD]
}
if(!Throttle[MSP] & !sPTTMode){ //Silence [HOLD]
vVoicePTT=!vVoicePTT;
Expand Down
28 changes: 17 additions & 11 deletions Thrustmaster Warthog Script/ED+HCS v2.2_Functions_HARDWARE.tmh
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@
else if(t!= 0 & ms !=0){ //LED Selected in Settings file & Delay, Flashing LED
if(v == 1){ //OFF or ON? If ON Flash LED
if (ms < 250) {ms = 250;}else if(ms > 2000){ms = 2000;} //Flashing btw 250ms & 2000ms (2sec)
if (t == LED1) {flagHoverLED1=!flagHoverLED1; flashing_T_LED1(ms);}
else if(t == LED2) {flagHoverLED2=!flagHoverLED2; flashing_T_LED2(ms);}
else if(t == LED3) {flagHoverLED3=!flagHoverLED3; flashing_T_LED3(ms);}
else if(t == LED4) {flagHoverLED4=!flagHoverLED4; flashing_T_LED4(ms);}
else if(t == LED5) {flagHoverLED5=!flagHoverLED5; flashing_T_LED5(ms);}
if (t == LED1) {flagHover_T_LED1=!flagHover_T_LED1; flashing_T_LED1(ms);}
else if(t == LED2) {flagHover_T_LED2=!flagHover_T_LED2; flashing_T_LED2(ms);}
else if(t == LED3) {flagHover_T_LED3=!flagHover_T_LED3; flashing_T_LED3(ms);}
else if(t == LED4) {flagHover_T_LED4=!flagHover_T_LED4; flashing_T_LED4(ms);}
else if(t == LED5) {flagHover_T_LED5=!flagHover_T_LED5; flashing_T_LED5(ms);}
else if(t == RMFD_LED1){flagHover_RMFD_LED1=!flagHover_RMFD_LED1;flashing_RMFD_LED1(ms);}
else if(t == RMFD_LED2){flagHover_RMFD_LED2=!flagHover_RMFD_LED2;flashing_RMFD_LED2(ms);}
else if(t == LMFD_LED1){flagHover_LMFD_LED1=!flagHover_LMFD_LED1;flashing_LMFD_LED1(ms);}
Expand Down Expand Up @@ -174,7 +174,8 @@
DeferCall(ms*6 , &ActKey, KEYON+PULSE+LED(&Throttle, LED_ONOFF, LED_CURRENT^LED5));
//if(DebugMode){printf("PANIC LED\x0a");}
DeferCall(ms*11, &init_PANIC_LED, ms);
}else{PANIC_LED = 6;}
}
else{PANIC_LED = 6;}
}

// -------------------------BACKLIGHT FUNCTIONS
Expand Down Expand Up @@ -215,22 +216,25 @@
//FUNCTIONS: Flashing Throttle BackLight
int flashing_T_BL(int ms = 0){ //Throttle BackLight
if(flagHover_T_BL > 0){GameOutput(&Throttle, OUT_ID_LED_BACKLIGHT, 2);DeferCall(ms, &flashing_T_BL, ms); //Falshing Throttle BackLight
}else{
}
else{
if(vThrottleLightBackup != 0)GameOutput(&Throttle, OUT_ID_LED_BACKLIGHT, 1); //Throttle BackLight was ON
else GameOutput(&Throttle, OUT_ID_LED_BACKLIGHT, 0); //Throttle BackLight wasOFF
}
}
//FUNCTIONS: Flashing MFD BackLight
int flashing_RMFD_BL(int ms = 0){ //RMFD BackLight
if(flagHover_RMFD_BL > 0){GameOutput(&RMFD, OUT_ID_LED_BACKLIGHT, 2);DeferCall(ms, &flashing_RMFD_BL, ms); //Falshing RMFD BackLight
}else{
}
else{
if(vRMFDLightBackup != 0)GameOutput(&RMFD, OUT_ID_LED_BACKLIGHT, 1); //RMFD BackLight was ON
else GameOutput(&RMFD, OUT_ID_LED_BACKLIGHT, 0); //RMFD BackLight was OFF
}
}
int flashing_LMFD_BL(int ms = 0){ //LMFD BackLight
if(flagHover_LMFD_BL > 0){GameOutput(&LMFD, OUT_ID_LED_BACKLIGHT, 2);DeferCall(ms, &flashing_LMFD_BL, ms); //Falshing LMFD BackLight
}else{
}
else{
if(vLMFDLightBackup != 0)GameOutput(&LMFD, OUT_ID_LED_BACKLIGHT, 1); //LMFD BackLight was ON
else GameOutput(&LMFD, OUT_ID_LED_BACKLIGHT, 0); //LMFD BackLight was OFF
}
Expand Down Expand Up @@ -274,7 +278,8 @@
if (DebugMode){
if(CenterJoystickMount & JoystickAngle != 0){
printf("Set Joystick Curve Profile [%d]: Curve = [%d], Zoom = [%d]+Zsc[%f]\x0a", vJoystickCurveProfile, JS_CURVE[vJoystickCurveProfile], JS_ZOOM[vJoystickCurveProfile], Zsc);
}else{
}
else{
printf("Set Joystick Curve Profile [%d]: Curve = [%d], Zoom = [%d]\x0a", vJoystickCurveProfile, JS_CURVE[vJoystickCurveProfile], JS_ZOOM[vJoystickCurveProfile]);
}
printf("Set Slew Curve Profile [%d]: Curve = [%d], Zoom = [%d]\x0a", vJoystickCurveProfile, SL_CURVE[vJoystickCurveProfile], SL_ZOOM[vJoystickCurveProfile]);
Expand Down Expand Up @@ -305,7 +310,8 @@
if(vThrottleCurveProfile){
if(!AfterburnerDetent)SetJCurve(&Throttle, THR_RIGHT, 50, 50); //Without Warthog Physical Afterburner Detent
else SetJCurve(&Throttle, THR_RIGHT, 65, 95); //Or With Detent. At 65% of the physical controller�s axis travel, the DirectX axis must have reached 95% of the axis value.
}else{
}
else{
if(ThrottleAxisRange)SetSCurve(&Throttle, THR_RIGHT, 0, 0, 0, 2, -3); //Full Range Precision
else SetSCurve(&Throttle, THR_RIGHT, 0, 0, 0, 3, -3); //Forward only Precision
}
Expand Down
Loading

0 comments on commit d9535a4

Please sign in to comment.