General development and bug fixes (see commit description).

- Fixed the deaths display, where the windows wasn't usig custom text scripts.
- Fixed an issue with custom displays, where it was unable to use class colors in their texts.
- More development and bug fixes on the new Mythic+ Run Completion panel.
- Framework Update.
This commit is contained in:
Tercio Jose
2024-02-13 13:24:28 -03:00
parent 18e7464cef
commit 2fd02eebb1
19 changed files with 5685 additions and 1758 deletions
+60 -100
View File
@@ -20,8 +20,8 @@ local mythicDungeonCharts = Details222.MythicPlus.Charts.Listener
local mythicDungeonFrames = Details222.MythicPlus.Frames
--debug
--_G.DetailsMythicDungeonChartHandler = mythicDungeonCharts
_G.MythicDungeonFrames = mythicDungeonFrames
--/run _G.MythicDungeonFrames.ShowEndOfMythicPlusPanel(true)
local createPlayerBanner = function(parent, name)
local template = "ChallengeModeBannerPartyMemberTemplate"
@@ -336,100 +336,6 @@ function mythicDungeonFrames.ShowEndOfMythicPlusPanel(bIsDebug)
Details222.MythicPlus.Level = Details222.MythicPlus.Level or 2
end
--feature under development
if (false and Details222.MythicPlus.Level and Details222.MythicPlus.Level < 28 and not Details.user_is_patreon_supporter) then
--create the panel
if (not mythicDungeonFrames.ReadyFrame) then
mythicDungeonFrames.ReadyFrame = CreateFrame("frame", "DetailsMythicDungeonReadyFrame", UIParent, "BackdropTemplate")
local readyFrame = mythicDungeonFrames.ReadyFrame
local textColor = {1, 0.8196, 0, 1}
local textSize = 11
local roundedCornerTemplate = {
roundness = 6,
color = {.1, .1, .1, 0.98},
border_color = {.05, .05, .05, 0.834},
}
detailsFramework:AddRoundedCornersToFrame(readyFrame, roundedCornerTemplate)
local titleLabel = DetailsFramework:CreateLabel(readyFrame, "Details! Mythic Run Completed!", 12, "yellow")
titleLabel:SetPoint("top", readyFrame, "top", 0, -7)
titleLabel.textcolor = textColor
local closeButton = detailsFramework:CreateCloseButton(readyFrame, "$parentCloseButton")
closeButton:SetPoint("topright", readyFrame, "topright", -2, -2)
closeButton:SetScale(1.4)
closeButton:SetAlpha(0.823)
readyFrame:SetSize(255, 120)
readyFrame:SetPoint("center", UIParent, "center", 300, 0)
readyFrame:SetFrameStrata("LOW")
readyFrame:EnableMouse(true)
readyFrame:SetMovable(true)
--DetailsFramework:ApplyStandardBackdrop(readyFrame)
--DetailsFramework:CreateTitleBar (readyFrame, "Details! Mythic Run Completed!")
readyFrame:Hide()
--register to libwindow
local LibWindow = LibStub("LibWindow-1.1")
LibWindow.RegisterConfig(readyFrame, Details.mythic_plus.mythicrun_chart_frame_ready)
LibWindow.RestorePosition(readyFrame)
LibWindow.MakeDraggable(readyFrame)
LibWindow.SavePosition(readyFrame)
--show button
---@type df_button
readyFrame.ShowChartButton = DetailsFramework:CreateButton(readyFrame, function() mythicDungeonCharts.ShowChart(); readyFrame:Hide() end, 80, 20, "Show Damage Graphic")
readyFrame.ShowChartButton:SetTemplate(DetailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
readyFrame.ShowChartButton:SetPoint("topleft", readyFrame, "topleft", 5, -30)
readyFrame.ShowChartButton:SetIcon([[Interface\AddOns\Details\images\icons2.png]], 16, 16, "overlay", {42/512, 75/512, 153/512, 187/512}, {.7, .7, .7, 1}, nil, 0, 0)
readyFrame.ShowChartButton.textcolor = textColor
--disable feature check box (dont show this again)
local on_switch_enable = function(self, _, value)
Details.mythic_plus.show_damage_graphic = not value
end
local notAgainSwitch, notAgainLabel = DetailsFramework:CreateSwitch(readyFrame, on_switch_enable, not Details.mythic_plus.show_damage_graphic, _, _, _, _, _, _, _, _, _, Loc ["STRING_MINITUTORIAL_BOOKMARK4"], DetailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"), "GameFontHighlightLeft")
notAgainSwitch:ClearAllPoints()
notAgainLabel:SetPoint("left", notAgainSwitch, "right", 2, 0)
notAgainSwitch:SetPoint("bottomleft", readyFrame, "bottomleft", 5, 5)
notAgainSwitch:SetAsCheckBox()
notAgainLabel.textSize = textSize
local timeNotInCombatLabel = DetailsFramework:CreateLabel(readyFrame, "Time not in combat:", textSize, "orangered")
timeNotInCombatLabel:SetPoint("bottomleft", notAgainSwitch, "topleft", 0, 7)
local timeNotInCombatAmount = DetailsFramework:CreateLabel(readyFrame, "00:00", textSize, "orangered")
timeNotInCombatAmount:SetPoint("left", timeNotInCombatLabel, "left", 130, 0)
local elapsedTimeLabel = DetailsFramework:CreateLabel(readyFrame, "Run Time:", textSize, textColor)
elapsedTimeLabel:SetPoint("bottomleft", timeNotInCombatLabel, "topleft", 0, 5)
local elapsedTimeAmount = DetailsFramework:CreateLabel(readyFrame, "00:00", textSize, textColor)
elapsedTimeAmount:SetPoint("left", elapsedTimeLabel, "left", 130, 0)
readyFrame.TimeNotInCombatAmountLabel = timeNotInCombatAmount
readyFrame.ElapsedTimeAmountLabel = elapsedTimeAmount
end
mythicDungeonFrames.ReadyFrame:Show()
--update the run time and time not in combat
local elapsedTime = Details222.MythicPlus.time or 1507
mythicDungeonFrames.ReadyFrame.ElapsedTimeAmountLabel.text = DetailsFramework:IntegerToTimer(elapsedTime)
local overallMythicDungeonCombat = Details:GetCurrentCombat()
if (overallMythicDungeonCombat:GetCombatType() == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL) then
local combatTime = overallMythicDungeonCombat:GetCombatTime()
local notInCombat = elapsedTime - combatTime
mythicDungeonFrames.ReadyFrame.TimeNotInCombatAmountLabel.text = DetailsFramework:IntegerToTimer(notInCombat) .. " (" .. math.floor(notInCombat / elapsedTime * 100) .. "%)"
end
return
end
--create the panel
if (not mythicDungeonFrames.ReadyFrame) then
mythicDungeonFrames.ReadyFrame = CreateFrame("frame", "DetailsMythicDungeonReadyFrame", UIParent, "BackdropTemplate")
@@ -457,7 +363,7 @@ function mythicDungeonFrames.ShowEndOfMythicPlusPanel(bIsDebug)
closeButton:SetAlpha(0.823)
readyFrame:SetSize(355, 390)
readyFrame:SetPoint("center", UIParent, "center", 300, 0)
readyFrame:SetPoint("center", UIParent, "center", 350, 0)
readyFrame:SetFrameStrata("LOW")
readyFrame:EnableMouse(true)
readyFrame:SetMovable(true)
@@ -465,11 +371,60 @@ function mythicDungeonFrames.ShowEndOfMythicPlusPanel(bIsDebug)
--register to libwindow
local LibWindow = LibStub("LibWindow-1.1")
LibWindow.RegisterConfig(readyFrame, Details.mythic_plus.mythicrun_chart_frame_ready)
LibWindow.RegisterConfig(readyFrame, Details.mythic_plus.finished_run_frame)
LibWindow.RestorePosition(readyFrame)
LibWindow.MakeDraggable(readyFrame)
LibWindow.SavePosition(readyFrame)
--waiting for loot label
local waitingForLootLabel = DetailsFramework:CreateLabel(readyFrame, "Waiting for loot", 12, "silver")
waitingForLootLabel:SetPoint("bottom", readyFrame, "bottom", 0, 54)
waitingForLootLabel:Hide()
local waitingForLootDotsAnimationLabel = DetailsFramework:CreateLabel(readyFrame, "...", 12, "silver")
waitingForLootDotsAnimationLabel:SetPoint("left", waitingForLootLabel, "right", 0, 0)
waitingForLootDotsAnimationLabel:Hide()
--make a text dot animation, which will show no dots at start and then "." then ".." then "..." and back to "" and so on
function readyFrame.StartTextDotAnimation()
--update the Waiting for Loot labels
waitingForLootLabel:Show()
waitingForLootDotsAnimationLabel:Show()
local dots = waitingForLootDotsAnimationLabel
local dotsCount = 0
local maxDots = 3
local maxLoops = 24
local dotsTimer = C_Timer.NewTicker(0.5, function()
dotsCount = dotsCount + 1
if (dotsCount > maxDots) then
dotsCount = 0
end
local dotsText = ""
for i = 1, dotsCount do
dotsText = dotsText .. "."
end
dots:SetText(dotsText)
end, maxLoops)
waitingForLootDotsAnimationLabel.dotsTimer = dotsTimer
end
function readyFrame.StopTextDotAnimation()
waitingForLootLabel:Hide()
waitingForLootDotsAnimationLabel:Hide()
if (waitingForLootDotsAnimationLabel.dotsTimer) then
waitingForLootDotsAnimationLabel.dotsTimer:Cancel()
end
end
readyFrame:SetScript("OnHide", function(self)
readyFrame.StopTextDotAnimation()
end)
--warning footer
local warningFooter = DetailsFramework:CreateLabel(readyFrame, "Under development.", 9, "yellow")
warningFooter:SetPoint("bottom", readyFrame, "bottom", 0, 20)
@@ -590,13 +545,14 @@ function mythicDungeonFrames.ShowEndOfMythicPlusPanel(bIsDebug)
--print("equip loc:", itemEquipLoc)
if (effectiveILvl > 300) then --avoid showing loot that isn't items
local rarityColor = ITEM_QUALITY_COLORS[itemQuality]
lootSquare.LootIconBorder:SetVertexColor(rarityColor.r, rarityColor.g, rarityColor.b, 1)
lootSquare.LootIcon:SetTexture(GetItemIcon(itemID))
lootSquare.LootItemLevel:SetText(effectiveILvl or "0")
readyFrame.StopTextDotAnimation()
--print("loot info:", itemLink, effectiveILvl, itemQuality)
lootSquare:Show()
end
@@ -637,11 +593,15 @@ function mythicDungeonFrames.ShowEndOfMythicPlusPanel(bIsDebug)
readyFrame.YouBeatTheTimerLabel = youBeatTheTimerLabel
readyFrame.KeystoneUpgradeLabel = keystoneUpgradeLabel
readyFrame.RantingLabel = rantingLabel
end
end --end of creating of the readyFrame
--mythic+ finished, showing the readyFrame for the user
local readyFrame = mythicDungeonFrames.ReadyFrame
readyFrame:Show()
readyFrame.StartTextDotAnimation()
for i = 1, #readyFrame.PlayerBanners do
--hide the lootSquare
readyFrame.PlayerBanners[i].LootSquare:Hide()