Mercurial > wow > hansgar_and_franzok_assist
comparison Libs/DF/cooltip.lua @ 29:5da06cb420d4
- framework update.
| author | Tercioo |
|---|---|
| date | Sat, 02 Jan 2016 13:33:05 -0200 |
| parents | e16b1fc13935 |
| children | d1963bd45219 |
comparison
equal
deleted
inserted
replaced
| 28:7523376ecaa3 | 29:5da06cb420d4 |
|---|---|
| 891 menuButton.spark2:ClearAllPoints() | 891 menuButton.spark2:ClearAllPoints() |
| 892 menuButton.spark2:SetPoint ("left", menuButton.statusbar, "left", menuButton.statusbar:GetValue() * (menuButton.statusbar:GetWidth()/100) - 16, 0) | 892 menuButton.spark2:SetPoint ("left", menuButton.statusbar, "left", menuButton.statusbar:GetValue() * (menuButton.statusbar:GetWidth()/100) - 16, 0) |
| 893 end | 893 end |
| 894 | 894 |
| 895 function CoolTip:StatusBar (menuButton, StatusBar) | 895 function CoolTip:StatusBar (menuButton, StatusBar) |
| 896 | 896 |
| 897 if (StatusBar) then | 897 if (StatusBar) then |
| 898 | 898 |
| 899 menuButton.statusbar:SetValue (StatusBar [1]) | 899 menuButton.statusbar:SetValue (StatusBar [1]) |
| 900 menuButton.statusbar:SetStatusBarColor (StatusBar [2], StatusBar [3], StatusBar [4], StatusBar [5]) | 900 menuButton.statusbar:SetStatusBarColor (StatusBar [2], StatusBar [3], StatusBar [4], StatusBar [5]) |
| 901 menuButton.statusbar:SetHeight (20 + (CoolTip.OptionsTable.StatusBarHeightMod or 0)) | 901 menuButton.statusbar:SetHeight (20 + (CoolTip.OptionsTable.StatusBarHeightMod or 0)) |
| 924 else | 924 else |
| 925 menuButton.statusbar2:SetValue (0) | 925 menuButton.statusbar2:SetValue (0) |
| 926 menuButton.spark2:Hide() | 926 menuButton.spark2:Hide() |
| 927 end | 927 end |
| 928 | 928 |
| 929 if (StatusBar [8]) then | |
| 930 local texture = SharedMedia:Fetch ("statusbar", StatusBar [8], true) | |
| 931 if (texture) then | |
| 932 menuButton.statusbar.texture:SetTexture (texture) | |
| 933 else | |
| 934 menuButton.statusbar.texture:SetTexture (StatusBar [8]) | |
| 935 end | |
| 936 elseif (CoolTip.OptionsTable.StatusBarTexture) then | |
| 937 local texture = SharedMedia:Fetch ("statusbar", CoolTip.OptionsTable.StatusBarTexture, true) | |
| 938 if (texture) then | |
| 939 menuButton.statusbar.texture:SetTexture (texture) | |
| 940 else | |
| 941 menuButton.statusbar.texture:SetTexture (CoolTip.OptionsTable.StatusBarTexture) | |
| 942 end | |
| 943 else | |
| 944 menuButton.statusbar.texture:SetTexture ("Interface\\PaperDollInfoFrame\\UI-Character-Skills-Bar") | |
| 945 end | |
| 946 | |
| 947 --[[ | |
| 929 if (CoolTip.OptionsTable.StatusBarTexture) then | 948 if (CoolTip.OptionsTable.StatusBarTexture) then |
| 930 menuButton.statusbar.texture:SetTexture (CoolTip.OptionsTable.StatusBarTexture) | 949 menuButton.statusbar.texture:SetTexture (CoolTip.OptionsTable.StatusBarTexture) |
| 931 else | 950 else |
| 932 menuButton.statusbar.texture:SetTexture ("Interface\\PaperDollInfoFrame\\UI-Character-Skills-Bar") | 951 menuButton.statusbar.texture:SetTexture ("Interface\\PaperDollInfoFrame\\UI-Character-Skills-Bar") |
| 933 end | 952 end |
| 934 | 953 --]] |
| 935 else | 954 else |
| 936 menuButton.statusbar:SetValue (0) | 955 menuButton.statusbar:SetValue (0) |
| 937 menuButton.statusbar2:SetValue (0) | 956 menuButton.statusbar2:SetValue (0) |
| 938 menuButton.spark:Hide() | 957 menuButton.spark:Hide() |
| 939 menuButton.spark2:Hide() | 958 menuButton.spark2:Hide() |
| 940 end | 959 end |
| 941 | 960 |
| 942 if (CoolTip.OptionsTable.LeftBorderSize) then | 961 if (CoolTip.OptionsTable.LeftBorderSize) then |
| 943 menuButton.statusbar:SetPoint ("left", menuButton, "left", 10 + CoolTip.OptionsTable.LeftBorderSize, 0) | 962 menuButton.statusbar:SetPoint ("left", menuButton, "left", 10 + CoolTip.OptionsTable.LeftBorderSize, 0) |
| 944 else | 963 else |
| 945 menuButton.statusbar:SetPoint ("left", menuButton, "left", 10, 0) | 964 menuButton.statusbar:SetPoint ("left", menuButton, "left", 10, 0) |
| 946 end | 965 end |
| 1380 if (CoolTip.OptionsTable.AlignAsBlizzTooltip) then | 1399 if (CoolTip.OptionsTable.AlignAsBlizzTooltip) then |
| 1381 frame1:SetHeight ( (temp-10) * -1) | 1400 frame1:SetHeight ( (temp-10) * -1) |
| 1382 elseif (CoolTip.OptionsTable.IgnoreButtonAutoHeight) then | 1401 elseif (CoolTip.OptionsTable.IgnoreButtonAutoHeight) then |
| 1383 frame1:SetHeight ( (temp+spacing) * -1) | 1402 frame1:SetHeight ( (temp+spacing) * -1) |
| 1384 else | 1403 else |
| 1385 frame1:SetHeight ( _math_max ( (frame1.hHeight * CoolTip.Indexes) + 12, 22 )) | 1404 frame1:SetHeight ( _math_max ( (frame1.hHeight * CoolTip.Indexes) + 8 + ((CoolTip.OptionsTable.ButtonsYMod or 0)*-1), 22 )) |
| 1386 end | 1405 end |
| 1387 end | 1406 end |
| 1388 | 1407 |
| 1389 if (CoolTip.WallpaperTable [1]) then | 1408 if (CoolTip.WallpaperTable [1]) then |
| 1390 CoolTip:SetupWallpaper (CoolTip.WallpaperTable, frame1.frameWallpaper) | 1409 CoolTip:SetupWallpaper (CoolTip.WallpaperTable, frame1.frameWallpaper) |
| 1936 end | 1955 end |
| 1937 | 1956 |
| 1938 ---------------------------------------------------------------------- | 1957 ---------------------------------------------------------------------- |
| 1939 --> Reset cooltip | 1958 --> Reset cooltip |
| 1940 | 1959 |
| 1941 local default_backdrop = {bgFile=[[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile=[[Interface\Tooltips\UI-Tooltip-Border]], tile=true, | 1960 local default_backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\Buttons\WHITE8X8]], tile = true, |
| 1942 edgeSize=16, tileSize=16, insets = {left=3, right=3, top=4, bottom=4}} | 1961 edgeSize = 1, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}} |
| 1943 local default_backdrop_color = {0.09019, 0.09019, 0.18823, 1} | 1962 local default_backdrop_color = {0.09019, 0.09019, 0.18823, 1} |
| 1944 local default_backdropborder_color = {1, 1, 1, 1} | 1963 local default_backdropborder_color = {1, 1, 1, 1} |
| 1945 | 1964 |
| 1946 --borda preta sem usar unpack | 1965 --borda preta sem usar unpack |
| 1947 | 1966 |
| 2230 --> adds a statusbar to the last line added. | 2249 --> adds a statusbar to the last line added. |
| 2231 --> only works with cooltip type 2 (tooltip with bars) | 2250 --> only works with cooltip type 2 (tooltip with bars) |
| 2232 --> parameters: value [, color red, color green, color blue, color alpha [, glow]] | 2251 --> parameters: value [, color red, color green, color blue, color alpha [, glow]] |
| 2233 --> can also use a table or html color name in color red and send glow in color green | 2252 --> can also use a table or html color name in color red and send glow in color green |
| 2234 | 2253 |
| 2235 function CoolTip:AddStatusBar (statusbarValue, frame, ColorR, ColorG, ColorB, ColorA, statusbarGlow, backgroundBar) | 2254 function CoolTip:AddStatusBar (statusbarValue, frame, ColorR, ColorG, ColorB, ColorA, statusbarGlow, backgroundBar, barTexture) |
| 2236 | 2255 |
| 2237 --> need a previous line | 2256 --> need a previous line |
| 2238 if (CoolTip.Indexes == 0) then | 2257 if (CoolTip.Indexes == 0) then |
| 2239 return --> return error | 2258 return --> return error |
| 2240 end | 2259 end |
| 2303 statusbarTable [3] = ColorG | 2322 statusbarTable [3] = ColorG |
| 2304 statusbarTable [4] = ColorB | 2323 statusbarTable [4] = ColorB |
| 2305 statusbarTable [5] = ColorA | 2324 statusbarTable [5] = ColorA |
| 2306 statusbarTable [6] = statusbarGlow | 2325 statusbarTable [6] = statusbarGlow |
| 2307 statusbarTable [7] = backgroundBar | 2326 statusbarTable [7] = backgroundBar |
| 2327 statusbarTable [8] = barTexture | |
| 2308 | 2328 |
| 2309 end | 2329 end |
| 2310 | 2330 |
| 2311 frame1.frameWallpaper:Hide() | 2331 frame1.frameWallpaper:Hide() |
| 2312 frame2.frameWallpaper:Hide() | 2332 frame2.frameWallpaper:Hide() |
