InFlight compatibility #257


  • Patch
Closed
  • WildCard_25 created this issue Aug 1, 2018

    Restores compatibility with InFlight as of InFlight v8.0.002

    diff --git a/modules/Flight.lua b/modules/Flight.lua
    index c1be8c6..cbd6286 100644
    --- a/modules/Flight.lua
    +++ b/modules/Flight.lua
    @@ -85,29 +85,38 @@ function Flight:OnInitialize()
     	
     	self:SetEnabledState(Quartz3:GetModuleEnabled(MODNAME))
     	Quartz3:RegisterModuleOptions(MODNAME, getOptions, L["Flight"])
    +
    +	self:RegisterEvent("TAXIMAP_OPENED")
     end
     
     function Flight:ApplySettings()
     	db = self.db.profile
     end
     
    ---[[
    -if InFlight then
    -	function Flight:OnEnable()
    -		self:RawHook(InFlight, "StartTimer")
    -	end
    +function Flight:TAXIMAP_OPENED()
    +	local loaded = LoadAddOn("InFlight")
    +	if loaded then
    +		function Flight:OnEnable()
    +			self:SecureHook(InFlight, "StartTimer")
    +		end
     
    -	function Flight:StartTimer(object, ...)
    -		self.hooks[object].StartTimer(object, ...)
    -		
    -		local f = InFlightBar
    -		local _, duration = f:GetMinMaxValues()
    -		local _, locText = f:GetRegions()
    -		local destination = locText:GetText()
    +		function Flight:StartTimer()
    +			local f = InFlightBar
    +			InFlightBar:Hide()
    +			local _, duration = f:GetMinMaxValues()
    +			local _, locText = f:GetRegions()
    +			local destination = locText:GetText()
    +			self:BeginFlight(duration, destination)
    +		end
    +
    +		if Flight:IsEnabled() then
    +			Flight:OnEnable()
    +		end
     
    -		self:BeginFlight(duration, destination)
    +		self:UnregisterEvent("TAXIMAP_OPENED")
     	end
    -else ]]
    +end
    +
     if FlightMapTimes_BeginFlight then
     	function Flight:OnEnable()
     		self:RawHook("FlightMapTimes_BeginFlight")
    @@ -142,7 +151,7 @@ function Flight:BeginFlight(duration, destination)
     	Player.Bar:SetAlpha(Player.db.profile.alpha)
     	
     	Player.Bar.Spark:Show()
    -	Player.Bar.Icon:SetTexture(nil)
    +	Player.Bar.Icon:SetTexture("Interface\\Icons\\ability_druid_flightform")
     	Player.Bar.Text:SetText(destination)
     	
     	local position = Player.db.profile.timetextposition
    

     

  • WildCard_25 added a tag Patch Aug 1, 2018
  • lachlan9623 posted a comment Apr 6, 2019

    Hi,

     

    Could you possibly give me directions as to what file to apply this fix to and where to paste it in?

     

    Th.anks

  • WildCard_25 posted a comment Apr 6, 2019

    How to read a git diff

    All of the information needed to manually add these changes to a file are in that link.

    The short version:

    The file is 'Quartz/modules/Flight.lua' in your WoW addons folder.

    The lines starting with a minus sign (-) are removed.

    The lines starting with a plus sign (+) are added.

    The lines with the at signs (@@) tell you what chunk of lines in the file are being changed.

     

    A 'diff' file is a standard format used by programmers for showing differences between files and is usually applied by software, not by hand. :-)

  • WildCard_25 added an attachment Aug 16, 2019
    Attachment was deleted by WildCard_25 Sep 26, 2019
  • Yutakafrog posted a comment Aug 16, 2019

    @nevcairiel Please merge this (as soon as InFlight v8.2.004 is released)!  I know there have only been two releases of Quartz in the last two years, so you're clearly not spending a ton of time on this addon, and that's fine.  But I've manually patched in the update from the top of this issue (months ago) and haven't had a single error pop up due to it.  It seems rock solid, and I absolutely love having my flight timer show using Quartz.  (I can't speak to the stability of the attachment WildCard_25 just added, but I'll be testing it as soon as I see InFlight update in my Twitch client!)  I'd be so delighted if you merged this!  <3

  • WildCard_25 posted a comment Sep 7, 2019

    File attached above still works on v3.5.1 and Classic.

  • Forge_User_64720881 posted a comment Sep 25, 2019

    When trying to fly to a place you haven't been to using the above Flight.lua Wild attached a few comments up from mine.  Only applies if the time of the flight hasn't been stored yet:

     

    Message: Interface\AddOns\Quartz\modules\Flight.lua:132: attempt to perform arithmetic on local 'duration' (a nil value)
    Time: Wed Sep 25 18:43:28 2019
    Count: 2
    Stack: Interface\AddOns\Quartz\modules\Flight.lua:132: attempt to perform arithmetic on local 'duration' (a nil value)
    [C]: ?
    Interface\AddOns\Quartz\modules\Flight.lua:132: in function `BeginFlight'
    Interface\AddOns\Quartz\modules\Flight.lua:105: in function <Interface\AddOns\Quartz\modules\Flight.lua:103>
    (tail call): ?
    [C]: in function `StartTimer'
    Interface\AddOns\InFlight\InFlight.lua:267: in function `TakeTaxiNode'
    [string "*:OnClick"]:1: in function <[string "*:OnClick"]:1>

     

    I'm playing on Classic.  Both addons are to the latest version and the attached .lua above is in use.  Timers work fine with Quartz provided the duration is stored in advance.


    Edited Sep 25, 2019
  • WildCard_25 posted a comment Sep 26, 2019

    @Daishar Patch on github fixes this issue.


    Edited Sep 26, 2019
  • WildCard_25 added an attachment Sep 26, 2019
    Attachment was deleted by WildCard_25 Sep 26, 2019
  • WildCard_25 added an attachment Flight.lua Sep 26, 2019

    Flight.lua for Quartz v3.5.2

    Restores compatability with InFlight as of InFlight v8.2.004 This update relies on new functions in InFlight v8.2.004.

  • Forge_User_64720881 posted a comment Sep 29, 2019

    @WildCard_25 the latest .lua is perfect, thank you.  Now we just wait until it's incorporated into official release.  You are a star.

    @Nevcairiel just a poke so you see the updated flight.lua file attached to Wildcard_25's comment above.


    Edited Oct 1, 2019
  • nevcairiel closed issue Oct 26, 2019
  • Yutakafrog posted a comment Dec 11, 2019

     If you're just going to close the issue without addressing it, and without even commenting on why you're closing it, you should probably just remove mention of "InFlight" from the addon's description, because it does not currently hook into InFlight to display the current flight progress on your casting bar.

  • WildCard_25 posted a comment Dec 12, 2019

     @Yutakafrog It looks like this was merged in, with some changes, near the end of October, about a month after the last release v3.5.2.

    If you are using Twitch to install addons, you can try out these changes by right clicking on Quartz in Twitch's addon list and changing the 'Release Type' to 'Alpha' in the menu that pops up. hth

  • Yutakafrog posted a comment Dec 15, 2019

     Oh, well nevermind then.  :S  Thanks for merging it!


To post a comment, please login or register a new account.