Visualize better mythic plus segments

This commit is contained in:
Tercio Jose
2022-12-22 22:18:28 -03:00
parent eef2d19cef
commit ce9a3b875b
9 changed files with 165 additions and 44 deletions
+29 -12
View File
@@ -15,7 +15,7 @@ local max = math.max
--api locals
local PixelUtil = PixelUtil or DFPixelUtil
local version = 10
local version = 11
local CONST_MENU_TYPE_MAINMENU = "main"
local CONST_MENU_TYPE_SUBMENU = "sub"
@@ -2628,23 +2628,32 @@ function DF:CreateCoolTip()
wallpaperTable[7] = desaturate
end
function gameCooltip:SetBannerText(index, text, anchor, color, fontSize, fontFace, fontFlag)
function gameCooltip:SetBannerText(menuType, index, text, anchor, color, fontSize, fontFace, fontFlag)
menuType = gameCooltip:ParseMenuType(menuType)
local frame
if (menuType == CONST_MENU_TYPE_MAINMENU) then
frame = frame1
elseif (menuType == CONST_MENU_TYPE_SUBMENU) then
frame = frame2
end
local fontstring
if (index == 1) then
fontstring = frame1.upperImageText
fontstring = frame.upperImageText
elseif (index == 2) then
fontstring = frame1.upperImageText2
fontstring = frame.upperImageText2
end
fontstring:SetText(text or "")
if (anchor and index == 1) then
local myAnchor, hisAnchor, x, y = unpack(anchor)
fontstring:SetPoint(myAnchor, frame1.upperImage, hisAnchor or myAnchor, x or 0, y or 0)
fontstring:SetPoint(myAnchor, frame.upperImage, hisAnchor or myAnchor, x or 0, y or 0)
elseif (anchor and index == 2) then
local myAnchor, hisAnchor, x, y = unpack(anchor)
fontstring:SetPoint(myAnchor, frame1, hisAnchor or myAnchor, x or 0, y or 0)
fontstring:SetPoint(myAnchor, frame, hisAnchor or myAnchor, x or 0, y or 0)
end
if (color) then
@@ -2667,7 +2676,6 @@ function DF:CreateCoolTip()
if (menuType == CONST_MENU_TYPE_MAINMENU) then
frame = frame1
elseif (menuType == CONST_MENU_TYPE_SUBMENU) then
frame = frame2
end
@@ -2685,12 +2693,21 @@ function DF:CreateCoolTip()
end
end
function gameCooltip:SetBannerImage(index, texturePath, width, height, anchor, texCoord, overlay)
function gameCooltip:SetBannerImage(menuType, index, texturePath, width, height, anchor, texCoord, overlay)
menuType = gameCooltip:ParseMenuType(menuType)
local frame
if (menuType == CONST_MENU_TYPE_MAINMENU) then
frame = frame1
elseif(menuType == CONST_MENU_TYPE_SUBMENU) then
frame = frame2
end
local texture
if (index == 1) then
texture = frame1.upperImage
texture = frame.upperImage
elseif (index == 2) then
texture = frame1.upperImage2
texture = frame.upperImage2
end
if (texturePath) then
@@ -2708,11 +2725,11 @@ function DF:CreateCoolTip()
if (type(anchor[1]) == "table") then
for anchorIndex, anchorPoints in ipairs(anchor) do
local myAnchor, hisAnchor, x, y = unpack(anchorPoints)
texture:SetPoint(myAnchor, frame1, hisAnchor or myAnchor, x or 0, y or 0)
texture:SetPoint(myAnchor, frame, hisAnchor or myAnchor, x or 0, y or 0)
end
else
local myAnchor, hisAnchor, x, y = unpack(anchor)
texture:SetPoint(myAnchor, frame1, hisAnchor or myAnchor, x or 0, y or 0)
texture:SetPoint(myAnchor, frame, hisAnchor or myAnchor, x or 0, y or 0)
end
end