Skip to content

Commit

Permalink
Updated to v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
harryxue1999 committed Dec 6, 2017
1 parent 7c2decc commit 4a06f78
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions spoilers-arming.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@
};

// Adds callback after every frame to update spoilersArmed animation value and status
geofs.api.addFrameCallback(function () {
spoilersArming();
geofs.aircraft.instance.animationValue.spoilersArmed = armed();
}, 'spoilersArming');
geofs.api.addFrameCallback(spoilersArming, 'spoilersArming');

// Instrument overlay definition
instruments.definitions.spoilersArming = {
Expand Down Expand Up @@ -71,8 +68,10 @@

// Checks for spoilers arming status, called at every frame
function spoilersArming () {
if (!armed()) return;
if (!aircraft.groundContact) {
// Sets animation value
geofs.aircraft.instance.animationValue.spoilersArmed = armed();

if (!armed() || !aircraft.groundContact) {
initialWheelAccel = undefined;
return;
}
Expand All @@ -98,15 +97,13 @@
if (typeof instrumentList.spoilers !== 'undefined') {
armed(false);
enabled(true);
$.extend(instrumentList, { spoilersArming: instrumentList.spoilers });
instrumentList.spoilersArming = instrumentList.spoilers;
} else enabled(false);

oldInit(instrumentList);
};

/**
* Checks for arming eligibility after page load
*/
// Checks for arming eligibility after page load
$(function () {
instruments.init(aircraft.setup.instruments);
});
Expand Down

0 comments on commit 4a06f78

Please sign in to comment.