tukui-org / ElvUI

User Interface replacement AddOn for World of Warcraft.
https://tukui.org
Other
398 stars 137 forks source link

Add Dragon/Skyriding Support to Movement Speed Datatext #1238

Closed Bauxite closed 4 days ago

Bauxite commented 4 days ago

Troubleshooting Steps

image

Describe the expected behavior and what actually happened?

The GetUnitSpeed API does not return real values while Dragon(Sky)riding, but the IsFlying API does return true. so the Movement Speed datatext returns the maximum steady flying speed. The GetGlidingInfo API's return values of isGliding / forwardSpeed can be used instead to display proper values while Dragon(Sky)riding.

local function DelayUpdate(self)
    local _, runSpeed, flightSpeed, swimSpeed = GetUnitSpeed('player')
    local isGliding, canGlide, forwardSpeed = C_PlayerInfo.GetGlidingInfo()

    local speed

    if isGliding then
        speed = forwardSpeed
        wasFlying = true
        elseif IsSwimming() then
        speed = swimSpeed
        wasFlying = false
       ...

Reproducing the issue.

Lua Errors

N/A

Verification Steps