Bookmark code cleanup and framework update
This commit is contained in:
+73
-31
@@ -18,7 +18,7 @@ local PixelUtil = PixelUtil or DFPixelUtil
|
||||
local version = 3
|
||||
|
||||
local CONST_MENU_TYPE_MAINMENU = "main"
|
||||
local CONST_MENU_TYPE_SUBMENU = "sec"
|
||||
local CONST_MENU_TYPE_SUBMENU = "sub"
|
||||
local CONST_COOLTIP_TYPE_MENU = "menu"
|
||||
local CONST_COOLTIP_TYPE_TOOLTIP = "tooltip"
|
||||
|
||||
@@ -52,6 +52,18 @@ function DF:CreateCoolTip()
|
||||
gameCooltip.debug = bDebugState
|
||||
end
|
||||
|
||||
function gameCooltip:ParseMenuType(menuType)
|
||||
if ((type(menuType) == "number" and menuType == 1) or (type(menuType) == "string" and menuType == CONST_MENU_TYPE_MAINMENU)) then
|
||||
return CONST_MENU_TYPE_MAINMENU
|
||||
end
|
||||
|
||||
if ((type(menuType) == "number" and menuType == 2) or (type(menuType) == "string" and menuType == CONST_MENU_TYPE_SUBMENU)) then
|
||||
return CONST_MENU_TYPE_SUBMENU
|
||||
end
|
||||
|
||||
return CONST_MENU_TYPE_MAINMENU
|
||||
end
|
||||
|
||||
--containers
|
||||
gameCooltip.LeftTextTable = {}
|
||||
gameCooltip.LeftTextTableSub = {}
|
||||
@@ -180,12 +192,14 @@ function DF:CreateCoolTip()
|
||||
self:SetBackdropColor(DF:ParseColors(defaultBackdropColor))
|
||||
self:SetBackdropBorderColor(DF:ParseColors(defaultBackdropBorderColor))
|
||||
|
||||
--this texture get the color from gameCooltip:SetColor()
|
||||
if (not self.frameBackgroundTexture) then
|
||||
self.frameBackgroundTexture = self:CreateTexture("$parent_FrameBackgroundTexture", "BACKGROUND", nil, 2)
|
||||
self.frameBackgroundTexture:SetColorTexture(0, 0, 0, 0)
|
||||
self.frameBackgroundTexture:SetAllPoints()
|
||||
end
|
||||
|
||||
--this get the texture from gameCooltip:SetWallpaper(index, texture, texcoord, color, desaturate)
|
||||
if (not self.frameWallpaper) then
|
||||
self.frameWallpaper = self:CreateTexture("$parent_FrameWallPaper", "BACKGROUND", nil, 4)
|
||||
self.frameWallpaper:SetPoint("TOPLEFT", self, "TOPLEFT", 0, 0)
|
||||
@@ -198,6 +212,12 @@ function DF:CreateCoolTip()
|
||||
self.selectedTop:SetHeight(3)
|
||||
end
|
||||
|
||||
if (not self.gradientTexture) then
|
||||
self.gradientTexture = DetailsFramework:CreateTexture(self, {gradient = "vertical", fromColor = {0, 0, 0, .2}, toColor = {0, 0, 0, 0}}, 1, 1, "overlay", {0, 1, 0, 1})
|
||||
self.gradientTexture.sublevel = -7
|
||||
self.gradientTexture:SetAllPoints()
|
||||
end
|
||||
|
||||
if (not self.selectedBottom) then
|
||||
self.selectedBottom = self:CreateTexture("$parent_SelectedBottom", "ARTWORK")
|
||||
self.selectedBottom:SetColorTexture(.5, .5, .5, .75)
|
||||
@@ -211,13 +231,6 @@ function DF:CreateCoolTip()
|
||||
self.selectedMiddle:SetPoint("BOTTOMRIGHT", self.selectedBottom, "TOPRIGHT")
|
||||
end
|
||||
|
||||
if (not self.upperImage2) then
|
||||
self.upperImage2 = self:CreateTexture("$parent_UpperImage2", "ARTWORK")
|
||||
self.upperImage2:SetPoint("CENTER", self, "CENTER", 0, -3)
|
||||
self.upperImage2:SetPoint("BOTTOM", self, "TOP", 0, -3)
|
||||
self.upperImage2:Hide()
|
||||
end
|
||||
|
||||
if (not self.upperImage) then
|
||||
self.upperImage = self:CreateTexture("$parent_UpperImage", "OVERLAY")
|
||||
self.upperImage:SetPoint("CENTER", self, "CENTER", 0, -3)
|
||||
@@ -225,6 +238,13 @@ function DF:CreateCoolTip()
|
||||
self.upperImage:Hide()
|
||||
end
|
||||
|
||||
if (not self.upperImage2) then
|
||||
self.upperImage2 = self:CreateTexture("$parent_UpperImage2", "ARTWORK")
|
||||
self.upperImage2:SetPoint("CENTER", self, "CENTER", 0, -3)
|
||||
self.upperImage2:SetPoint("BOTTOM", self, "TOP", 0, -3)
|
||||
self.upperImage2:Hide()
|
||||
end
|
||||
|
||||
if (not self.upperImageText) then
|
||||
self.upperImageText = self:CreateFontString("$parent_UpperImageText", "OVERLAY", "GameTooltipHeaderText")
|
||||
self.upperImageText:SetJustifyH("LEFT")
|
||||
@@ -2027,7 +2047,9 @@ function DF:CreateCoolTip()
|
||||
--set tooltip color
|
||||
function gameCooltip:SetColor(menuType, ...)
|
||||
local colorRed, colorGreen, colorBlue, colorAlpha = DF:ParseColors(...)
|
||||
if ((type(menuType) == "string" and menuType == CONST_MENU_TYPE_MAINMENU) or (type(menuType) == "number" and menuType == 1)) then
|
||||
menuType = gameCooltip:ParseMenuType(menuType)
|
||||
|
||||
if (menuType == CONST_MENU_TYPE_MAINMENU) then
|
||||
frame1.frameBackgroundTexture:SetColorTexture(colorRed, colorGreen, colorBlue, colorAlpha)
|
||||
|
||||
--hide textures from older versions if exists
|
||||
@@ -2037,7 +2059,7 @@ function DF:CreateCoolTip()
|
||||
frame1.frameBackgroundCenter:Hide()
|
||||
end
|
||||
|
||||
elseif ((type(menuType) == "string" and menuType == CONST_MENU_TYPE_SUBMENU) or (type(menuType) == "number" and menuType == 2)) then
|
||||
elseif (menuType == CONST_MENU_TYPE_SUBMENU) then
|
||||
frame2.frameBackgroundTexture:SetColorTexture(colorRed, colorGreen, colorBlue, colorAlpha)
|
||||
|
||||
--hide textures from older versions if exists
|
||||
@@ -2054,10 +2076,14 @@ function DF:CreateCoolTip()
|
||||
--set last selected option
|
||||
function gameCooltip:SetLastSelected(menuType, index, index2)
|
||||
if (gameCooltip.Type == 3) then
|
||||
if ((type(menuType) == "string" and menuType == CONST_MENU_TYPE_MAINMENU) or (type(menuType) == "number" and menuType == 1)) then
|
||||
menuType = gameCooltip:ParseMenuType(menuType)
|
||||
|
||||
if (menuType == CONST_MENU_TYPE_MAINMENU) then
|
||||
gameCooltip.SelectedIndexMain = index
|
||||
elseif ((type(menuType) == "string" and menuType == CONST_MENU_TYPE_SUBMENU) or (type(menuType) == "number" and menuType == 2)) then
|
||||
|
||||
elseif (menuType == CONST_MENU_TYPE_SUBMENU) then
|
||||
gameCooltip.SelectedIndexSec[index] = index2
|
||||
|
||||
else
|
||||
return gameCooltip:PrintDebug("SetLastSelected() unknown menuType.", menuType)
|
||||
end
|
||||
@@ -2179,7 +2205,9 @@ function DF:CreateCoolTip()
|
||||
--menu functions
|
||||
local defaultWhiteColor = {1, 1, 1}
|
||||
function gameCooltip:AddMenu(menuType, func, param1, param2, param3, leftText, leftIcon, indexUp)
|
||||
if (leftText and indexUp and ((type(menuType) == "string" and menuType == CONST_MENU_TYPE_MAINMENU) or (type(menuType) == "number" and menuType == 1))) then
|
||||
menuType = gameCooltip:ParseMenuType(menuType)
|
||||
|
||||
if (leftText and indexUp and (menuType == CONST_MENU_TYPE_MAINMENU)) then
|
||||
gameCooltip.Indexes = gameCooltip.Indexes + 1
|
||||
if (not gameCooltip.IndexesSub[gameCooltip.Indexes]) then
|
||||
gameCooltip.IndexesSub[gameCooltip.Indexes] = 0
|
||||
@@ -2197,7 +2225,7 @@ function DF:CreateCoolTip()
|
||||
return gameCooltip:PrintDebug("AddMenu() no function passed.")
|
||||
end
|
||||
|
||||
if ((type(menuType) == "string" and menuType == CONST_MENU_TYPE_MAINMENU) or (type(menuType) == "number" and menuType == 1)) then
|
||||
if (menuType == CONST_MENU_TYPE_MAINMENU) then
|
||||
local parameterTable
|
||||
if (gameCooltip.isSpecial) then
|
||||
parameterTable = {}
|
||||
@@ -2248,10 +2276,10 @@ function DF:CreateCoolTip()
|
||||
lineTable_Left[8] = false
|
||||
end
|
||||
|
||||
elseif ((type(menuType) == "string" and menuType == CONST_MENU_TYPE_SUBMENU) or (type(menuType) == "number" and menuType == 2)) then
|
||||
elseif (menuType == CONST_MENU_TYPE_SUBMENU) then
|
||||
if (gameCooltip.SubIndexes == 0) then
|
||||
if (not indexUp or not leftText) then
|
||||
return gameCooltip:PrintDebug("AddMenu() attempt to add a submenu with a parent.") --error[leftText can't be nil if indexUp are true]
|
||||
return gameCooltip:PrintDebug("AddMenu() attempt to add a submenu with a parent.")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2260,7 +2288,7 @@ function DF:CreateCoolTip()
|
||||
gameCooltip.IndexesSub[gameCooltip.Indexes] = gameCooltip.IndexesSub[gameCooltip.Indexes] + 1
|
||||
|
||||
elseif (indexUp and not leftText) then
|
||||
return gameCooltip:PrintDebug("AddMenu() attempt to add a submenu with a parent.") --error[leftText can't be nil if indexUp are true]
|
||||
return gameCooltip:PrintDebug("AddMenu() attempt to add a submenu with a parent.")
|
||||
end
|
||||
|
||||
--menu container
|
||||
@@ -2356,18 +2384,21 @@ function DF:CreateCoolTip()
|
||||
return
|
||||
end
|
||||
|
||||
menuType = gameCooltip:ParseMenuType(menuType)
|
||||
|
||||
if (type(colorRed) == "table" or type(colorRed) == "string") then
|
||||
statusbarGlow, backgroundBar, colorRed, colorGreen, colorBlue, colorAlpha = colorGreen, colorBlue, DF:ParseColors(colorRed)
|
||||
|
||||
elseif (type(colorRed) == "boolean") then
|
||||
backgroundBar = colorGreen
|
||||
statusbarGlow = colorRed
|
||||
colorRed, colorGreen, colorBlue, colorAlpha = 1, 1, 1, 1
|
||||
end
|
||||
|
||||
--add
|
||||
local frameTable
|
||||
local statusbarTable
|
||||
if (not menuType or (type(menuType) == "string" and menuType == CONST_MENU_TYPE_MAINMENU) or (type(menuType) == "number" and menuType == 1)) then
|
||||
|
||||
if (menuType == CONST_MENU_TYPE_MAINMENU) then
|
||||
frameTable = gameCooltip.StatusBarTable
|
||||
if (gameCooltip.isSpecial) then
|
||||
statusbarTable = {}
|
||||
@@ -2380,7 +2411,7 @@ function DF:CreateCoolTip()
|
||||
end
|
||||
end
|
||||
|
||||
elseif ((type(menuType) == "string" and menuType == "sub") or (type(menuType) == "number" and menuType == 2)) then
|
||||
elseif (menuType == CONST_MENU_TYPE_SUBMENU) then
|
||||
frameTable = gameCooltip.StatusBarTableSub
|
||||
local subMenuContainerStatusBar = frameTable[gameCooltip.Indexes]
|
||||
if (not subMenuContainerStatusBar) then
|
||||
@@ -2414,17 +2445,20 @@ function DF:CreateCoolTip()
|
||||
|
||||
frame1.frameWallpaper:Hide()
|
||||
frame2.frameWallpaper:Hide()
|
||||
function gameCooltip:SetWallpaper(index, texture, texcoord, color, desaturate)
|
||||
function gameCooltip:SetWallpaper(menuType, texture, texcoord, color, desaturate)
|
||||
if (gameCooltip.Indexes == 0) then
|
||||
return gameCooltip:PrintDebug("SetWallpaper() requires an already added line (Cooltip:AddLine()).")
|
||||
end
|
||||
|
||||
menuType = gameCooltip:ParseMenuType(menuType)
|
||||
|
||||
local frameTable
|
||||
local wallpaperTable
|
||||
if ((type(index) == "number" and index == 1) or (type(index) == "string" and index == CONST_MENU_TYPE_MAINMENU)) then
|
||||
|
||||
if (menuType == CONST_MENU_TYPE_MAINMENU) then
|
||||
wallpaperTable = gameCooltip.WallpaperTable
|
||||
|
||||
elseif ((type(index) == "number" and index == 2) or (type(index) == "string" and index == "sub")) then
|
||||
elseif (menuType == CONST_MENU_TYPE_SUBMENU) then
|
||||
frameTable = gameCooltip.WallpaperTableSub
|
||||
local subMenuContainerWallpapers = frameTable[gameCooltip.Indexes]
|
||||
if (not subMenuContainerWallpapers) then
|
||||
@@ -2463,6 +2497,7 @@ function DF:CreateCoolTip()
|
||||
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)
|
||||
|
||||
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)
|
||||
@@ -2481,11 +2516,15 @@ function DF:CreateCoolTip()
|
||||
fontstring:Show()
|
||||
end
|
||||
|
||||
function gameCooltip:SetBackdrop(index, backdrop, backdropcolor, bordercolor)
|
||||
function gameCooltip:SetBackdrop(menuType, backdrop, backdropcolor, bordercolor)
|
||||
local frame
|
||||
if (index == 1) then
|
||||
|
||||
menuType = gameCooltip:ParseMenuType(menuType)
|
||||
|
||||
if (menuType == CONST_MENU_TYPE_MAINMENU) then
|
||||
frame = frame1
|
||||
elseif (index == 2) then
|
||||
|
||||
elseif (menuType == CONST_MENU_TYPE_SUBMENU) then
|
||||
frame = frame2
|
||||
end
|
||||
|
||||
@@ -2568,8 +2607,9 @@ function DF:CreateCoolTip()
|
||||
side = side or 1
|
||||
local frameTable
|
||||
local iconTable
|
||||
menuType = gameCooltip:ParseMenuType(menuType)
|
||||
|
||||
if (not menuType or (type(menuType) == "string" and menuType == CONST_MENU_TYPE_MAINMENU) or (type(menuType) == "number" and menuType == 1)) then
|
||||
if (menuType == CONST_MENU_TYPE_MAINMENU) then
|
||||
if (not side or (type(side) == "string" and side == "left") or (type(side) == "number" and side == 1)) then
|
||||
frameTable = gameCooltip.LeftIconTable
|
||||
|
||||
@@ -2588,7 +2628,7 @@ function DF:CreateCoolTip()
|
||||
end
|
||||
end
|
||||
|
||||
elseif ((type(menuType) == "string" and menuType == "sub") or (type(menuType) == "number" and menuType == 2)) then
|
||||
elseif (menuType == CONST_MENU_TYPE_SUBMENU) then
|
||||
if ((type(side) == "string" and side == "left") or (type(side) == "number" and side == 1)) then
|
||||
frameTable = gameCooltip.LeftIconTableSub
|
||||
|
||||
@@ -2703,7 +2743,9 @@ function DF:CreateCoolTip()
|
||||
local lineTable_Left
|
||||
local lineTable_Right
|
||||
|
||||
if (not menuType or (type(menuType) == "string" and menuType == CONST_MENU_TYPE_MAINMENU) or (type(menuType) == "number" and menuType == 1)) then
|
||||
menuType = gameCooltip:ParseMenuType(menuType)
|
||||
|
||||
if (menuType == CONST_MENU_TYPE_MAINMENU) then
|
||||
gameCooltip.Indexes = gameCooltip.Indexes + 1
|
||||
if (not gameCooltip.IndexesSub[gameCooltip.Indexes]) then
|
||||
gameCooltip.IndexesSub[gameCooltip.Indexes] = 0
|
||||
@@ -2732,7 +2774,7 @@ function DF:CreateCoolTip()
|
||||
end
|
||||
end
|
||||
|
||||
elseif ((type(menuType) == "string" and menuType == "sub") or (type(menuType) == "number" and menuType == 2)) then
|
||||
elseif (menuType == CONST_MENU_TYPE_SUBMENU) then
|
||||
gameCooltip.SubIndexes = gameCooltip.SubIndexes + 1
|
||||
gameCooltip.IndexesSub[gameCooltip.Indexes] = gameCooltip.IndexesSub[gameCooltip.Indexes] + 1
|
||||
gameCooltip.HaveSubMenu = true
|
||||
@@ -2996,7 +3038,7 @@ function DF:CreateCoolTip()
|
||||
gameCooltip:ShowCooltip()
|
||||
|
||||
if (fromClick) then
|
||||
frame1:Flash (0.05, 0.05, 0.2, true, 0, 0)
|
||||
frame1:Flash(0.05, 0.05, 0.2, true, 0, 0)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+11
-7
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
local dversion = 370
|
||||
local dversion = 371
|
||||
local major, minor = "DetailsFramework-1.0", dversion
|
||||
local DF, oldminor = LibStub:NewLibrary(major, minor)
|
||||
|
||||
@@ -10,7 +10,7 @@ if (not DF) then
|
||||
end
|
||||
|
||||
DetailsFrameworkCanLoad = true
|
||||
local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
|
||||
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
|
||||
|
||||
local _
|
||||
local type = type
|
||||
@@ -43,14 +43,18 @@ if (not PixelUtil) then
|
||||
local gameVersion = GetBuildInfo()
|
||||
if (gameVersion:match("%d") == "1" or gameVersion:match("%d") == "2" or gameVersion:match("%d") == "3") then
|
||||
PixelUtil = {
|
||||
SetWidth = function (self, width) self:SetWidth (width) end,
|
||||
SetHeight = function (self, height) self:SetHeight (height) end,
|
||||
SetSize = function (self, width, height) self:SetSize (width, height) end,
|
||||
SetPoint = function (self, ...) self:SetPoint (...) end,
|
||||
SetWidth = function(self, width) self:SetWidth(width) end,
|
||||
SetHeight = function(self, height) self:SetHeight(height) end,
|
||||
SetSize = function(self, width, height) self:SetSize(width, height) end,
|
||||
SetPoint = function(self, ...) self:SetPoint(...) end,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function DF:GetDefaultBackdropColor()
|
||||
return 0.1215, 0.1176, 0.1294, 0.8
|
||||
end
|
||||
|
||||
function DF.IsDragonflightAndBeyond()
|
||||
return select(4, GetBuildInfo()) >= 100000
|
||||
end
|
||||
@@ -157,7 +161,7 @@ function DF:GetRoleByClassicTalentTree()
|
||||
--tab information
|
||||
local name, iconTexture, pointsSpent, fileName = GetTalentTabInfo(i)
|
||||
if (name) then
|
||||
tinsert (pointsPerSpec, {name, pointsSpent, fileName})
|
||||
tinsert(pointsPerSpec, {name, pointsSpent, fileName})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+12
-13
@@ -4856,7 +4856,7 @@ end
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- ~standard backdrop
|
||||
|
||||
function DF:ApplyStandardBackdrop(frame, darkTheme, alphaScale)
|
||||
function DF:ApplyStandardBackdrop(frame, solidColor, alphaScale)
|
||||
alphaScale = alphaScale or 1.0
|
||||
|
||||
if (not frame.SetBackdrop)then
|
||||
@@ -4864,28 +4864,27 @@ function DF:ApplyStandardBackdrop(frame, darkTheme, alphaScale)
|
||||
Mixin(frame, BackdropTemplateMixin)
|
||||
end
|
||||
|
||||
if (darkTheme) then
|
||||
frame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Cooldown\cooldown2]], tileSize = 32, tile = true})
|
||||
frame:SetBackdropBorderColor(0, 0, 0, 1)
|
||||
frame:SetBackdropColor(.54, .54, .54, .54 * alphaScale)
|
||||
local red, green, blue, alpha = DF:GetDefaultBackdropColor()
|
||||
|
||||
if (solidColor) then
|
||||
local colorDeviation = 0.05
|
||||
frame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Buttons\WHITE8X8]], tileSize = 32, tile = true})
|
||||
frame:SetBackdropColor(red, green, blue, 0.872)
|
||||
frame:SetBackdropBorderColor(0, 0, 0, 0.95)
|
||||
|
||||
else
|
||||
frame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
frame:SetBackdropBorderColor(0, 0, 0, 1)
|
||||
frame:SetBackdropColor(0.1215, 0.1176, 0.1294, 0.2 * alphaScale)
|
||||
frame:SetBackdropColor(red, green, blue, alpha * alphaScale)
|
||||
frame:SetBackdropBorderColor(0, 0, 0, 0.95)
|
||||
end
|
||||
|
||||
if (not frame.__background) then
|
||||
frame.__background = frame:CreateTexture(nil, "background")
|
||||
frame.__background:SetColorTexture(0.1215, 0.1176, 0.1294, 0.99)
|
||||
frame.__background:SetColorTexture(red, green, blue)
|
||||
frame.__background:SetAllPoints()
|
||||
end
|
||||
|
||||
--frame.innerBorderTexture = frame:CreateTexture(nil, "overlay")
|
||||
--frame.innerBorderTexture:SetAllPoints()
|
||||
--frame.innerBorderTexture:SetAtlas("Options_InnerFrame")
|
||||
|
||||
frame.__background:SetAlpha(0.8 * alphaScale)
|
||||
frame.__background:SetAlpha(alpha * alphaScale)
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
+7
-1
@@ -1274,7 +1274,7 @@ end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--consumables
|
||||
if(DF.IsShadowlandsWow() or DF.IsDragonflight()) then --Temporary IsDragonFlight until I get the items together
|
||||
if (DF.IsShadowlandsWow() or DF.IsDragonflight()) then --Temporary IsDragonFlight until I get the items together
|
||||
DF.WeaponEnchantIds = {
|
||||
[6188] = true, --shadowcore oil
|
||||
[6190] = true, --embalmer's oil
|
||||
@@ -1407,6 +1407,12 @@ elseif (DF.IsWotLKWow()) then
|
||||
DF.FeastIDs = {}
|
||||
DF.RuneIDs = {}
|
||||
|
||||
elseif (DF.IsClassicWow()) then
|
||||
DF.PotionIDs = {}
|
||||
DF.FeastIDs = {}
|
||||
DF.RuneIDs = {}
|
||||
DF.FoodIDs = {}
|
||||
DF.FlaskIDs = {}
|
||||
end
|
||||
|
||||
-- /dump UnitAura ("player", 1)
|
||||
|
||||
+193
-200
@@ -30,10 +30,15 @@ local tokFunctions = Details.ToKFunctions
|
||||
|
||||
--constants
|
||||
local baseframe_strata = "LOW"
|
||||
local gump_fundo_backdrop = {
|
||||
local defaultBackdropSt = {
|
||||
bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16,
|
||||
insets = {left = 0, right = 0, top = 0, bottom = 0}}
|
||||
|
||||
local CONST_ROWFRAME_ALPHA = 0.975036
|
||||
local parseRowFrameAlpha = function(value)
|
||||
return math.min(value, CONST_ROWFRAME_ALPHA)
|
||||
end
|
||||
|
||||
function Details:ScheduleUpdate(instancia)
|
||||
instancia.barraS = {nil, nil}
|
||||
instancia.update = true
|
||||
@@ -322,20 +327,20 @@ local function OnLeaveMainWindow (instancia, self)
|
||||
end
|
||||
Details.OnLeaveMainWindow = OnLeaveMainWindow
|
||||
|
||||
local function OnEnterMainWindow (instancia, self)
|
||||
local function OnEnterMainWindow(instancia, self)
|
||||
instancia.is_interacting = true
|
||||
instancia:SetMenuAlpha (nil, nil, nil, nil, true)
|
||||
instancia:SetAutoHideMenu (nil, nil, true)
|
||||
instancia:RefreshAttributeTextSize()
|
||||
|
||||
|
||||
if (not instancia.last_interaction or instancia.last_interaction < Details._tempo) then
|
||||
instancia.last_interaction = Details._tempo or time()
|
||||
end
|
||||
|
||||
if (instancia.baseframe:GetFrameLevel() > instancia.rowframe:GetFrameLevel()) then
|
||||
instancia.rowframe:SetFrameLevel (instancia.baseframe:GetFrameLevel())
|
||||
instancia.rowframe:SetFrameLevel(instancia.baseframe:GetFrameLevel())
|
||||
end
|
||||
|
||||
|
||||
if (instancia.modo ~= Details._detalhes_props["MODO_ALONE"] and not instancia.baseframe.isLocked) then
|
||||
|
||||
--> resize, lock and ungroup buttons
|
||||
@@ -790,10 +795,9 @@ local function move_janela (baseframe, iniciando, instancia, just_updating)
|
||||
precisa_ativar = not instancia_alvo.ativa
|
||||
|
||||
if (need_start) then --> se a inst�ncia n�o tiver sido aberta ainda
|
||||
|
||||
local lower_instance = Details:GetLowerInstanceNumber()
|
||||
|
||||
instancia_alvo:RestauraJanela (instancia_alvo.meu_id, true)
|
||||
instancia_alvo:RestauraJanela(instancia_alvo.meu_id, true)
|
||||
if (instancia_alvo:IsSoloMode()) then
|
||||
Details.SoloTables:switch()
|
||||
end
|
||||
@@ -803,9 +807,9 @@ local function move_janela (baseframe, iniciando, instancia, just_updating)
|
||||
instancia_alvo:SaveMainWindowPosition()
|
||||
instancia_alvo:RestoreMainWindowPosition()
|
||||
|
||||
Details.FadeHandler.Fader (instancia_alvo.baseframe, 1)
|
||||
Details.FadeHandler.Fader (instancia_alvo.rowframe, 1)
|
||||
Details.FadeHandler.Fader (instancia_alvo.baseframe.cabecalho.ball, 1)
|
||||
Details.FadeHandler.Fader(instancia_alvo.baseframe, 1)
|
||||
Details.FadeHandler.Fader(instancia_alvo.rowframe, parseRowFrameAlpha(1))
|
||||
Details.FadeHandler.Fader(instancia_alvo.baseframe.cabecalho.ball, 1)
|
||||
|
||||
need_start = false
|
||||
end
|
||||
@@ -1851,7 +1855,7 @@ local barra_backdrop_onleave = {
|
||||
|
||||
--> pre creating the truncate frame
|
||||
Details.left_anti_truncate = CreateFrame ("frame", "DetailsLeftTextAntiTruncate", UIParent,"BackdropTemplate")
|
||||
Details.left_anti_truncate:SetBackdrop (gump_fundo_backdrop)
|
||||
Details.left_anti_truncate:SetBackdrop (defaultBackdropSt)
|
||||
Details.left_anti_truncate:SetBackdropColor (0, 0, 0, 0.8)
|
||||
Details.left_anti_truncate:SetFrameStrata ("FULLSCREEN")
|
||||
Details.left_anti_truncate.text = Details.left_anti_truncate:CreateFontString (nil, "overlay", "GameFontNormal")
|
||||
@@ -2575,8 +2579,7 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia)
|
||||
Details.FadeHandler.Fader (self, "ALPHA", 0)
|
||||
end)
|
||||
|
||||
button:SetScript ("OnMouseDown", function (self, button)
|
||||
|
||||
button:SetScript ("OnMouseDown", function(self, button)
|
||||
if (button ~= "LeftButton") then
|
||||
return
|
||||
end
|
||||
@@ -2584,14 +2587,14 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia)
|
||||
if (instancia:IsSoloMode()) then
|
||||
return
|
||||
end
|
||||
|
||||
instancia:EsconderScrollBar (true)
|
||||
|
||||
instancia:EsconderScrollBar(true)
|
||||
baseframe._place = instancia:SaveMainWindowPosition()
|
||||
baseframe.isResizing = true
|
||||
baseframe.isStretching = true
|
||||
baseframe:SetFrameStrata ("TOOLTIP")
|
||||
instancia.rowframe:SetFrameStrata ("TOOLTIP")
|
||||
|
||||
baseframe:SetFrameStrata("TOOLTIP")
|
||||
instancia.rowframe:SetFrameStrata("TOOLTIP")
|
||||
|
||||
local _r, _g, _b, _a = baseframe:GetBackdropColor()
|
||||
|
||||
gump:GradientEffect ( baseframe, "frame", _r, _g, _b, _a, _r, _g, _b, 0.9, 1.5)
|
||||
@@ -2635,24 +2638,23 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia)
|
||||
|
||||
instancia.stretchToo = linha_horizontal
|
||||
if (#instancia.stretchToo > 0) then
|
||||
for _, esta_instancia in ipairs (instancia.stretchToo) do
|
||||
esta_instancia:EsconderScrollBar (true)
|
||||
esta_instancia.baseframe._place = esta_instancia:SaveMainWindowPosition()
|
||||
esta_instancia.baseframe.isResizing = true
|
||||
esta_instancia.baseframe.isStretching = true
|
||||
esta_instancia.baseframe:SetFrameStrata ("TOOLTIP")
|
||||
esta_instancia.rowframe:SetFrameStrata ("TOOLTIP")
|
||||
|
||||
local _r, _g, _b, _a = esta_instancia.baseframe:GetBackdropColor()
|
||||
gump:GradientEffect ( esta_instancia.baseframe, "frame", _r, _g, _b, _a, _r, _g, _b, 0.9, 1.5)
|
||||
Details:SendEvent ("DETAILS_INSTANCE_STARTSTRETCH", nil, esta_instancia)
|
||||
|
||||
if (esta_instancia.wallpaper.enabled) then
|
||||
_r, _g, _b = esta_instancia.baseframe.wallpaper:GetVertexColor()
|
||||
_a = esta_instancia.baseframe.wallpaper:GetAlpha()
|
||||
gump:GradientEffect (esta_instancia.baseframe.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, 0.05, 0.5)
|
||||
for _, thisInstance in ipairs(instancia.stretchToo) do
|
||||
thisInstance:EsconderScrollBar(true)
|
||||
thisInstance.baseframe._place = thisInstance:SaveMainWindowPosition()
|
||||
thisInstance.baseframe.isResizing = true
|
||||
thisInstance.baseframe.isStretching = true
|
||||
thisInstance.baseframe:SetFrameStrata("TOOLTIP")
|
||||
thisInstance.rowframe:SetFrameStrata("TOOLTIP")
|
||||
|
||||
local _r, _g, _b, _a = thisInstance.baseframe:GetBackdropColor()
|
||||
gump:GradientEffect(thisInstance.baseframe, "frame", _r, _g, _b, _a, _r, _g, _b, 0.9, 1.5)
|
||||
Details:SendEvent("DETAILS_INSTANCE_STARTSTRETCH", nil, thisInstance)
|
||||
|
||||
if (thisInstance.wallpaper.enabled) then
|
||||
_r, _g, _b = thisInstance.baseframe.wallpaper:GetVertexColor()
|
||||
_a = thisInstance.baseframe.wallpaper:GetAlpha()
|
||||
gump:GradientEffect(thisInstance.baseframe.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, 0.05, 0.5)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2696,28 +2698,28 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia)
|
||||
baseframe.stretch_direction = nil
|
||||
|
||||
if (instancia.stretchToo and #instancia.stretchToo > 0) then
|
||||
for _, esta_instancia in ipairs (instancia.stretchToo) do
|
||||
for _, esta_instancia in ipairs(instancia.stretchToo) do
|
||||
esta_instancia.baseframe:StopMovingOrSizing()
|
||||
esta_instancia.baseframe.isResizing = false
|
||||
esta_instancia:RestoreMainWindowPosition (esta_instancia.baseframe._place)
|
||||
esta_instancia:ReajustaGump()
|
||||
esta_instancia.baseframe.isStretching = false
|
||||
if (esta_instancia.need_rolagem) then
|
||||
esta_instancia:MostrarScrollBar (true)
|
||||
esta_instancia:MostrarScrollBar(true)
|
||||
end
|
||||
Details:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, esta_instancia)
|
||||
Details:SendEvent("DETAILS_INSTANCE_SIZECHANGED", nil, esta_instancia)
|
||||
|
||||
local _r, _g, _b, _a = esta_instancia.baseframe:GetBackdropColor()
|
||||
gump:GradientEffect ( esta_instancia.baseframe, "frame", _r, _g, _b, _a, instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha, 0.5)
|
||||
gump:GradientEffect(esta_instancia.baseframe, "frame", _r, _g, _b, _a, instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha, 0.5)
|
||||
|
||||
if (esta_instancia.wallpaper.enabled) then
|
||||
_r, _g, _b = esta_instancia.baseframe.wallpaper:GetVertexColor()
|
||||
_a = esta_instancia.baseframe.wallpaper:GetAlpha()
|
||||
gump:GradientEffect (esta_instancia.baseframe.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, esta_instancia.wallpaper.alpha, 1.0)
|
||||
gump:GradientEffect(esta_instancia.baseframe.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, esta_instancia.wallpaper.alpha, 1.0)
|
||||
end
|
||||
|
||||
esta_instancia.baseframe:SetFrameStrata (esta_instancia.strata)
|
||||
esta_instancia.rowframe:SetFrameStrata (esta_instancia.strata)
|
||||
esta_instancia.baseframe:SetFrameStrata(esta_instancia.strata)
|
||||
esta_instancia.rowframe:SetFrameStrata(esta_instancia.strata)
|
||||
esta_instancia:StretchButtonAlwaysOnTop()
|
||||
|
||||
Details:SendEvent ("DETAILS_INSTANCE_ENDSTRETCH", nil, esta_instancia.baseframe)
|
||||
@@ -2732,26 +2734,23 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia)
|
||||
end
|
||||
|
||||
local _r, _g, _b, _a = baseframe:GetBackdropColor()
|
||||
gump:GradientEffect ( baseframe, "frame", _r, _g, _b, _a, instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha, 0.5)
|
||||
gump:GradientEffect(baseframe, "frame", _r, _g, _b, _a, instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha, 0.5)
|
||||
if (instancia.wallpaper.enabled) then
|
||||
_r, _g, _b = baseframe.wallpaper:GetVertexColor()
|
||||
_a = baseframe.wallpaper:GetAlpha()
|
||||
gump:GradientEffect (baseframe.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, instancia.wallpaper.alpha, 1.0)
|
||||
gump:GradientEffect(baseframe.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, instancia.wallpaper.alpha, 1.0)
|
||||
end
|
||||
|
||||
baseframe:SetFrameStrata (instancia.strata)
|
||||
instancia.rowframe:SetFrameStrata (instancia.strata)
|
||||
baseframe:SetFrameStrata(instancia.strata)
|
||||
instancia.rowframe:SetFrameStrata(instancia.strata)
|
||||
instancia:StretchButtonAlwaysOnTop()
|
||||
|
||||
Details:SnapTextures (false)
|
||||
|
||||
Details:SendEvent ("DETAILS_INSTANCE_ENDSTRETCH", nil, instancia)
|
||||
|
||||
|
||||
if (Details.stretch_changed_update_speed) then
|
||||
Details:SetWindowUpdateSpeed (false, true)
|
||||
Details:SetWindowUpdateSpeed(false, true)
|
||||
Details.stretch_changed_update_speed = nil
|
||||
end
|
||||
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -3486,6 +3485,11 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
|
||||
rowframe:SetFrameLevel (3)
|
||||
rowframe:EnableMouse(false)
|
||||
instancia.rowframe = rowframe
|
||||
|
||||
function rowframe:SetFrameAlpha(value)
|
||||
local value = parseRowFrameAlpha(value)
|
||||
self:SetAlpha(value)
|
||||
end
|
||||
|
||||
--> right click bookmark
|
||||
local switchbutton = CreateFrame("button", "Details_SwitchButtonFrame" .. ID, UIParent)
|
||||
@@ -3620,7 +3624,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
|
||||
--baseframe:SetResizeBounds(150, 7, _detalhes.max_window_size.width, _detalhes.max_window_size.height)
|
||||
end
|
||||
|
||||
baseframe:SetBackdrop (gump_fundo_backdrop)
|
||||
baseframe:SetBackdrop (defaultBackdropSt)
|
||||
baseframe:SetBackdropColor (instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha)
|
||||
|
||||
-- background window config -------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -3631,7 +3635,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
|
||||
backgrounddisplay:SetResizable (true)
|
||||
backgrounddisplay:SetPoint ("topleft", baseframe, "topleft")
|
||||
backgrounddisplay:SetPoint ("bottomright", baseframe, "bottomright")
|
||||
backgrounddisplay:SetBackdrop (gump_fundo_backdrop)
|
||||
backgrounddisplay:SetBackdrop (defaultBackdropSt)
|
||||
backgrounddisplay:SetBackdropColor (instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha)
|
||||
|
||||
-- instance mini widgets -------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -4011,36 +4015,35 @@ local getActor = function(self)
|
||||
return self.minha_tabela
|
||||
end
|
||||
|
||||
--> search key: ~row ~barra ~newbar ~createbar ~createrow
|
||||
function gump:CreateNewLine (instancia, index)
|
||||
|
||||
--> instancia = window object, index = row number
|
||||
local baseframe = instancia.baseframe
|
||||
local rowframe = instancia.rowframe
|
||||
--search key: ~row ~barra ~newbar ~createbar ~createrow
|
||||
function gump:CreateNewLine(instance, index)
|
||||
--instance = window object, index = row number
|
||||
local baseframe = instance.baseframe
|
||||
local rowframe = instance.rowframe
|
||||
|
||||
--> create the bar with rowframe as parent
|
||||
local newLine = CreateFrame ("button", "DetailsBarra_"..instancia.meu_id.."_"..index, rowframe,"BackdropTemplate")
|
||||
--create the bar with rowframe as parent
|
||||
local newLine = CreateFrame("button", "DetailsBarra_"..instance.meu_id.."_"..index, rowframe, "BackdropTemplate")
|
||||
|
||||
newLine.row_id = index
|
||||
newLine.instance_id = instancia.meu_id
|
||||
newLine.instance_id = instance.meu_id
|
||||
newLine.animacao_fim = 0
|
||||
newLine.animacao_fim2 = 0
|
||||
|
||||
newLine.GetActor = getActor
|
||||
|
||||
--> set point, almost irrelevant here, it recalc this on SetBarGrowDirection()
|
||||
local y = instancia.row_height * (index-1)
|
||||
if (instancia.bars_grow_direction == 1) then
|
||||
y = y*-1
|
||||
newLine:SetPoint ("topleft", baseframe, "topleft", instancia.row_info.space.left, y)
|
||||
--set point, almost irrelevant here, it recalc this on SetBarGrowDirection()
|
||||
local y = instance.row_height * (index-1)
|
||||
if (instance.bars_grow_direction == 1) then
|
||||
y = y * -1
|
||||
newLine:SetPoint("topleft", baseframe, "topleft", instance.row_info.space.left, y)
|
||||
|
||||
elseif (instancia.bars_grow_direction == 2) then
|
||||
newLine:SetPoint ("bottomleft", baseframe, "bottomleft", instancia.row_info.space.left, y + 2)
|
||||
elseif (instance.bars_grow_direction == 2) then
|
||||
newLine:SetPoint("bottomleft", baseframe, "bottomleft", instance.row_info.space.left, y + 2)
|
||||
end
|
||||
|
||||
--> row height
|
||||
newLine:SetHeight (instancia.row_info.height)
|
||||
newLine:SetWidth (baseframe:GetWidth()+instancia.row_info.space.right)
|
||||
--row height
|
||||
newLine:SetHeight (instance.row_info.height)
|
||||
newLine:SetWidth (baseframe:GetWidth()+instance.row_info.space.right)
|
||||
newLine:SetFrameLevel (baseframe:GetFrameLevel() + 4)
|
||||
newLine.last_value = 0
|
||||
newLine.w_mod = 0
|
||||
@@ -4048,69 +4051,70 @@ function gump:CreateNewLine (instancia, index)
|
||||
newLine:RegisterForClicks ("LeftButtonDown", "RightButtonDown")
|
||||
|
||||
--statusbar
|
||||
newLine.statusbar = CreateFrame ("StatusBar", "DetailsBarra_Statusbar_"..instancia.meu_id.."_"..index, newLine)
|
||||
newLine.statusbar = CreateFrame("StatusBar", "DetailsBarra_Statusbar_"..instance.meu_id.."_"..index, newLine)
|
||||
newLine.statusbar.value = 0
|
||||
|
||||
--frame for hold the backdrop border
|
||||
newLine.border = CreateFrame ("Frame", "DetailsBarra_Border_" .. instancia.meu_id .. "_" .. index, newLine.statusbar, "BackdropTemplate")
|
||||
newLine.border:SetFrameLevel (newLine.statusbar:GetFrameLevel()+2)
|
||||
newLine.border:SetAllPoints (newLine)
|
||||
newLine.border = CreateFrame("Frame", "DetailsBarra_Border_" .. instance.meu_id .. "_" .. index, newLine.statusbar, "BackdropTemplate")
|
||||
newLine.border:SetFrameLevel(newLine.statusbar:GetFrameLevel()+2)
|
||||
newLine.border:SetAllPoints(newLine)
|
||||
|
||||
--border
|
||||
newLine.lineBorder = DetailsFramework:CreateFullBorder(newLine:GetName() .. "Border", newLine.border)
|
||||
|
||||
--low 3d bar --search key: ~model
|
||||
newLine.modelbox_low = CreateFrame ("playermodel", "DetailsBarra_ModelBarLow_" .. instancia.meu_id .. "_" .. index, newLine) --rowframe
|
||||
newLine.modelbox_low = CreateFrame("playermodel", "DetailsBarra_ModelBarLow_" .. instance.meu_id .. "_" .. index, newLine)
|
||||
newLine.modelbox_low:SetFrameLevel (newLine.statusbar:GetFrameLevel()-1)
|
||||
newLine.modelbox_low:SetPoint ("topleft", newLine, "topleft")
|
||||
newLine.modelbox_low:SetPoint ("bottomright", newLine, "bottomright")
|
||||
newLine.modelbox_low:SetPoint("topleft", newLine, "topleft")
|
||||
newLine.modelbox_low:SetPoint("bottomright", newLine, "bottomright")
|
||||
|
||||
--high 3d bar
|
||||
newLine.modelbox_high = CreateFrame ("playermodel", "DetailsBarra_ModelBarHigh_" .. instancia.meu_id .. "_" .. index, newLine) --rowframe
|
||||
newLine.modelbox_high = CreateFrame("playermodel", "DetailsBarra_ModelBarHigh_" .. instance.meu_id .. "_" .. index, newLine)
|
||||
newLine.modelbox_high:SetFrameLevel (newLine.statusbar:GetFrameLevel()+1)
|
||||
newLine.modelbox_high:SetPoint ("topleft", newLine, "topleft")
|
||||
newLine.modelbox_high:SetPoint ("bottomright", newLine, "bottomright")
|
||||
|
||||
--> create textures and icons
|
||||
newLine.textura = newLine.statusbar:CreateTexture (nil, "artwork")
|
||||
newLine.textura:SetHorizTile (false)
|
||||
newLine.textura:SetVertTile (false)
|
||||
|
||||
--> row background texture
|
||||
newLine.background = newLine:CreateTexture (nil, "background")
|
||||
newLine.modelbox_high:SetPoint("topleft", newLine, "topleft")
|
||||
newLine.modelbox_high:SetPoint("bottomright", newLine, "bottomright")
|
||||
|
||||
--create textures and icons
|
||||
newLine.textura = newLine.statusbar:CreateTexture(nil, "artwork")
|
||||
newLine.textura:SetHorizTile(false)
|
||||
newLine.textura:SetVertTile(false)
|
||||
|
||||
--row background texture
|
||||
newLine.background = newLine:CreateTexture(nil, "background")
|
||||
newLine.background:SetTexture("")
|
||||
newLine.background:SetAllPoints (newLine)
|
||||
|
||||
newLine.statusbar:SetStatusBarColor (0, 0, 0, 0)
|
||||
newLine.statusbar:SetStatusBarTexture (newLine.textura)
|
||||
newLine.statusbar:SetMinMaxValues (0, 100)
|
||||
newLine.statusbar:SetValue (0)
|
||||
newLine.statusbar:SetStatusBarColor(0, 0, 0, 0)
|
||||
newLine.statusbar:SetStatusBarTexture(newLine.textura)
|
||||
newLine.statusbar:SetMinMaxValues(0, 100)
|
||||
newLine.statusbar:SetValue(0)
|
||||
|
||||
newLine.overlayTexture = newLine.statusbar:CreateTexture (nil, "overlay")
|
||||
newLine.overlayTexture = newLine.statusbar:CreateTexture(nil, "overlay")
|
||||
newLine.overlayTexture:SetAllPoints()
|
||||
|
||||
--> class icon
|
||||
local icone_classe = newLine.border:CreateTexture (nil, "overlay")
|
||||
icone_classe:SetHeight (instancia.row_info.height)
|
||||
icone_classe:SetWidth (instancia.row_info.height)
|
||||
icone_classe:SetTexture (instancia.row_info.icon_file)
|
||||
--class icon
|
||||
local icone_classe = newLine.border:CreateTexture(nil, "overlay")
|
||||
icone_classe:SetHeight (instance.row_info.height)
|
||||
icone_classe:SetWidth (instance.row_info.height)
|
||||
icone_classe:SetTexture (instance.row_info.icon_file)
|
||||
icone_classe:SetTexCoord (.75, 1, .75, 1)
|
||||
newLine.icone_classe = icone_classe
|
||||
|
||||
local iconFrame = CreateFrame ("frame", "DetailsBarra_IconFrame_" .. instancia.meu_id .. "_" .. index, newLine.statusbar)
|
||||
iconFrame:SetPoint ("topleft", icone_classe, "topleft")
|
||||
iconFrame:SetPoint ("bottomright", icone_classe, "bottomright")
|
||||
local iconFrame = CreateFrame("frame", "DetailsBarra_IconFrame_" .. instance.meu_id .. "_" .. index, newLine.statusbar)
|
||||
iconFrame:SetPoint("topleft", icone_classe, "topleft")
|
||||
iconFrame:SetPoint("bottomright", icone_classe, "bottomright")
|
||||
iconFrame:SetFrameLevel (newLine.statusbar:GetFrameLevel()+1)
|
||||
iconFrame.instance_id = instancia.meu_id
|
||||
iconFrame.instance_id = instance.meu_id
|
||||
iconFrame.row = newLine
|
||||
newLine.icon_frame = iconFrame
|
||||
|
||||
icone_classe:SetPoint ("left", newLine, "left")
|
||||
newLine.statusbar:SetPoint ("topleft", icone_classe, "topright")
|
||||
newLine.statusbar:SetPoint ("bottomright", newLine, "bottomright")
|
||||
icone_classe:SetPoint("left", newLine, "left")
|
||||
newLine.statusbar:SetPoint("topleft", icone_classe, "topright")
|
||||
newLine.statusbar:SetPoint("bottomright", newLine, "bottomright")
|
||||
|
||||
--> left text 1
|
||||
newLine.lineText1 = newLine.border:CreateFontString (nil, "overlay", "GameFontHighlight")
|
||||
newLine.lineText1:SetPoint ("left", newLine.icone_classe, "right", 3, 0)
|
||||
newLine.lineText1:SetPoint("left", newLine.icone_classe, "right", 3, 0)
|
||||
newLine.lineText1:SetJustifyH ("left")
|
||||
newLine.lineText1:SetNonSpaceWrap (true)
|
||||
|
||||
@@ -4120,21 +4124,21 @@ function gump:CreateNewLine (instancia, index)
|
||||
end
|
||||
|
||||
--> set the onclick, on enter scripts
|
||||
barra_scripts (newLine, instancia, index)
|
||||
barra_scripts (newLine, instance, index)
|
||||
|
||||
--> hide
|
||||
Details.FadeHandler.Fader (newLine, 1)
|
||||
|
||||
--> adds the window container
|
||||
instancia.barras [index] = newLine
|
||||
instance.barras [index] = newLine
|
||||
|
||||
--> set the left text
|
||||
newLine.lineText1:SetText (Loc["STRING_NEWROW"])
|
||||
|
||||
--> refresh rows
|
||||
instancia:InstanceRefreshRows()
|
||||
instance:InstanceRefreshRows()
|
||||
|
||||
Details:SendEvent ("DETAILS_INSTANCE_NEWROW", nil, instancia, newLine)
|
||||
Details:SendEvent ("DETAILS_INSTANCE_NEWROW", nil, instance, newLine)
|
||||
|
||||
return newLine
|
||||
end
|
||||
@@ -5162,40 +5166,39 @@ function Details:GetTextures()
|
||||
--atributo_icon � uma exce��o
|
||||
end
|
||||
|
||||
function Details:SetWindowAlphaForInteract (alpha)
|
||||
|
||||
local ignorebars = self.menu_alpha.ignorebars
|
||||
|
||||
function Details:SetWindowAlphaForInteract(alpha)
|
||||
local ignoreBars = self.menu_alpha.ignorebars
|
||||
|
||||
if (self.is_interacting) then
|
||||
--> entrou
|
||||
self.baseframe:SetAlpha (alpha)
|
||||
self:InstanceAlpha (alpha)
|
||||
self:SetIconAlpha (alpha, nil, true)
|
||||
|
||||
if (ignorebars) then
|
||||
self.rowframe:SetAlpha (1)
|
||||
--mouse entered the window
|
||||
self.baseframe:SetAlpha(alpha)
|
||||
self:InstanceAlpha(alpha)
|
||||
self:SetIconAlpha(alpha, nil, true)
|
||||
|
||||
if (ignoreBars) then
|
||||
self.rowframe:SetFrameAlpha(1)
|
||||
else
|
||||
self.rowframe:SetAlpha (alpha)
|
||||
self.rowframe:SetFrameAlpha(alpha)
|
||||
end
|
||||
else
|
||||
--> saiu
|
||||
--mouse left the window
|
||||
if (self.combat_changes_alpha and self.combat_changes_alpha ~= 1) then --> combat alpha
|
||||
self:InstanceAlpha (self.combat_changes_alpha)
|
||||
self:SetIconAlpha (self.combat_changes_alpha, nil, true)
|
||||
self.rowframe:SetAlpha (self.combat_changes_alpha) --alpha do combate � absoluta
|
||||
self.baseframe:SetAlpha (self.combat_changes_alpha) --alpha do combate � absoluta
|
||||
self:InstanceAlpha(self.combat_changes_alpha)
|
||||
self:SetIconAlpha(self.combat_changes_alpha, nil, true)
|
||||
self.rowframe:SetFrameAlpha(self.combat_changes_alpha) --alpha do combate � absoluta
|
||||
self.baseframe:SetAlpha(self.combat_changes_alpha) --alpha do combate � absoluta
|
||||
|
||||
else
|
||||
self:InstanceAlpha (alpha)
|
||||
self:SetIconAlpha (alpha, nil, true)
|
||||
|
||||
if (ignorebars) then
|
||||
self.rowframe:SetAlpha (1)
|
||||
self:InstanceAlpha(alpha)
|
||||
self:SetIconAlpha(alpha, nil, true)
|
||||
|
||||
if (ignoreBars) then
|
||||
self.rowframe:SetFrameAlpha(1)
|
||||
else
|
||||
self.rowframe:SetAlpha (alpha)
|
||||
self.rowframe:SetFrameAlpha(alpha)
|
||||
end
|
||||
|
||||
self.baseframe:SetAlpha (alpha)
|
||||
|
||||
self.baseframe:SetAlpha(alpha)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5252,23 +5255,15 @@ function Details:SetWindowAlphaForCombat (entering_in_combat, true_hide, alphaAm
|
||||
self.baseframe:Hide()
|
||||
self.rowframe:Hide()
|
||||
self.windowSwitchButton:Hide()
|
||||
--Details.FadeHandler.Fader (self.baseframe, unpack(_detalhes.windows_fade_in))
|
||||
--Details.FadeHandler.Fader (self.rowframe, unpack(_detalhes.windows_fade_in))
|
||||
--Details.FadeHandler.Fader (self.windowSwitchButton, unpack(_detalhes.windows_fade_in))
|
||||
|
||||
--self:SetIconAlpha (nil, true)
|
||||
|
||||
if (Details.debug) then
|
||||
Details:Msg ("(debug) hiding window SetWindowAlphaForCombat()", amount, rowsamount, menuamount)
|
||||
end
|
||||
--]]
|
||||
else
|
||||
--
|
||||
self.baseframe:Show()
|
||||
self.baseframe:SetAlpha (1)
|
||||
|
||||
self:InstanceAlpha(min (amount, self.color[4]))
|
||||
Details.FadeHandler.Fader(self.rowframe, "ALPHAANIM", rowsamount)
|
||||
self.baseframe:SetAlpha(1)
|
||||
|
||||
self:InstanceAlpha(min(amount, self.color[4]))
|
||||
Details.FadeHandler.Fader(self.rowframe, "ALPHAANIM", parseRowFrameAlpha(rowsamount))
|
||||
Details.FadeHandler.Fader(self.baseframe, "ALPHAANIM", rowsamount)
|
||||
--]]
|
||||
end
|
||||
@@ -7405,24 +7400,24 @@ function Details:UpdateClickThrough()
|
||||
|
||||
--window frames
|
||||
if (windowClickThrough) then
|
||||
self.baseframe:EnableMouse (false)
|
||||
self.bgframe:EnableMouse (false)
|
||||
self.rowframe:EnableMouse (false)
|
||||
self.floatingframe:EnableMouse (false)
|
||||
self.windowSwitchButton:EnableMouse (false)
|
||||
self.windowBackgroundDisplay:EnableMouse (false)
|
||||
self.baseframe.UPFrame:EnableMouse (false)
|
||||
self.baseframe:EnableMouse(false)
|
||||
self.bgframe:EnableMouse(false)
|
||||
self.rowframe:EnableMouse(false)
|
||||
self.floatingframe:EnableMouse(false)
|
||||
self.windowSwitchButton:EnableMouse(false)
|
||||
self.windowBackgroundDisplay:EnableMouse(false)
|
||||
self.baseframe.UPFrame:EnableMouse(false)
|
||||
self.baseframe.DOWNFrame:EnableMouse(false)
|
||||
|
||||
|
||||
else
|
||||
self.baseframe:EnableMouse (true)
|
||||
self.bgframe:EnableMouse (true)
|
||||
self.rowframe:EnableMouse (true)
|
||||
self.floatingframe:EnableMouse (true)
|
||||
self.windowSwitchButton:EnableMouse (true)
|
||||
self.windowBackgroundDisplay:EnableMouse (true)
|
||||
self.baseframe.UPFrame:EnableMouse (true)
|
||||
self.baseframe:EnableMouse(true)
|
||||
self.bgframe:EnableMouse(true)
|
||||
self.rowframe:EnableMouse(true)
|
||||
self.floatingframe:EnableMouse(true)
|
||||
self.windowSwitchButton:EnableMouse(true)
|
||||
self.windowBackgroundDisplay:EnableMouse(true)
|
||||
self.baseframe.UPFrame:EnableMouse(true)
|
||||
self.baseframe.DOWNFrame:EnableMouse(true)
|
||||
end
|
||||
|
||||
@@ -7436,24 +7431,24 @@ function Details:UpdateClickThrough()
|
||||
toolbar_buttons [6] = self.baseframe.cabecalho.fechar
|
||||
|
||||
for i, button in ipairs (toolbar_buttons) do
|
||||
button:EnableMouse (toolbar_buttons)
|
||||
button:EnableMouse(toolbar_buttons)
|
||||
end
|
||||
|
||||
else
|
||||
--player bars
|
||||
for barIndex, barObject in ipairs (self.barras) do
|
||||
barObject:EnableMouse (true)
|
||||
barObject:EnableMouse(true)
|
||||
barObject.icon_frame:EnableMouse(true)
|
||||
end
|
||||
|
||||
--window frames
|
||||
self.baseframe:EnableMouse (true)
|
||||
self.bgframe:EnableMouse (true)
|
||||
self.rowframe:EnableMouse (true)
|
||||
self.floatingframe:EnableMouse (true)
|
||||
self.windowSwitchButton:EnableMouse (true)
|
||||
self.windowBackgroundDisplay:EnableMouse (true)
|
||||
self.baseframe.UPFrame:EnableMouse (true)
|
||||
self.baseframe:EnableMouse(true)
|
||||
self.bgframe:EnableMouse(true)
|
||||
self.rowframe:EnableMouse(true)
|
||||
self.floatingframe:EnableMouse(true)
|
||||
self.windowSwitchButton:EnableMouse(true)
|
||||
self.windowBackgroundDisplay:EnableMouse(true)
|
||||
self.baseframe.UPFrame:EnableMouse(true)
|
||||
self.baseframe.DOWNFrame:EnableMouse(true)
|
||||
|
||||
--titlebar icons, forcing true because the player isn't in combat and the inCombat setting is enabled
|
||||
@@ -7466,7 +7461,7 @@ function Details:UpdateClickThrough()
|
||||
toolbar_buttons [6] = self.baseframe.cabecalho.fechar
|
||||
|
||||
for i, button in ipairs (toolbar_buttons) do
|
||||
button:EnableMouse (true)
|
||||
button:EnableMouse(true)
|
||||
end
|
||||
end
|
||||
else
|
||||
@@ -7474,33 +7469,33 @@ function Details:UpdateClickThrough()
|
||||
--player bars
|
||||
if (barsClickThrough) then
|
||||
for barIndex, barObject in ipairs (self.barras) do
|
||||
barObject:EnableMouse (false)
|
||||
barObject:EnableMouse(false)
|
||||
barObject.icon_frame:EnableMouse(false)
|
||||
end
|
||||
else
|
||||
for barIndex, barObject in ipairs (self.barras) do
|
||||
barObject:EnableMouse (true)
|
||||
barObject:EnableMouse(true)
|
||||
end
|
||||
end
|
||||
|
||||
--window frame
|
||||
if (windowClickThrough) then
|
||||
self.baseframe:EnableMouse (false)
|
||||
self.bgframe:EnableMouse (false)
|
||||
self.rowframe:EnableMouse (false)
|
||||
self.floatingframe:EnableMouse (false)
|
||||
self.windowSwitchButton:EnableMouse (false)
|
||||
self.windowBackgroundDisplay:EnableMouse (false)
|
||||
self.baseframe.UPFrame:EnableMouse (false)
|
||||
self.baseframe:EnableMouse(false)
|
||||
self.bgframe:EnableMouse(false)
|
||||
self.rowframe:EnableMouse(false)
|
||||
self.floatingframe:EnableMouse(false)
|
||||
self.windowSwitchButton:EnableMouse(false)
|
||||
self.windowBackgroundDisplay:EnableMouse(false)
|
||||
self.baseframe.UPFrame:EnableMouse(false)
|
||||
self.baseframe.DOWNFrame:EnableMouse(false)
|
||||
else
|
||||
self.baseframe:EnableMouse (true)
|
||||
self.bgframe:EnableMouse (true)
|
||||
self.rowframe:EnableMouse (true)
|
||||
self.floatingframe:EnableMouse (true)
|
||||
self.windowSwitchButton:EnableMouse (true)
|
||||
self.windowBackgroundDisplay:EnableMouse (true)
|
||||
self.baseframe.UPFrame:EnableMouse (true)
|
||||
self.baseframe:EnableMouse(true)
|
||||
self.bgframe:EnableMouse(true)
|
||||
self.rowframe:EnableMouse(true)
|
||||
self.floatingframe:EnableMouse(true)
|
||||
self.windowSwitchButton:EnableMouse(true)
|
||||
self.windowBackgroundDisplay:EnableMouse(true)
|
||||
self.baseframe.UPFrame:EnableMouse(true)
|
||||
self.baseframe.DOWNFrame:EnableMouse(true)
|
||||
end
|
||||
|
||||
@@ -7514,7 +7509,7 @@ function Details:UpdateClickThrough()
|
||||
toolbar_buttons [6] = self.baseframe.cabecalho.fechar
|
||||
|
||||
for i, button in ipairs (toolbar_buttons) do
|
||||
button:EnableMouse (toolbarIcons)
|
||||
button:EnableMouse(toolbarIcons)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -7706,17 +7701,16 @@ function Details:LeftMenuAnchorSide (side)
|
||||
return self:MenuAnchor()
|
||||
end
|
||||
|
||||
function Details:SetFrameStrata (strata)
|
||||
|
||||
function Details:SetFrameStrata(strata)
|
||||
if (not strata) then
|
||||
strata = self.strata
|
||||
end
|
||||
|
||||
self.strata = strata
|
||||
|
||||
self.rowframe:SetFrameStrata (strata)
|
||||
self.windowSwitchButton:SetFrameStrata (strata)
|
||||
self.baseframe:SetFrameStrata (strata)
|
||||
self.rowframe:SetFrameStrata(strata)
|
||||
self.windowSwitchButton:SetFrameStrata(strata)
|
||||
self.baseframe:SetFrameStrata(strata)
|
||||
|
||||
if (strata == "BACKGROUND") then
|
||||
self.break_snap_button:SetFrameStrata ("LOW")
|
||||
@@ -8260,7 +8254,7 @@ function Details:SetMenuAlpha (enabled, onenter, onleave, ignorebars, interactin
|
||||
|
||||
if (not enabled) then
|
||||
self.baseframe:SetAlpha (1)
|
||||
self.rowframe:SetAlpha (1)
|
||||
self.rowframe:SetFrameAlpha(1)
|
||||
self:InstanceAlpha (self.color[4])
|
||||
self:SetIconAlpha (1, nil, true)
|
||||
return self:InstanceColor (unpack(self.color))
|
||||
@@ -8405,15 +8399,14 @@ function Details:GetInstanceGroup (instance_id)
|
||||
return current_group
|
||||
end
|
||||
|
||||
function Details:SetWindowScale (scale, from_options)
|
||||
function Details:SetWindowScale(scale, fromOptions)
|
||||
if (not scale) then
|
||||
scale = self.window_scale
|
||||
end
|
||||
|
||||
if (from_options) then
|
||||
if (fromOptions) then
|
||||
local group = self:GetInstanceGroup()
|
||||
|
||||
for _, instance in ipairs (group) do
|
||||
for _, instance in ipairs(group) do
|
||||
instance.baseframe:SetScale(scale)
|
||||
instance.rowframe:SetScale(scale)
|
||||
instance.windowSwitchButton:SetScale(scale)
|
||||
|
||||
+638
-979
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user