Sounds: added sounds for handbrake

This commit is contained in:
Sidi Liang 2020-08-16 14:04:32 +08:00
parent 8363996973
commit e0a1563ce6
No known key found for this signature in database
GPG Key ID: 79F0A6B20B72F42F
2 changed files with 55 additions and 3 deletions

View File

@ -29,7 +29,7 @@ var Engine = {
#//Toggle Direction, forward:1; barkward: -1
me.direction *= -1;
props.getNode("/",1).setValue("/controls/direction", me.direction);
followme.playAudio("change_gear.wav")
if(isInternalView()) followme.playAudio("change_gear.wav");
},
getDirection: func(){
return me.direction;

View File

@ -36,6 +36,46 @@ var beacon = aircraft.light.new( "/sim/model/lights/indicator-left", [0.5, 0.5],
beacon_switch = props.globals.getNode("controls/switches/indicator-right", 2);
var beacon = aircraft.light.new( "/sim/model/lights/indicator-right", [0.5, 0.5], "/controls/lighting/indicator-right");
#//Wiper
var wiperMode = 0;
var wiper = aircraft.light.new( "/controls/wiper/frontwiper", [1, 1], "/controls/wiper/frontwiper_switch");
var wiperStop = func(){
props.getNode("/",1).setValue("/controls/wiper/frontwiper_switch", 0);
wiperMode = 0;
}
var wiperFast = func(){
props.getNode("/",1).setValue("/controls/wiper/frontwiper_switch", 1);
wiperMode = 1;
wiper.del();
wiper = aircraft.light.new( "/controls/wiper/frontwiper", [1, 1], "/controls/wiper/frontwiper_switch");
}
var wiperMid = func(){
props.getNode("/",1).setValue("/controls/wiper/frontwiper_switch", 1);
wiperMode = 2;
wiper.del();
wiper = aircraft.light.new( "/controls/wiper/frontwiper", [2, 1], "/controls/wiper/frontwiper_switch");
}
var wiperSlow = func(){
props.getNode("/",1).setValue("/controls/wiper/frontwiper_switch", 1);
wiperMode = 3;
wiper.del();
wiper = aircraft.light.new( "/controls/wiper/frontwiper", [2, 1, 4], "/controls/wiper/frontwiper_switch");
}
var toggleWiper = func(){
if(wiperMode == 0){
wiperSlow();
}else if(wiperMode == 1){
wiperStop();
}else if(wiperMode == 2){
wiperFast();
}else if(wiperMode == 3){
wiperMid();
}
}
wiper.stateN = wiper.node.initNode("state", 0, "DOUBLE");
props.getNode("/",1).setValue("/controls/wiper/frontwiper_switch", 0);
props.getNode("/",1).setValue("/controls/lighting/indicator-left", 0);
props.getNode("/",1).setValue("/controls/lighting/indicator-right", 0);
@ -340,18 +380,30 @@ var BrakeController = {
if(value == 1) safety.emergencyMode();
},
enableHandBrake: func(){
activeHandBrake: func(){
#for internal use
settimer(func(){ #Delay for 0.5 seconds
me.parkingBrakeNode.setValue(1);
me.handBrakeIsOn = 1;
}, 0.5);
},
disableHandBrake: func(){
deactiveHandBrake: func(){
#for internal use
settimer(func(){ #Delay for 0.5 seconds
me.parkingBrakeNode.setValue(0);
me.handBrakeIsOn = 0;
}, 0.5);
},
enableHandBrake: func(){
#enable handbrake from button
me.activeHandBrake();
if(isInternalView()) playAudio("handbrake_on.wav");
},
disableHandBrake: func(){
#disable handbrake from button
me.deactiveHandBrake();
if(isInternalView()) playAudio("handbrake_off.wav");
},
toggleHandBrake: func(){
#Toggle handbrake from button
if(isInternalView()) playAudio("electric_handbrake.wav");