@@ -5,26 +5,41 @@ local TT = E:GetModule("Tooltip")
55local type = type
66local select = select
77
8+ function S :LibQTip_SetCell (tooltip , ...)
9+ local setCell = self .hooks [tooltip ] and self .hooks [tooltip ].SetCell
10+ if not setCell then
11+ return
12+ end
13+
14+ local lineNum , colNum , value = select (1 , ... )
15+
16+ -- Only style if we have valid parameters and string value
17+ if type (lineNum ) == " number" and type (colNum ) == " number" and type (value ) == " string" then
18+ local styledValue = self :StyleTextureString (value )
19+ if styledValue ~= value then
20+ -- Replace the value in the argument list
21+ return setCell (tooltip , lineNum , colNum , styledValue , select (4 , ... ))
22+ end
23+ end
24+
25+ -- Fall back to original method
26+ return setCell (tooltip , ... )
27+ end
28+
829function S :ReskinLibQTip (lib )
930 for _ , tt in lib :IterateTooltips () do
10- TT :SetStyle (tt )
11- if tt .SetCell and not self :IsHooked (tt , " SetCell" ) then
12- self :RawHook (tt , " SetCell" , function (tooltip , ...)
13- local lineNum , colNum , value = select (1 , ... )
14-
15- -- Only style if we have valid parameters and string value
16- if type (lineNum ) == " number" and type (colNum ) == " number" and type (value ) == " string" then
17- local styledValue = self :StyleTextureString (value )
18- if styledValue ~= value then
19- -- Replace the value in the argument list
20- return self .hooks [tt ].SetCell (tooltip , lineNum , colNum , styledValue , select (4 , ... ))
21- end
22- end
23-
24- -- Call original with all original parameters
25- return self .hooks [tt ].SetCell (tooltip , ... )
26- end )
27- end
31+ F .WaitFor (function ()
32+ return E .private .WT and E .private .WT .skins and E .private .WT .skins .libraries
33+ end , function ()
34+ if not E .private .WT .skins .libraries .libQTip then
35+ return
36+ end
37+
38+ TT :SetStyle (tt )
39+ if tt .SetCell and not self :IsHooked (tt , " SetCell" ) then
40+ self :RawHook (tt , " SetCell" , " LibQTip_SetCell" )
41+ end
42+ end )
2843 end
2944end
3045
0 commit comments