Skip to content

Commit

Permalink
fix toc debug
Browse files Browse the repository at this point in the history
statusbar - fix chat insert
core : fix debug
  • Loading branch information
orionshock committed Feb 11, 2023
1 parent 4629586 commit de934bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
13 changes: 7 additions & 6 deletions OnFlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ taxiDestName --Full Proper name from API for where we are going
--luacheck: globals UnitFactionGroup string UnitOnTaxi UnitInVehicle CreateFrame tostringall GetTime date SecondsToTime abs hooksecurefunc
--luacheck: globals C_SummonInfo OnFlight_GetEstimatedTime TaxiFrame TaxiGetNodeSlot OnFlight_TaxiFrame_TooltipHook GameTooltip

local Debug = LibEdrik_GetDebugFunction and LibEdrik_GetDebugFunction("|cff0040ffOn|cFF00FF00Flight|r|r-C", nil, nil, false) or function()
local Debug = LibEdrik_GetDebugFunction and LibEdrik_GetDebugFunction("|cff0040ffOn|cFF00FF00Flight|r|r-C:", nil, nil, false) or function()
end

local addonName, addonCore = ...
Expand Down Expand Up @@ -355,15 +355,15 @@ function addonCore:TAXIMAP_OPENED(event, uiMapSystem)
end

function addonCore:PLAYER_ENTERING_WORLD(event, isInitialLogin, isReloadingUi)
Debug(event, "-- isInitialLogin:", isInitialLogin, "-- isInitialLogin:", isReloadingUi)
Debug(db.char.taxiSrcName, "--", db.char.taxiDestName, "--", db.char.taxiStartTime)
Debug(event, "-- isInitialLogin:", isInitialLogin, "-- isReloadingUi:", isReloadingUi)
if db.char.taxiSrcName and db.char.taxiDestName and db.char.taxiStartTime then
Debug(db.char.taxiSrcName, "--", db.char.taxiDestName, "--", db.char.taxiStartTime)
local duration = self:GetFlightDuration(db.char.taxiSrcName, db.char.taxiDestName)
if duration then
local segment = db.char.exitingWorld - db.char.taxiStartTime
local timeOutOfWorld = GetTime() - db.char.exitingWorld
local timeRemaining = duration - (segment + timeOutOfWorld)
Debug("elements:", segment, timeOutOfWorld, duration )
Debug("elements:", segment, timeOutOfWorld, duration)
Debug("Known:StartAFlight(", timeRemaining, ")")
self:StartAFlight(db.char.taxiSrcName, db.char.taxiDestName, timeRemaining)
else
Expand All @@ -374,7 +374,8 @@ function addonCore:PLAYER_ENTERING_WORLD(event, isInitialLogin, isReloadingUi)
end
end

function addonCore:PLAYER_LEAVING_WORLD(event)
function addonCore:PLAYER_LEAVING_WORLD(event, ...)
Debug(event, ...)
if self:IsOnFlight() then
db.char.taxiSrcName = taxiTimerFrame.taxiSrcName
db.char.taxiDestName = taxiTimerFrame.taxiDestName
Expand Down Expand Up @@ -460,7 +461,7 @@ do
orig_C_GossipInfo_SelectOption(option, ...)
return
end
Debug("Checking:", gossipOptionID, gossipSelection.name)
Debug("C_GossipInfo.SelectOption:", gossipOptionID, gossipSelection.name)
if db.global.gossipTriggered[gossipOptionID] then
Debug(unpack(db.global.gossipTriggered[gossipOptionID]))
addonCore:StartAFlight(unpack(db.global.gossipTriggered[gossipOptionID]))
Expand Down
5 changes: 3 additions & 2 deletions OnFlight.toc
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ locales\locales.xml
OnFlight.lua
StatusBarModule.lua
Defaults.lua

AllTaxiRunner.lua
#@debug@
AllTaxiRunner.lua
#@end-debug@
2 changes: 1 addition & 1 deletion StatusBarModule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function statusBarModuleCore:SetupTimerBar()
if IsShiftKeyDown() then
if frame.timeRemaining then
ChatEdit_ActivateChat(DEFAULT_CHAT_FRAME.editBox)
ChatEdit_InsertLink("[%s]: %s - %s"):format(L["OnFlight"], frame.shortText, disp_time(frame.timeRemaining))
ChatEdit_InsertLink( ("[%s]: %s - %s"):format(L["OnFlight"], frame.shortText, disp_time(frame.timeRemaining)) )
end
end
end
Expand Down

0 comments on commit de934bf

Please sign in to comment.