[lua] function TakeTaxiNode

Viewer

copydownloadembedprintName: function TakeTaxiNode
  1.         TakeTaxiNode = function(slot)
  2.                 if TaxiNodeGetType(slot) ~= "REACHABLE" then return end
  3.                 destination = ShortenName(FixTypos(TaxiNodeName(slot))) --ShortenName(TaxiNodeName(slot))
  4.  
  5.                 local t = vars[source]
  6.                 if t and t[destination] and t[destination] > 0 then  -- saved variables lookup
  7.                         endTime = t[destination]
  8.                 else
  9.                         endTime = GetEstimatedTime(slot)
  10.                 end
  11.                 if db.confirmflight then  -- confirm flight
  12.                         StaticPopupDialogs.INFLIGHTCONFIRM = StaticPopupDialogs.INFLIGHTCONFIRM or {
  13.                                 button1 = OKAY, button2 = CANCEL,
  14.                                 OnAccept = function(this, data) InFlight:StartTimer(data) end,
  15.                                 timeout = 0, exclusive = 1, hideOnEscape = 1,
  16.                         }
  17.                         StaticPopupDialogs.INFLIGHTCONFIRM.text = format(L_confirmpopup, destination, endTime and format(" (%s)", FormatTime(endTime)) or "")
  18.  
  19.                         local dialog = StaticPopup_Show("INFLIGHTCONFIRM")
  20.                         if dialog then 
  21.                                 dialog.data = slot 
  22.                         end
  23.                 else  -- just take the flight
  24.                         self:StartTimer(slot)
  25.                 end
  26.         end

Editor

You can edit this paste and save as new:


File Description
  • function TakeTaxiNode
  • Paste Code
  • 02 Sep-2022
  • 985 Bytes
You can Share it: