Skip to content

Commit

Permalink
Fix CalendarContextMenu bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kkthnx committed Aug 18, 2024
1 parent cd4f1e4 commit fb779dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
20 changes: 10 additions & 10 deletions KkthnxUI/Libraries/oUF/elements/range.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ local function Update(self, event)
* self - the Range element
--]]
if(element.PreUpdate) then
if element.PreUpdate then
element:PreUpdate()
end

local inRange, checkedRange
local connected = UnitIsConnected(unit)
if(connected) then
if connected then
inRange, checkedRange = UnitInRange(unit)
if(checkedRange and not inRange) then
if checkedRange and not inRange then
self:SetAlpha(element.outsideAlpha)
else
self:SetAlpha(element.insideAlpha)
Expand All @@ -63,7 +63,7 @@ local function Update(self, event)
* checkedRange - indicates if the range check was actually performed (boolean)
* isConnected - indicates if the unit is online (boolean)
--]]
if(element.PostUpdate) then
if element.PostUpdate then
return element:PostUpdate(self, inRange, checkedRange, connected)
end
end
Expand All @@ -75,29 +75,29 @@ local function Path(self, ...)
* self - the parent object
* event - the event triggering the update (string)
--]]
return (self.Range.Override or Update) (self, ...)
return (self.Range.Override or Update)(self, ...)
end

local function Enable(self)
local element = self.Range
if(element) then
if element then
element.__owner = self
element.insideAlpha = element.insideAlpha or 1
element.outsideAlpha = element.outsideAlpha or 0.55

self:RegisterEvent('UNIT_IN_RANGE_UPDATE', Path)
self:RegisterEvent("UNIT_IN_RANGE_UPDATE", Path)

return true
end
end

local function Disable(self)
local element = self.Range
if(element) then
if element then
self:SetAlpha(element.insideAlpha)

self:UnregisterEvent('UNIT_IN_RANGE_UPDATE', Path)
self:UnregisterEvent("UNIT_IN_RANGE_UPDATE", Path)
end
end

oUF:AddElement('Range', Path, Enable, Disable)
oUF:AddElement("Range", Path, Enable, Disable)
9 changes: 2 additions & 7 deletions KkthnxUI/Modules/Tooltip/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function Module:OnTooltipSetUnit()
local name, realm = UnitName(unit)
local pvpName = UnitPVPName(unit)
local relationship = UnitRealmRelationship(unit)
if not C["Tooltip"].HideTitle and pvpName then
if not C["Tooltip"].HideTitle and pvpName and pvpName ~= "" then
name = pvpName
end

Expand Down Expand Up @@ -436,7 +436,7 @@ function Module:ReskinTooltip()
if data then
local link = data.guid and C_Item.GetItemLinkByGUID(data.guid) or data.hyperlink
if link then
local quality = select(3, GetItemInfo(link))
local quality = select(3, C_Item.GetItemInfo(link))
local color = K.QualityColors[quality or 1]
if color then
self.bg.KKUI_Border:SetVertexColor(color.r, color.g, color.b)
Expand Down Expand Up @@ -729,8 +729,3 @@ Module:RegisterTooltips("Blizzard_EncounterJournal", function()
EncounterJournalTooltip.Item2.icon:SetTexCoord(K.TexCoords[1], K.TexCoords[2], K.TexCoords[3], K.TexCoords[4])
EncounterJournalTooltip.Item2.IconBorder:SetAlpha(0)
end)

Module:RegisterTooltips("Blizzard_Calendar", function()
CalendarContextMenu:HookScript("OnShow", Module.ReskinTooltip)
CalendarInviteStatusContextMenu:HookScript("OnShow", Module.ReskinTooltip)
end)

0 comments on commit fb779dd

Please sign in to comment.