floats.nas 707 B

12345678910111213141516171819202122
  1. # toggle floats (inflate/repack)
  2. # mhab 20131104
  3. toggle_floats = func () {
  4. # if ( getprop("/sim/model/floats/emergencyfloats") ) {
  5. if ( getprop("/controls/gear/floats-inflat") ) {
  6. if ( getprop("gear/gear[0]/wow") or getprop("gear/gear[1]/wow") or getprop("gear/gear[2]/wow") or getprop("gear/gear[3]/wow") ) {
  7. setprop("/controls/gear/floats-inflat",0);
  8. setprop("/controls/gear/floats-armed",0);
  9. } else {
  10. gui.popupTip("Repack only possible on ground",1);
  11. }
  12. } else {
  13. if ( getprop("/controls/gear/floats-armed") ) {
  14. setprop("/controls/gear/floats-inflat",1);
  15. } else {
  16. gui.popupTip("Floats are not armed",1);
  17. }
  18. }
  19. #}
  20. }