comparison Libs/DF/cooltip.lua @ 40:a960d5372b0c

- framework update from v22 to v44.
author Tercio
date Wed, 31 Aug 2016 19:55:14 -0300
parents 7944c081e5b4
children 2bbf129690b0
comparison
equal deleted inserted replaced
39:7944c081e5b4 40:a960d5372b0c
154 local frame1 154 local frame1
155 if (not GameCooltipFrame1) then 155 if (not GameCooltipFrame1) then
156 frame1 = CreateFrame ("Frame", "GameCooltipFrame1", UIParent, "DFCooltipMainFrameTemplate") 156 frame1 = CreateFrame ("Frame", "GameCooltipFrame1", UIParent, "DFCooltipMainFrameTemplate")
157 tinsert (UISpecialFrames, "GameCooltipFrame1") 157 tinsert (UISpecialFrames, "GameCooltipFrame1")
158 DF:CreateFlashAnimation (frame1) 158 DF:CreateFlashAnimation (frame1)
159
160 if (DF.CreateBorder) then
161 DF:CreateBorder (frame1, .3, .1, .03)
162 end
159 else 163 else
160 frame1 = GameCooltipFrame1 164 frame1 = GameCooltipFrame1
161 end 165 end
162 166
163 GameCooltipFrame1_FrameBackgroundCenter:SetTexture (DF.folder .. "cooltip_background") 167 GameCooltipFrame1_FrameBackgroundCenter:SetTexture (DF.folder .. "cooltip_background")
172 if (not GameCooltipFrame2) then 176 if (not GameCooltipFrame2) then
173 frame2 = CreateFrame ("Frame", "GameCooltipFrame2", UIParent, "DFCooltipMainFrameTemplate") 177 frame2 = CreateFrame ("Frame", "GameCooltipFrame2", UIParent, "DFCooltipMainFrameTemplate")
174 tinsert (UISpecialFrames, "GameCooltipFrame2") 178 tinsert (UISpecialFrames, "GameCooltipFrame2")
175 DF:CreateFlashAnimation (frame2) 179 DF:CreateFlashAnimation (frame2)
176 frame2:SetClampedToScreen (true) 180 frame2:SetClampedToScreen (true)
181
182 if (DF.CreateBorder) then
183 DF:CreateBorder (frame2, .3, .1, .03)
184 end
177 else 185 else
178 frame2 = GameCooltipFrame2 186 frame2 = GameCooltipFrame2
179 end 187 end
180 188
181 frame2:SetPoint ("bottomleft", frame1, "bottomright") 189 frame2:SetPoint ("bottomleft", frame1, "bottomright", 4, 0)
182 190
183 GameCooltipFrame2_FrameBackgroundCenter:SetTexture (DF.folder .. "cooltip_background") 191 GameCooltipFrame2_FrameBackgroundCenter:SetTexture (DF.folder .. "cooltip_background")
184 GameCooltipFrame2_FrameBackgroundCenter:SetTexCoord (0.10546875, 0.89453125, 0, 1) 192 GameCooltipFrame2_FrameBackgroundCenter:SetTexCoord (0.10546875, 0.89453125, 0, 1)
185 GameCooltipFrame2_FrameBackgroundLeft:SetTexture (DF.folder .. "cooltip_background") 193 GameCooltipFrame2_FrameBackgroundLeft:SetTexture (DF.folder .. "cooltip_background")
186 GameCooltipFrame2_FrameBackgroundLeft:SetTexCoord (0, 0.103515625, 0, 1) 194 GameCooltipFrame2_FrameBackgroundLeft:SetTexCoord (0, 0.103515625, 0, 1)
591 local bottom = CoolTip.selected_anchor.bottom + (CoolTip.OptionsTable.SelectedBottomAnchorMod or 0) 599 local bottom = CoolTip.selected_anchor.bottom + (CoolTip.OptionsTable.SelectedBottomAnchorMod or 0)
592 600
593 frame.selectedTop:ClearAllPoints() 601 frame.selectedTop:ClearAllPoints()
594 frame.selectedBottom:ClearAllPoints() 602 frame.selectedBottom:ClearAllPoints()
595 603
596 frame.selectedTop:SetPoint ("topleft", button, "topleft", left, top) -- 604 frame.selectedTop:SetPoint ("topleft", button, "topleft", left+1, top) --
597 frame.selectedTop:SetPoint ("topright", button, "topright", right, top) -- 605 frame.selectedTop:SetPoint ("topright", button, "topright", right-1, top) --
598 606
599 frame.selectedBottom:SetPoint ("bottomleft", button, "bottomleft", left, bottom) -- 607 frame.selectedBottom:SetPoint ("bottomleft", button, "bottomleft", left+1, bottom) --
600 frame.selectedBottom:SetPoint ("bottomright", button, "bottomright", right, bottom) -- 608 frame.selectedBottom:SetPoint ("bottomright", button, "bottomright", right-1, bottom) --
601 609
602 CoolTip:ShowSelectedTexture (frame) 610 CoolTip:ShowSelectedTexture (frame)
603 end 611 end
604 612
605 local OnClickFunctionButtonPrincipal = function (self) 613 local OnClickFunctionButtonPrincipal = function (self, button)
606 if (CoolTip.IndexesSub [self.index] and CoolTip.IndexesSub [self.index] > 0) then 614 if (CoolTip.IndexesSub [self.index] and CoolTip.IndexesSub [self.index] > 0) then
607 CoolTip:ShowSub (self.index) 615 CoolTip:ShowSub (self.index)
608 CoolTip.last_button = self.index 616 CoolTip.last_button = self.index
609 end 617 end
610 618
617 end 625 end
618 CoolTip.SelectedIndexMain = self.index 626 CoolTip.SelectedIndexMain = self.index
619 627
620 if (CoolTip.FunctionsTableMain [self.index]) then 628 if (CoolTip.FunctionsTableMain [self.index]) then
621 local parameterTable = CoolTip.ParametersTableMain [self.index] 629 local parameterTable = CoolTip.ParametersTableMain [self.index]
622 CoolTip.FunctionsTableMain [self.index] (_, CoolTip.FixedValue, parameterTable [1], parameterTable [2], parameterTable [3]) 630 CoolTip.FunctionsTableMain [self.index] (_, CoolTip.FixedValue, parameterTable [1], parameterTable [2], parameterTable [3], button)
623 end 631 end
624 end 632 end
625 633
626 local OnClickFunctionButtonSecundario = function (self) 634 local OnClickFunctionButtonSecundario = function (self, button)
627 CoolTip.buttonClicked = true 635 CoolTip.buttonClicked = true
628 636
629 CoolTip:SetSelectedAnchor (frame2, self) 637 CoolTip:SetSelectedAnchor (frame2, self)
630 638
631 if (CoolTip.FunctionsTableSub [self.mainIndex] and CoolTip.FunctionsTableSub [self.mainIndex] [self.index]) then 639 if (CoolTip.FunctionsTableSub [self.mainIndex] and CoolTip.FunctionsTableSub [self.mainIndex] [self.index]) then
632 local parameterTable = CoolTip.ParametersTableSub [self.mainIndex] [self.index] 640 local parameterTable = CoolTip.ParametersTableSub [self.mainIndex] [self.index]
633 CoolTip.FunctionsTableSub [self.mainIndex] [self.index] (_, CoolTip.FixedValue, parameterTable [1], parameterTable [2], parameterTable [3]) 641 CoolTip.FunctionsTableSub [self.mainIndex] [self.index] (_, CoolTip.FixedValue, parameterTable [1], parameterTable [2], parameterTable [3], button)
634 end 642 end
635 643
636 local botao_p = frame1.Lines [self.mainIndex] 644 local botao_p = frame1.Lines [self.mainIndex]
637 CoolTip:SetSelectedAnchor (frame1, botao_p) 645 CoolTip:SetSelectedAnchor (frame1, botao_p)
638 646
755 menuButton.rightText:SetWidth (CoolTip.OptionsTable.RightTextWidth) 763 menuButton.rightText:SetWidth (CoolTip.OptionsTable.RightTextWidth)
756 else 764 else
757 menuButton.rightText:SetWidth (0) 765 menuButton.rightText:SetWidth (0)
758 end 766 end
759 767
760 if (CoolTip.OptionsTable.RightTextHeight) then
761 menuButton.rightText:SetHeight (CoolTip.OptionsTable.RightTextHeight)
762 else
763 menuButton.rightText:SetHeight (0)
764 end
765
766 if (CoolTip.OptionsTable.TextFont and not rightTextTable [7]) then 768 if (CoolTip.OptionsTable.TextFont and not rightTextTable [7]) then
767 if (_G [CoolTip.OptionsTable.TextFont]) then 769 if (_G [CoolTip.OptionsTable.TextFont]) then
768 menuButton.rightText:SetFontObject (CoolTip.OptionsTable.TextFont) 770 menuButton.rightText:SetFontObject (CoolTip.OptionsTable.TextFont)
769 else 771 else
770 local font = SharedMedia:Fetch ("font", CoolTip.OptionsTable.TextFont) 772 local font = SharedMedia:Fetch ("font", CoolTip.OptionsTable.TextFont)
850 menuButton.leftIcon:SetHeight (CoolTip.OptionsTable.IconSize) 852 menuButton.leftIcon:SetHeight (CoolTip.OptionsTable.IconSize)
851 menuButton.rightIcon:SetWidth (CoolTip.OptionsTable.IconSize) 853 menuButton.rightIcon:SetWidth (CoolTip.OptionsTable.IconSize)
852 menuButton.rightIcon:SetHeight (CoolTip.OptionsTable.IconSize) 854 menuButton.rightIcon:SetHeight (CoolTip.OptionsTable.IconSize)
853 end 855 end
854 856
857 menuButton.leftText:SetHeight (0)
858 menuButton.rightText:SetHeight (0)
859
855 if (CoolTip.Type == 2) then 860 if (CoolTip.Type == 2) then
856 CoolTip:LeftTextSpace (menuButton) 861 CoolTip:LeftTextSpace (menuButton)
862 end
863 if (CoolTip.OptionsTable.LeftTextHeight) then
864 menuButton.leftText:SetHeight (CoolTip.OptionsTable.LeftTextHeight)
865 end
866 if (CoolTip.OptionsTable.RightTextHeight) then
867 menuButton.rightText:SetHeight (CoolTip.OptionsTable.RightTextHeight)
857 end 868 end
858 869
859 --> string length 870 --> string length
860 if (not isSub) then --> main frame 871 if (not isSub) then --> main frame
861 if (not CoolTip.OptionsTable.FixedWidth) then 872 if (not CoolTip.OptionsTable.FixedWidth) then
864 if (stringWidth > frame.w) then 875 if (stringWidth > frame.w) then
865 frame.w = stringWidth 876 frame.w = stringWidth
866 end 877 end
867 end 878 end
868 else 879 else
869 menuButton.leftText:SetWidth (CoolTip.OptionsTable.FixedWidth - menuButton.leftIcon:GetWidth() - menuButton.rightText:GetStringWidth() - menuButton.rightIcon:GetWidth() - 30) 880 menuButton.leftText:SetWidth (CoolTip.OptionsTable.FixedWidth - menuButton.leftIcon:GetWidth() - menuButton.rightText:GetStringWidth() - menuButton.rightIcon:GetWidth() - 22)
870 end 881 end
871 else 882 else
872 if (not CoolTip.OptionsTable.FixedWidthSub) then 883 if (not CoolTip.OptionsTable.FixedWidthSub) then
873 if (CoolTip.Type == 1 or CoolTip.Type == 2) then 884 if (CoolTip.Type == 1 or CoolTip.Type == 2) then
874 local stringWidth = menuButton.leftText:GetStringWidth() + menuButton.rightText:GetStringWidth() + menuButton.leftIcon:GetWidth() + menuButton.rightIcon:GetWidth() 885 local stringWidth = menuButton.leftText:GetStringWidth() + menuButton.rightText:GetStringWidth() + menuButton.leftIcon:GetWidth() + menuButton.rightIcon:GetWidth()
875 if (stringWidth > frame.w) then 886 if (stringWidth > frame.w) then
876 frame.w = stringWidth 887 frame.w = stringWidth
877 end 888 end
878 end 889 end
879 else 890 else
880 menuButton.leftText:SetWidth (CoolTip.OptionsTable.FixedWidthSub - menuButton.leftIcon:GetWidth() - 20) 891 menuButton.leftText:SetWidth (CoolTip.OptionsTable.FixedWidthSub - menuButton.leftIcon:GetWidth() - 12)
881 end 892 end
882 end 893 end
883 894
884 local height = _math_max ( menuButton.leftIcon:GetHeight(), menuButton.rightIcon:GetHeight(), menuButton.leftText:GetStringHeight(), menuButton.rightText:GetStringHeight() ) 895 local height = _math_max ( menuButton.leftIcon:GetHeight(), menuButton.rightIcon:GetHeight(), menuButton.leftText:GetStringHeight(), menuButton.rightText:GetStringHeight() )
885 if (height > frame.hHeight) then 896 if (height > frame.hHeight) then
1009 CoolTip.LeftIconTableSub [mainMenuIndex] and CoolTip.LeftIconTableSub [mainMenuIndex] [index], 1020 CoolTip.LeftIconTableSub [mainMenuIndex] and CoolTip.LeftIconTableSub [mainMenuIndex] [index],
1010 CoolTip.RightIconTableSub [mainMenuIndex] and CoolTip.RightIconTableSub [mainMenuIndex] [index], true) 1021 CoolTip.RightIconTableSub [mainMenuIndex] and CoolTip.RightIconTableSub [mainMenuIndex] [index], true)
1011 --> setup statusbar 1022 --> setup statusbar
1012 CoolTip:StatusBar (menuButton, CoolTip.StatusBarTableSub [mainMenuIndex] and CoolTip.StatusBarTableSub [mainMenuIndex] [index]) 1023 CoolTip:StatusBar (menuButton, CoolTip.StatusBarTableSub [mainMenuIndex] and CoolTip.StatusBarTableSub [mainMenuIndex] [index])
1013 1024
1014
1015 --> click 1025 --> click
1016 menuButton:RegisterForClicks ("LeftButtonDown") 1026 menuButton:RegisterForClicks ("LeftButtonDown")
1017 1027
1018 menuButton:ClearAllPoints() 1028 menuButton:ClearAllPoints()
1019 menuButton:SetPoint ("center", frame2, "center") 1029 menuButton:SetPoint ("center", frame2, "center")
1020 menuButton:SetPoint ("top", frame2, "top", 0, (((index-1)*20)*-1)-3) 1030 menuButton:SetPoint ("top", frame2, "top", 0, (((index-1)*20)*-1)-3)
1021 menuButton:SetPoint ("left", frame2, "left") 1031 menuButton:SetPoint ("left", frame2, "left", -4, 0)
1022 menuButton:SetPoint ("right", frame2, "right") 1032 menuButton:SetPoint ("right", frame2, "right", 4, 0)
1023 1033
1024 DF:FadeFrame (menuButton, 0) 1034 DF:FadeFrame (menuButton, 0)
1025 1035
1026 --> string length 1036 --> string length
1027 local stringWidth = menuButton.leftText:GetStringWidth() + menuButton.rightText:GetStringWidth() + menuButton.leftIcon:GetWidth() + menuButton.rightIcon:GetWidth() 1037 local stringWidth = menuButton.leftText:GetStringWidth() + menuButton.rightText:GetStringWidth() + menuButton.leftIcon:GetWidth() + menuButton.rightIcon:GetWidth()
1158 1168
1159 --> points 1169 --> points
1160 menuButton:ClearAllPoints() 1170 menuButton:ClearAllPoints()
1161 1171
1162 menuButton:SetPoint ("center", frame2, "center") 1172 menuButton:SetPoint ("center", frame2, "center")
1163 menuButton:SetPoint ("left", frame2, "left") 1173 menuButton:SetPoint ("left", frame2, "left", -4, 0)
1164 menuButton:SetPoint ("right", frame2, "right") 1174 menuButton:SetPoint ("right", frame2, "right", 4, 0)
1165 1175
1166 menuButton.rightText:SetText ("") 1176 menuButton.rightText:SetText ("")
1167 1177
1168 local div_size_up = tonumber (CoolTip.RightTextTableSub [index] [i] [2]) 1178 local div_size_up = tonumber (CoolTip.RightTextTableSub [index] [i] [2])
1169 if (not div_size_up) then 1179 if (not div_size_up) then
1202 menuButton:SetPoint ("center", frame2, "center") 1212 menuButton:SetPoint ("center", frame2, "center")
1203 menuButton:SetPoint ("top", frame2, "top", 0, ( ( (i-1) * frame2.hHeight) * -1) - 4 + (CoolTip.OptionsTable.ButtonsYModSub or 0) + spacing) 1213 menuButton:SetPoint ("top", frame2, "top", 0, ( ( (i-1) * frame2.hHeight) * -1) - 4 + (CoolTip.OptionsTable.ButtonsYModSub or 0) + spacing)
1204 if (CoolTip.OptionsTable.YSpacingModSub) then 1214 if (CoolTip.OptionsTable.YSpacingModSub) then
1205 spacing = spacing + CoolTip.OptionsTable.YSpacingModSub 1215 spacing = spacing + CoolTip.OptionsTable.YSpacingModSub
1206 end 1216 end
1207 menuButton:SetPoint ("left", frame2, "left") 1217 menuButton:SetPoint ("left", frame2, "left", -4, 0)
1208 menuButton:SetPoint ("right", frame2, "right") 1218 menuButton:SetPoint ("right", frame2, "right", 4, 0)
1209 1219
1210 if (menuButton.divbar) then 1220 if (menuButton.divbar) then
1211 menuButton.divbar:Hide() 1221 menuButton.divbar:Hide()
1212 menuButton.isDiv = false 1222 menuButton.isDiv = false
1213 end 1223 end
1246 if (CoolTip.OptionsTable.SubFollowButton and not CoolTip.frame2_leftside) then 1256 if (CoolTip.OptionsTable.SubFollowButton and not CoolTip.frame2_leftside) then
1247 1257
1248 local button = frame1.Lines [index] 1258 local button = frame1.Lines [index]
1249 1259
1250 frame2:ClearAllPoints() 1260 frame2:ClearAllPoints()
1251 frame2:SetPoint ("left", button, "right") 1261 frame2:SetPoint ("left", button, "right", 4, 0)
1252 1262
1253 elseif (CoolTip.OptionsTable.SubFollowButton and CoolTip.frame2_leftside) then 1263 elseif (CoolTip.OptionsTable.SubFollowButton and CoolTip.frame2_leftside) then
1254 1264
1255 local button = frame1.Lines [index] 1265 local button = frame1.Lines [index]
1256 1266
1257 frame2:ClearAllPoints() 1267 frame2:ClearAllPoints()
1258 frame2:SetPoint ("right", button, "left") 1268 frame2:SetPoint ("right", button, "left", -4, 0)
1259 1269
1260 elseif (CoolTip.frame2_leftside) then 1270 elseif (CoolTip.frame2_leftside) then
1261 frame2:ClearAllPoints() 1271 frame2:ClearAllPoints()
1262 frame2:SetPoint ("bottomright", frame1, "bottomleft") 1272 frame2:SetPoint ("bottomright", frame1, "bottomleft", -4, 0)
1263 else 1273 else
1264 frame2:ClearAllPoints() 1274 frame2:ClearAllPoints()
1265 frame2:SetPoint ("bottomleft", frame1, "bottomright") 1275 frame2:SetPoint ("bottomleft", frame1, "bottomright", 4, 0)
1266 end 1276 end
1267 1277
1268 end 1278 end
1269 1279
1270 function CoolTip:HideSub() 1280 function CoolTip:HideSub()
1337 for i = 1, CoolTip.Indexes do 1347 for i = 1, CoolTip.Indexes do
1338 local menuButton = frame1.Lines [i] 1348 local menuButton = frame1.Lines [i]
1339 1349
1340 menuButton:ClearAllPoints() 1350 menuButton:ClearAllPoints()
1341 menuButton:SetPoint ("center", frame1, "center") 1351 menuButton:SetPoint ("center", frame1, "center")
1342 menuButton:SetPoint ("left", frame1, "left") 1352 menuButton:SetPoint ("left", frame1, "left", -4, 0)
1343 menuButton:SetPoint ("right", frame1, "right") 1353 menuButton:SetPoint ("right", frame1, "right", 4, 0)
1344 1354
1345 --> height 1355 --> height
1346 if (CoolTip.OptionsTable.AlignAsBlizzTooltip) then 1356 if (CoolTip.OptionsTable.AlignAsBlizzTooltip) then
1347 local height = _math_max (8, menuButton.leftText:GetStringHeight(), menuButton.rightText:GetStringHeight(), menuButton.leftIcon:GetHeight(), menuButton.rightIcon:GetHeight()) 1357 local height = _math_max (8, menuButton.leftText:GetStringHeight(), menuButton.rightText:GetStringHeight(), menuButton.leftIcon:GetHeight(), menuButton.rightIcon:GetHeight())
1348 menuButton:SetHeight (height) 1358 menuButton:SetHeight (height)
1529 1539
1530 --> height 1540 --> height
1531 menuButton:SetHeight (4) 1541 menuButton:SetHeight (4)
1532 --> points 1542 --> points
1533 menuButton:ClearAllPoints() 1543 menuButton:ClearAllPoints()
1534 menuButton:SetPoint ("left", frame1, "left") 1544 menuButton:SetPoint ("left", frame1, "left", -4, 0)
1535 menuButton:SetPoint ("right", frame1, "right") 1545 menuButton:SetPoint ("right", frame1, "right", 4, 0)
1536 menuButton:SetPoint ("center", frame1, "center") 1546 menuButton:SetPoint ("center", frame1, "center")
1537 1547
1538 local div_size_up = tonumber (CoolTip.LeftTextTable [i] [2]) 1548 local div_size_up = tonumber (CoolTip.LeftTextTable [i] [2])
1539 if (not div_size_up) then 1549 if (not div_size_up) then
1540 div_size_up = 0 1550 div_size_up = 0
1572 menuButton:SetPoint ("center", frame1, "center") 1582 menuButton:SetPoint ("center", frame1, "center")
1573 menuButton:SetPoint ("top", frame1, "top", 0, ( ( (i-1) * frame1.hHeight) * -1) - 4 + (CoolTip.OptionsTable.ButtonsYMod or 0) + spacing) 1583 menuButton:SetPoint ("top", frame1, "top", 0, ( ( (i-1) * frame1.hHeight) * -1) - 4 + (CoolTip.OptionsTable.ButtonsYMod or 0) + spacing)
1574 if (CoolTip.OptionsTable.YSpacingMod) then 1584 if (CoolTip.OptionsTable.YSpacingMod) then
1575 spacing = spacing + CoolTip.OptionsTable.YSpacingMod 1585 spacing = spacing + CoolTip.OptionsTable.YSpacingMod
1576 end 1586 end
1577 menuButton:SetPoint ("left", frame1, "left") 1587 menuButton:SetPoint ("left", frame1, "left", -4, 0)
1578 menuButton:SetPoint ("right", frame1, "right") 1588 menuButton:SetPoint ("right", frame1, "right", 4, 0)
1579 1589
1580 if (menuButton.divbar) then 1590 if (menuButton.divbar) then
1581 menuButton.divbar:Hide() 1591 menuButton.divbar:Hide()
1582 menuButton.isDiv = false 1592 menuButton.isDiv = false
1583 end 1593 end
1709 if (f2_start_point < f1_end_point) then 1719 if (f2_start_point < f1_end_point) then
1710 local diff = f2_start_point - f1_end_point 1720 local diff = f2_start_point - f1_end_point
1711 CoolTip.overlap_checked = true 1721 CoolTip.overlap_checked = true
1712 1722
1713 frame2:ClearAllPoints() 1723 frame2:ClearAllPoints()
1714 frame2:SetPoint ("bottomright", frame1, "bottomleft") 1724 frame2:SetPoint ("bottomright", frame1, "bottomleft", 4, 0)
1715 CoolTip.frame2_leftside = true 1725 CoolTip.frame2_leftside = true
1716 --> diff 1726 --> diff
1717 return CoolTip:SetMyPoint (host, CoolTip.internal_x_mod , CoolTip.internal_y_mod) 1727 return CoolTip:SetMyPoint (host, CoolTip.internal_x_mod , CoolTip.internal_y_mod)
1718 end 1728 end
1719 1729
1741 1751
1742 if (f2_start_point < f1_end_point) then 1752 if (f2_start_point < f1_end_point) then
1743 local diff = f2_start_point - f1_end_point 1753 local diff = f2_start_point - f1_end_point
1744 1754
1745 frame2:ClearAllPoints() 1755 frame2:ClearAllPoints()
1746 frame2:SetPoint ("bottomright", frame1, "bottomleft") 1756 frame2:SetPoint ("bottomright", frame1, "bottomleft", 4, 0)
1747 CoolTip.frame2_leftside = true 1757 CoolTip.frame2_leftside = true
1748 end 1758 end
1749 1759
1750 end 1760 end
1751 end 1761 end
1969 1979
1970 --> wipe all data ~reset 1980 --> wipe all data ~reset
1971 function CoolTip:Reset() 1981 function CoolTip:Reset()
1972 1982
1973 frame2:ClearAllPoints() 1983 frame2:ClearAllPoints()
1974 frame2:SetPoint ("bottomleft", frame1, "bottomright") 1984 frame2:SetPoint ("bottomleft", frame1, "bottomright", 4, 0)
1975 1985
1986 frame1:SetParent (UIParent)
1987 frame2:SetParent (UIParent)
1988 frame1:SetFrameStrata ("TOOLTIP")
1989 frame2:SetFrameStrata ("TOOLTIP")
1990
1976 CoolTip:HideSelectedTexture (frame1) 1991 CoolTip:HideSelectedTexture (frame1)
1977 CoolTip:HideSelectedTexture (frame2) 1992 CoolTip:HideSelectedTexture (frame2)
1978 1993
1979 CoolTip.FixedValue = nil 1994 CoolTip.FixedValue = nil
1980 CoolTip.HaveSubMenu = false 1995 CoolTip.HaveSubMenu = false
2844 return CoolTip:ShowCooltip (frame, menuType, color) 2859 return CoolTip:ShowCooltip (frame, menuType, color)
2845 end 2860 end
2846 2861
2847 function CoolTip:ShowCooltip (frame, menuType, color) 2862 function CoolTip:ShowCooltip (frame, menuType, color)
2848 2863
2864 frame1:SetFrameStrata ("TOOLTIP")
2865 frame2:SetFrameStrata ("TOOLTIP")
2866 frame1:SetParent (UIParent)
2867 frame2:SetParent (UIParent)
2868
2849 CoolTip.had_interaction = false 2869 CoolTip.had_interaction = false
2850 2870
2851 if (frame) then 2871 if (frame) then
2852 --> details framework 2872 --> details framework
2853 if (frame.dframework) then 2873 if (frame.dframework) then
3064 self:SetOption ("FixedWidth", 220) 3084 self:SetOption ("FixedWidth", 220)
3065 self:SetOption ("ButtonsYMod", -4) 3085 self:SetOption ("ButtonsYMod", -4)
3066 self:SetOption ("YSpacingMod", -4) 3086 self:SetOption ("YSpacingMod", -4)
3067 self:SetOption ("IgnoreButtonAutoHeight", true) 3087 self:SetOption ("IgnoreButtonAutoHeight", true)
3068 3088
3069 --self:SetColor (1, 0.5, 0.5, 0.5, 0.5)
3070 self:SetColor (1, 0.5, 0.5, 0.5, 0) 3089 self:SetColor (1, 0.5, 0.5, 0.5, 0)
3071 3090
3072 self:SetBackdrop (1, preset2_backdrop, gray_table, black_table) 3091 self:SetBackdrop (1, preset2_backdrop, gray_table, black_table)
3092 self:SetBackdrop (2, preset2_backdrop, gray_table, black_table)
3073 end 3093 end
3074 end 3094 end
3075 3095
3076 return CoolTip 3096 return CoolTip
3077 3097