View Single Post
10-29-20, 05:00 PM   #6
DahkCeles
A Cliff Giant
 
DahkCeles's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2020
Posts: 73
Further testing: underwater nodes in Vashj'ir do not play nice with above-water nodes in the Eastern Kingdoms. A few extra lines of code can solve that problem...


Lua Code:
  1. -- Step 1: Wait for the flight map to be created
  2. -- Step 2: Any time the flight map appears, enumerate through every flight path pin and do steps 3 and 4 at least once
  3. -- Step 3: Make each pin shown, and prevent the the OnMouseEnter/OnMouseLeave events from overriding this
  4. -- Step 4: Undersea nodes in Vashj'ir will not play nice, so override the click handler
  5. -- Step 5: Also because of Vashj'ir, change the tooltip text just a little
  6.  
  7.  
  8. -- STEP 1:
  9. local alreadyHooked
  10. hooksecurefunc("FlightMap_LoadUI", function()
  11.     if (alreadyHooked) then
  12.         return
  13.     else
  14.         alreadyHooked = true
  15.        
  16.         -- STEP 2:
  17.         FlightMapFrame:HookScript("OnShow", function()
  18.             for pin in FlightMapFrame:EnumeratePinsByTemplate("FlightMap_FlightPointPinTemplate") do
  19.                 if (pin.alreadyHooked == nil) then
  20.                     pin.alreadyHooked = true
  21.                     -- STEP 3:
  22.                     pin:Show()
  23.                     pin.SetShown = pin.Show
  24.                     -- STEP 4:
  25.                     function pin:OnClick(button)
  26.                         if button == "LeftButton" and self.taxiNodeData.state == Enum.FlightPathState.Reachable then
  27.                             TakeTaxiNode(self.taxiNodeData.slotIndex);
  28.                         end
  29.                     end
  30.                 end
  31.             end
  32.         end)
  33.     end
  34. end)
  35.  
  36.  
  37. -- Instead of saying 'not discovered' it will say 'not available'
  38. TAXI_PATH_UNREACHABLE = ADDON_NOT_AVAILABLE


You are correct about Draenor. Here's the source code for that one:
https://www.townlong-yak.com/framexm...xiFrame.lua#32

Last edited by DahkCeles : 10-29-20 at 05:02 PM.
  Reply With Quote