More fixes for text color and bar color. Early and under development report button addon to the Player Breakdown window.

This commit is contained in:
Tercio Jose
2024-02-15 17:02:29 -03:00
parent 2fd02eebb1
commit cd8266fff6
12 changed files with 98 additions and 41 deletions
@@ -11,9 +11,11 @@ local GetSpellInfo = GetSpellInfo
local _GetSpellInfo = Details.GetSpellInfo
local GameTooltip = GameTooltip
local IsShiftKeyDown = IsShiftKeyDown
local DF = DetailsFramework
local tinsert = table.insert
---@type detailsframework
local DF = DetailsFramework
local spellsTab = DetailsSpellBreakdownTab
local CONST_BAR_HEIGHT = 20
@@ -1297,7 +1299,6 @@ function spellsTab.CreateSpellScrollContainer(tabFrame) --~scroll ~create ~spell
--amount of lines which will be created for the scrollframe
local defaultAmountOfLines = 50
--replace this with a framework scrollframe
---@type breakdownspellscrollframe
local scrollFrame = DF:CreateScrollBox(container, "$parentSpellScroll", refreshSpellsFunc, {}, width, height, defaultAmountOfLines, CONST_SPELLSCROLL_LINEHEIGHT)
DF:ReskinSlider(scrollFrame)
@@ -547,7 +547,7 @@ function spellsTab.OnCreateTabCallback(tabButton, tabFrame) --~init
--spellsTab.CreateReportButtons(tabFrame)
--create a button in the breakdown window to open the options for this tab
local optionsButton = DF:CreateButton(tabFrame, Details.OpenSpellBreakdownOptions, 130, 18, "options", 14)
local optionsButton = DF:CreateButton(tabFrame, Details.OpenSpellBreakdownOptions, 130, 18, Loc["STRING_OPTIONS_PLUGINS_OPTIONS"], 14)
--optionsButton:SetTemplate(DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
optionsButton:SetPoint("bottomright", tabFrame, "bottomright", -10, -19)
optionsButton.textsize = 12
@@ -561,6 +561,53 @@ function spellsTab.OnCreateTabCallback(tabButton, tabFrame) --~init
}
DF:AddRoundedCornersToFrame(optionsButton, preset)
--create a report button
local onClickReportButton = function(blizButton, buttonType, param1, param2)
--get what is shown in the breakdown window
local instance = spellsTab.GetInstance()
local actor = spellsTab.GetActor()
local combat = spellsTab.GetCombat()
local displayId, subDisplayId = instance:GetDisplay()
local spellScroll = spellsTab.GetSpellScrollFrame()
local getNumLines = spellScroll:GetNumFramesShown()
local dataToReport = {}
for i = 1, getNumLines do
---@type breakdownspellbar
local thisLine = spellScroll:GetLine(i)
--get the spell id
local spellId = thisLine.spellId
local spellName = GetSpellInfo(spellId)
--get the amount
local bkSpellData = thisLine.bkSpellData
if (bkSpellData) then
--dumpt(bkSpellData)
if (displayId == DETAILS_ATTRIBUTE_DAMAGE) then
if (subDisplayId == DETAILS_ATTRIBUTE_DAMAGE) then
dataToReport[#dataToReport+1] = spellName .. " .. " .. bkSpellData.total --, {bkSpellData.total, spellName, spellId}
end
end
end
end
if (#dataToReport > 0) then
instance:Reportar(dataToReport, {}, nil, nil)
end
end
local reportButton = DF:CreateButton(tabFrame, onClickReportButton, 130, 18, Loc["STRING_REPORT_TEXT"], 1, 2) --will have a text?
reportButton:SetPoint("right", optionsButton, "left", -5, 0)
reportButton.textsize = 12
reportButton.textcolor = "orange"
DF:AddRoundedCornersToFrame(reportButton, preset)
--open the breakdown window at startup for testing
--[=[ debug
C_Timer.After(1, function()
+11 -17
View File
@@ -200,7 +200,11 @@ local _
Details.janela_report.slider.amt:Show()
if (options) then
Details.janela_report.enviar:SetScript("OnClick", function() self:monta_relatorio(param2, options._custom) end)
--dumpt(param2) = {damage, spellName, spellId}
--print(param2, options._custom) options._custom = nil
--print("meu id:", self.meu_id)
local bIsCustom = true
Details.janela_report.enviar:SetScript("OnClick", function() self:monta_relatorio(param2, bIsCustom) end)
else
Details.janela_report.enviar:SetScript("OnClick", function() self:monta_relatorio(param2) end)
end
@@ -663,9 +667,9 @@ local createDropdown = function(thisFrame)
window:SetWidth(342/2 + 5)
window:SetHeight(195)
window:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
window:SetBackdropColor(1, 1, 1, 1)
window:SetBackdropBorderColor(0, 0, 0, 1)
--window:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
--window:SetBackdropColor(1, 1, 1, 1)
--window:SetBackdropBorderColor(0, 0, 0, 1)
if (not window.widgets) then
window.widgets = {}
@@ -674,20 +678,10 @@ local createDropdown = function(thisFrame)
titlebar:SetPoint("topleft", window, "topleft", 2, -3)
titlebar:SetPoint("topright", window, "topright", -2, -3)
titlebar:SetHeight(20)
titlebar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
titlebar:SetBackdropColor(.5, .5, .5, 1)
titlebar:SetBackdropBorderColor(0, 0, 0, 1)
--titlebar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
--titlebar:SetBackdropColor(.5, .5, .5, 1)
--titlebar:SetBackdropBorderColor(0, 0, 0, 1)
local bg1 = window:CreateTexture(nil, "background")
bg1:SetTexture([[Interface\AddOns\Details\images\background]], true)
bg1:SetAlpha(0.7)
bg1:SetVertexColor(0.27, 0.27, 0.27)
bg1:SetVertTile(true)
bg1:SetHorizTile(true)
bg1:SetAllPoints()
table.insert(window.all_widgets, bg1)
table.insert(window.widgets, bg1)
table.insert(window.all_widgets, titlebar)
table.insert(window.widgets, titlebar)
end