Release Candidate 1

This commit is contained in:
Tercio Jose
2022-11-18 16:54:25 -03:00
parent bbbda84c68
commit 1c8dfb3ab7
96 changed files with 3053 additions and 1427 deletions
+55 -31
View File
@@ -2,18 +2,24 @@
local Details = _G.Details
local DF = _G.DetailsFramework
local _
local _, Details222 = ...
_ = nil
local _GetSpellInfo = Details.GetSpellInfo
function Details:ScrollDamage()
if (not DetailsScrollDamage) then
DetailsScrollDamage = DetailsFramework:CreateSimplePanel(UIParent)
DetailsScrollDamage:SetSize(427 - 40 - 20 - 20, 505 - 150 + 20 + 40)
DetailsScrollDamage:SetTitle("Details! Scroll Damage (/details scroll)")
DetailsScrollDamage:SetTitle("/details scroll")
DetailsScrollDamage.Data = {}
DetailsScrollDamage:ClearAllPoints()
DetailsScrollDamage:SetPoint("left", UIParent, "left", 10, 0)
DetailsScrollDamage:Hide()
DetailsScrollDamage.Title:SetPoint("center", DetailsScrollDamage.TitleBar, "center", 108, 0)
DetailsFramework:ApplyStandardBackdrop(DetailsScrollDamage)
local scroll_width = 395 - 40 - 20 - 20
local scroll_height = 340
local scroll_lines = 16
@@ -24,9 +30,12 @@ function Details:ScrollDamage()
local backdrop_color_is_critical = {.4, .4, .2, 0.2}
local backdrop_color_is_critical_on_enter = {1, 1, .8, 0.4}
local dropdownTemplate = DetailsFramework:GetTemplate("dropdown", "OPTIONS_DROPDOWNDARK_TEMPLATE")
local y = -15
local headerY = y - 15
local scrollY = headerY - 20
local fontSize = 10
local LibWindow = _G.LibStub("LibWindow-1.1")
DetailsScrollDamage:SetScript("OnMouseDown", nil)
@@ -43,12 +52,15 @@ function Details:ScrollDamage()
LibWindow.MakeDraggable(DetailsScrollDamage)
LibWindow.RestorePosition(DetailsScrollDamage)
local scaleBar = DetailsFramework:CreateScaleBar(DetailsScrollDamage, Details.damage_scroll_position)
DetailsScrollDamage:SetScale(Details.damage_scroll_position.scale)
--header
local headerTable = {
{text = "", width = 20},
{text = "Spell Name", width = 104},
{text = "Amount", width = 60},
{text = "Time", width = 60},
{text = "Time", width = 45},
{text = "Spell ID", width = 80},
}
local headerOptions = {
@@ -60,7 +72,7 @@ function Details:ScrollDamage()
DetailsScrollDamage.searchText = ""
DetailsScrollDamage.searchCache = {}
local refreshFunc = function(self, data, offset, totalLines)
local refreshFunc = function(self, data, offset, totalLines) --~refresh
local ToK = _detalhes:GetCurrentToKFunction()
for i = 1, totalLines do
@@ -74,13 +86,14 @@ function Details:ScrollDamage()
local spellName, _, spellIcon
if (token ~= "SWING_DAMAGE") then
spellName, _, spellIcon = GetSpellInfo(spellID)
spellName, _, spellIcon = _GetSpellInfo(spellID)
else
spellName, _, spellIcon = GetSpellInfo(1)
spellName, _, spellIcon = _GetSpellInfo(1)
end
line.SpellID = spellID
line.IsCritical = isCritical
line.IconFrame.SpellID = spellID
if (isCritical) then
line:SetBackdropColor(unpack(backdrop_color_is_critical))
@@ -91,11 +104,12 @@ function Details:ScrollDamage()
if (spellName) then
line.Icon:SetTexture(spellIcon)
line.Icon:SetTexCoord(.1, .9, .1, .9)
line.DamageText.text = isCritical and "|cFFFFFF00" .. ToK(_, amount) or ToK(_, amount)
line.TimeText.text = format("%.2f", time - DetailsScrollDamage.Data.Started)
line.DamageText.text = isCritical and "|cFFFFFF00 " .. ToK(_, amount) or " " .. ToK(_, amount)
line.TimeText.text = " " .. format("%.2f", time - DetailsScrollDamage.Data.Started)
line.SpellIDText.text = spellID
line.SpellIDText:SetCursorPosition(0)
line.SpellNameText.text = spellName
DF:TruncateText(line.SpellNameText, 104)
line.SpellNameText:SetCursorPosition(0)
else
line:Hide()
end
@@ -103,41 +117,45 @@ function Details:ScrollDamage()
end
end
local lineOnEnter = function(self)
local lineOnEnter = function(self) --~onenter
--if this does not have IconFrame it means it is the IconFrame itself
if (not self.IconFrame) then
GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT")
GameTooltip:SetSpellByID(self.SpellID)
GameTooltip:AddLine(" ")
GameTooltip:Show()
self = self:GetParent()
end
if (self.IsCritical) then
self:SetBackdropColor(unpack(backdrop_color_is_critical_on_enter))
else
self:SetBackdropColor(unpack(backdrop_color_on_enter))
end
if (self.SpellID) then
--spell tooltip removed, it's to much annoying
--GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT")
--GameTooltip:SetSpellByID(self.SpellID)
--GameTooltip:AddLine(" ")
--GameTooltip:Show()
end
end
local lineOnLeave = function(self)
if (self.IsCritical) then
self:SetBackdropColor(unpack(backdrop_color_is_critical))
else
self:SetBackdropColor(unpack(backdrop_color))
local lineOnLeave = function(self) --~onleave
--if this has an icon frame it means its the line itself
if (self.IconFrame) then
if (self.IsCritical) then
self:SetBackdropColor(unpack(backdrop_color_is_critical))
else
self:SetBackdropColor(unpack(backdrop_color))
end
end
GameTooltip:Hide()
end
local createLineFunc = function(self, index)
local line = CreateFrame("button", "$parentLine" .. index, self,"BackdropTemplate")
line:SetPoint("topleft", self, "topleft", 1, -((index-1)*(scroll_line_height+1)) - 1)
line:SetSize(scroll_width - 2, scroll_line_height)
line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
line:SetBackdropColor(unpack(backdrop_color))
-- ~createline --~line
DF:Mixin(line, DF.HeaderFunctions)
line:SetScript("OnEnter", lineOnEnter)
@@ -147,17 +165,22 @@ function Details:ScrollDamage()
local icon = line:CreateTexture("$parentSpellIcon", "overlay")
icon:SetSize(scroll_line_height - 2, scroll_line_height - 2)
local iconFrame = CreateFrame("frame", "$parentIconFrame", line)
iconFrame:SetAllPoints(icon)
iconFrame:SetScript("OnEnter", lineOnEnter)
iconFrame:SetScript("OnLeave", lineOnLeave)
--spellname
local spellNameText = DF:CreateLabel(line)
local spellNameText = DetailsFramework:CreateTextEntry(line, function()end, DetailsScrollDamage.Header:GetColumnWidth(2), scroll_line_height, _, _, _, dropdownTemplate)
--damage
local damageText = DF:CreateLabel(line)
local damageText = DF:CreateLabel(line, "", fontSize, "white")
--time
local timeText = DF:CreateLabel(line)
local timeText = DF:CreateLabel(line, "", fontSize, "white")
--spell ID
local spellIDText = DF:CreateLabel(line)
local spellIDText = DetailsFramework:CreateTextEntry(line, function()end, DetailsScrollDamage.Header:GetColumnWidth(5), scroll_line_height, _, _, _, dropdownTemplate)
line:AddFrameToHeaderAlignment(icon)
line:AddFrameToHeaderAlignment(spellNameText)
@@ -168,6 +191,7 @@ function Details:ScrollDamage()
line:AlignWithHeader(DetailsScrollDamage.Header, "left")
line.Icon = icon
line.IconFrame = iconFrame
line.DamageText = damageText
line.TimeText = timeText
line.SpellIDText = spellIDText
@@ -251,7 +275,7 @@ function Details:ScrollDamage()
autoOpenCheckbox:SetAsCheckBox()
autoOpenCheckbox:SetPoint("left", statusBar, "left", 5, 0)
local autoOpenText = DetailsFramework:CreateLabel(statusBar, "Auto Open on Training Dummy")
local autoOpenText = DetailsFramework:CreateLabel(statusBar, "Auto Open on Training Dummy", 10)
autoOpenText:SetPoint("left", autoOpenCheckbox, "right", 2, 0)
--search bar