diff --git a/!Compatibility/api/wowAPI.lua b/!Compatibility/api/wowAPI.lua index bdf0ad4..ffc2932 100644 --- a/!Compatibility/api/wowAPI.lua +++ b/!Compatibility/api/wowAPI.lua @@ -267,18 +267,18 @@ end local arrow function GetPlayerFacing() - if not arrow then - local obj = Minimap - for i = 1, obj:GetNumChildren() do - local child = select(i, obj:GetChildren()) - if child and child.GetModel and child:GetModel() == "interface\\minimap\\minimaparrow.m2" then - arrow = child - break - end - end - end + if not arrow then + local obj = Minimap + for i = 1, obj:GetNumChildren() do + local child = select(i, obj:GetChildren()) + if child and child.GetModel and child:GetModel() == "Interface\\Minimap\\MinimapArrow" then + arrow = child + break + end + end + end - return arrow and arrow:GetFacing() + return arrow and arrow:GetFacing() end function ToggleFrame(frame) diff --git a/ElvUI/Libraries/oUF_Plugins/oUF_GPS/oUF_GPS.lua b/ElvUI/Libraries/oUF_Plugins/oUF_GPS/oUF_GPS.lua index cd088a9..dc75259 100644 --- a/ElvUI/Libraries/oUF_Plugins/oUF_GPS/oUF_GPS.lua +++ b/ElvUI/Libraries/oUF_Plugins/oUF_GPS/oUF_GPS.lua @@ -30,7 +30,6 @@ local GetAngle = function(unit1, unit2) if x1 <= 0 and y1 <= 0 then return nil end local x2, y2 = GetPlayerMapPosition(unit2) if x2 <= 0 and y2 <= 0 then return nil end - -- print(pi2, GetPlayerFacing(), y2, y1, x2, x1) return -pi2 - GetPlayerFacing() - atan2(y2 - y1, x2 - x1) end @@ -38,39 +37,39 @@ local minThrottle = 0.02 local numArrows, inRange, unit, GPS local Update = function(self, elapsed) if self.elapsed and self.elapsed > (self.throttle or minThrottle) then - numArrows = 0; + numArrows = 0 for _, object in next, _FRAMES do if object:IsShown() then - GPS = object.GPS; - unit = object.unit; + GPS = object.GPS + unit = object.unit if unit then if unit and GPS.outOfRange then - inRange = true; + inRange = CheckInteractDistance(unit, 4) end if not unit or not (UnitInParty(unit) or UnitInRaid(unit)) or UnitIsUnit(unit, "player") or not UnitIsConnected(unit) or (GPS.onMouseOver and (GetMouseFocus() ~= object)) or (GPS.outOfRange and inRange) then GPS:Hide() else - local angle = GetAngle("player", unit); + local angle = GetAngle("player", unit) if angle == nil then - GPS:Hide(); + GPS:Hide() else - GPS:Show(); - RotateTexture(GPS.Texture, angle); + GPS:Show() + RotateTexture(GPS.Texture, angle) - numArrows = numArrows + 1; + numArrows = numArrows + 1 end end else - GPS:Hide(); + GPS:Hide() end end end - self.elapsed = 0; - self.throttle = max(minThrottle, 0.005 * numArrows); + self.elapsed = 0 + self.throttle = max(minThrottle, 0.005 * numArrows) else - self.elapsed = (self.elapsed or 0) + tonumber(elapsed); + self.elapsed = (self.elapsed or 0) + elapsed end end diff --git a/ElvUI/Modules/UnitFrames/Elements/GPS.lua b/ElvUI/Modules/UnitFrames/Elements/GPS.lua index ed8586f..9d4cee9 100644 --- a/ElvUI/Modules/UnitFrames/Elements/GPS.lua +++ b/ElvUI/Modules/UnitFrames/Elements/GPS.lua @@ -10,7 +10,7 @@ local CreateFrame = CreateFrame function UF:Construct_GPS(frame) local gps = CreateFrame("Frame", nil, frame) gps:SetFrameLevel(frame:GetFrameLevel() + 50) - -- gps:Hide() + gps:Hide() gps.Texture = gps:CreateTexture("OVERLAY") gps.Texture:SetTexture([[Interface\AddOns\ElvUI\media\textures\arrow.tga]]) diff --git a/ElvUI/Modules/UnitFrames/Groups/Raid.lua b/ElvUI/Modules/UnitFrames/Groups/Raid.lua index 2eb9a74..5a948b7 100644 --- a/ElvUI/Modules/UnitFrames/Groups/Raid.lua +++ b/ElvUI/Modules/UnitFrames/Groups/Raid.lua @@ -32,6 +32,7 @@ function UF:Construct_RaidFrames() self.RaidRoleFramesAnchor = UF:Construct_RaidRoleFrames(self) self.RaidTargetIndicator = UF:Construct_RaidIcon(self); + self.GPS = UF:Construct_GPS(self) self.InfoPanel = UF:Construct_InfoPanel(self) UF:Update_StatusBars() UF:Update_FontStrings() @@ -112,6 +113,8 @@ function UF:Update_RaidFrames(frame, db) UF:Configure_Portrait(frame) + UF:Configure_GPS(frame) + UF:Configure_RaidIcon(frame) UF:Configure_RaidRoleIcons(frame)