FlightTimer - improve, fix

Test fix for such events as summon, BG/Arena entry to stop the bar and hide editbox (report frame).
DebugString - now adds hops count (to avoid confusion i talked already about)
To Do: Need to fix editbox for 3.3.5, it is right now not copyable and look of it is bad. Can take RecentChatWindow as a reference, as i already fixed that one.
This commit is contained in:
Sattva
2023-06-14 06:51:54 +03:00
parent 913d71ea39
commit d59d7fe6c1
2 changed files with 22 additions and 7 deletions
+2
View File
@@ -45,6 +45,8 @@ QueueTimer - Need to test if timer .After 0.1 is fine in SetupBar func (was
LibCandyBar - Will it be conflicting with other addons that use 3.3.5 version of CandyBar lib?
ShowFlightPaths - Will StopLandingEvent work correctly on summon, BG/arena accept
--------------------------------------------------------------------------------
-- Stuff to-do:
+20 -7
View File
@@ -6309,8 +6309,7 @@ function LeaPlusLC:FriendCheck(name)
--if PLAYER_ON_TAXI == false then print("unregister event") else print("event still registered") end
if LeaPlusLC.FlightProgressBar then
LeaPlusLC.FlightProgressBar:Stop()
LeaPlusLC.FlightProgressBar = nil
LeaPlusLC.FlightProgressBar = nil
end
end
end)
@@ -6370,13 +6369,14 @@ function LeaPlusLC:FriendCheck(name)
end
debugString = debugString .. '"] = '
local debugOnenumEnterHops = (GetNumRoutes(node) - 1)
-- Add node names to debug string
debugString = debugString .. " -- " .. nodeName
-- If debug string does not contain destination, add it to the end
if not string.find(debugString, barName) then
debugString = debugString .. ", " .. barName
debugString = debugString .. ", " .. barName .. " with " .. debugOnenumEnterHops .. " hops"
end
-- Print debug string (used for showing full routes for nodes)
@@ -6404,11 +6404,11 @@ function LeaPlusLC:FriendCheck(name)
end)
function Leatrix_HandleFlightLanding()
print("ff script")
print("debug report script fire")
local timeEnd = GetTime()
local timeTaken = timeEnd - timeStart
debugString = gsub(debugString, "TimeTakenPlaceHolder", string.format("%0.0f", timeTaken))
local flightMsg = L["Flight details"] .. " (" .. L["WRATH"].. "): " .. nodeName .. " (" .. currentNode .. ") " .. L["to"] .. " " .. barName .. " (" .. destination .. ") (" .. faction .. ") " .. L["took"] .. " " .. string.format("%0.0f", timeTaken) .. " " .. L["seconds"] .. " (" .. numEnterHops .. " " .. L["hop"] ..").|n|n" .. debugString .. "|n|n"
local flightMsg = L["Flight details"] .. " (" .. L["WRATH"].. "): " .. nodeName .. " (" .. currentNode .. ") " .. L["to"] .. " " .. barName .. " (" .. destination .. ") (" .. faction .. ") " .. L["took"] .. " " .. string.format("%0.0f", timeTaken) .. " " .. L["seconds"] .. " (" .. debugOnenumEnterHops .. " " .. L["hop"] ..").|n|n" .. debugString .. "|n|n"
if destination and data[faction] and data[faction][continent] and data[faction][continent][routeString] then
local savedDuration = data[faction][continent][routeString]
if savedDuration then
@@ -6573,6 +6573,12 @@ function LeaPlusLC:FriendCheck(name)
-- end
-- end)
--------------------------------------------------------------------------------
-- Hook to the Node OnEnter blizzard func.
--------------------------------------------------------------------------------
-- Show flight time in node tooltips
hooksecurefunc("TaxiNodeOnButtonEnter", function(button)
@@ -6639,6 +6645,8 @@ function LeaPlusLC:FriendCheck(name)
GameTooltip:Show()
end
local debugTwonumEnterHops = (GetNumRoutes(index) - 1)
-- Add node names to debug string
debugString = debugString .. " -- " .. nodeName
-- for i = 20, numEnterHops do
@@ -6655,7 +6663,7 @@ function LeaPlusLC:FriendCheck(name)
-- If debug string does not contain destination, add it to the end
if not string.find(debugString, barName) then
debugString = debugString .. ", " .. barName
debugString = debugString .. ", " .. barName .. " with " .. debugTwonumEnterHops .. " hops"
end
-- Print debug string (used for showing full routes for nodes)
@@ -6665,9 +6673,14 @@ function LeaPlusLC:FriendCheck(name)
end
end)
-- FIXME 3.3.5
-- Unregister landing event for various reasons that stop taxi early
local function StopLandingEvent()
LeaPlusLC.flightFrame:UnregisterEvent("PLAYER_CONTROL_GAINED")
if editFrame:IsShown() then editFrame:Hide() end
if LeaPlusLC.FlightProgressBar then
LeaPlusLC.FlightProgressBar:Stop()
LeaPlusLC.FlightProgressBar = nil
end
end
hooksecurefunc("TaxiNodeOnButtonEnter", StopLandingEvent)