Skip to content

Commit

Permalink
Fix backdrop issues in classic era
Browse files Browse the repository at this point in the history
Closes #39 #41 #42
  • Loading branch information
solocommand committed Dec 7, 2023
1 parent 6a0cc6c commit ef18c49
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion TitanSocial.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ local CreateFrame = _G.CreateFrame
local Lib_ToggleDropDownMenu, Lib_CloseDropDownMenus = _G.Lib_ToggleDropDownMenu, _G.Lib_CloseDropDownMenus
local PlaySound = _G.PlaySound
local UnitFactionGroup = _G.UnitFactionGroup
local BNet_GetClientTexture = _G.BNet_GetClientTexture
local BNet_GetClientTexture = _G.BNet_GetClientEmbeddedAtlas
local InCombatLockdown = _G.InCombatLockdown

local TravelPassDropDown = _G.TravelPassDropDown
Expand Down
6 changes: 3 additions & 3 deletions TitanSocial.toc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## Interface: 11307
## Title: Titan Panel Classic [|cffeda55fSocial|r] |cff00aa001.13.7|r
## Interface: 11500
## Title: Titan Panel Classic [|cffeda55fSocial|r] |cff00aa001.15.0|r
## Notes: A Titan Panel plugin incorporating Friends, Guild, and Battle.net Friends
## Author: solocommand and eridius
## SavedVariables:
## SavedVariablesPerCharacter: TitanSocialVars
## Dependencies: TitanClassic
## Version: 1.13.7
## Version: 1.15.0
## LoadOnDemand: 0
## DefaultState: enabled
TitanSocial.xml
19 changes: 12 additions & 7 deletions tooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ local addonName, addonTable = ...
local tooltip = {}
addonTable.tooltip = tooltip

local defaultBackdrop = {
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true,
tileSize = 16,
edgeSize = 16,
insets = {left = 4, right = 4, top = 4, bottom = 4,}
}

local CreateFrame = _G.CreateFrame
local UIParent = _G.UIParent
local GameTooltip = _G.GameTooltip
Expand All @@ -19,7 +28,7 @@ local ResetTooltipSize, SetTooltipSize, tframe_OnMouseWheel, slider_OnValueChang
local tooltip_OnUpdate
local _SetLineScript

local tframe = CreateFrame("ScrollFrame", nil, _G.UIParent)
local tframe = CreateFrame("ScrollFrame", nil, _G.UIParent, BackdropTemplateMixin and "BackdropTemplate")
tframe:Hide()
tframe.lines = {}
tframe.columns = {}
Expand Down Expand Up @@ -205,12 +214,8 @@ function tooltip:Clear(...)
ResetTooltipSize()

-- pull current GameTooltip values
local backdrop = GameTooltip:GetBackdrop()
tframe:SetBackdrop(backdrop)
if backdrop then
tframe:SetBackdropColor(GameTooltip:GetBackdropColor())
tframe:SetBackdropBorderColor(GameTooltip:GetBackdropBorderColor())
end
tframe:SetBackdrop(defaultBackdrop)
tframe:SetBackdropColor(0,0,0,1)
tframe:SetScale(GameTooltip:GetScale())
tframe.font = _G.GameTooltipText
tframe.headerFont = _G.GameTooltipHeaderText
Expand Down

0 comments on commit ef18c49

Please sign in to comment.