From acc03f47694b70b21a149400f3f0c66139aff882 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Fri, 8 Mar 2024 14:03:34 -0300 Subject: [PATCH] Another round of polishing and few aditions - Added bar texture "Skyline Compact". - Tooltip show 8 spells, up from 6. - Breakdown color scheme improved. - Backend changes. --- Libs/DF/fw.lua | 6 ++++++ boot.lua | 4 +++- classes/class_damage.lua | 10 +++++++-- core/control.lua | 19 +++++++++++++++--- core/gears.lua | 3 ++- .../breakdown_spells_spellframes.lua | 2 +- .../window_playerbreakdown.lua | 10 +++++++++ .../window_playerbreakdown_list.lua | 6 +++--- .../window_playerbreakdown_spells.lua | 13 ++++++++---- functions/profiles.lua | 1 + images/bar_textures/bar_skyline_compact.png | Bin 0 -> 4557 bytes startup.lua | 2 ++ 12 files changed, 61 insertions(+), 15 deletions(-) create mode 100644 images/bar_textures/bar_skyline_compact.png diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index ca68c24c3..2fccc5848 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -2658,6 +2658,12 @@ function detailsFramework:SetTemplate(frame, template) frame:HookScript("OnLeave", templateOnLeave) end end + + elseif (frame.SetColorTexture) then + if (template.backdropcolor) then + local r, g, b, a = detailsFramework:ParseColors(template.backdropcolor) + frame:SetColorTexture(r, g, b, a) + end end if (frame.SetIcon) then diff --git a/boot.lua b/boot.lua index 988d3ed27..038b8003c 100644 --- a/boot.lua +++ b/boot.lua @@ -1236,9 +1236,11 @@ do SharedMedia:Register("statusbar", "Details D'ictum (reverse)", [[Interface\AddOns\Details\images\bar4_reverse]]) --flat bars + SharedMedia:Register("statusbar", "Skyline", [[Interface\AddOns\Details\images\bar_skyline]]) + SharedMedia:Register("statusbar", "Details Serenity", [[Interface\AddOns\Details\images\bar_serenity]]) SharedMedia:Register("statusbar", "BantoBar", [[Interface\AddOns\Details\images\BantoBar]]) - SharedMedia:Register("statusbar", "Skyline", [[Interface\AddOns\Details\images\bar_skyline]]) + SharedMedia:Register("statusbar", "Skyline Compact", [[Interface\AddOns\Details\images\bar_textures\bar_skyline_compact.png]]) SharedMedia:Register("statusbar", "WorldState Score", [[Interface\WorldStateFrame\WORLDSTATEFINALSCORE-HIGHLIGHT]]) SharedMedia:Register("statusbar", "DGround", [[Interface\AddOns\Details\images\bar_background]]) SharedMedia:Register("statusbar", "Details Flat", [[Interface\AddOns\Details\images\bar_background]]) diff --git a/classes/class_damage.lua b/classes/class_damage.lua index a486388fa..af46390a5 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -3891,6 +3891,7 @@ function damageClass:ToolTip_DamageDone (instancia, numero, barra, keydown) if (ActorDamage == 0) then ActorDamage = 0.00000001 end + local ActorSkillsContainer = self.spells._ActorTable local ActorSkillsSortTable = {} @@ -3959,6 +3960,11 @@ function damageClass:ToolTip_DamageDone (instancia, numero, barra, keydown) --Details:AddTooltipHeaderStatusbar (r, g, b, barAlha) end + GameCooltip:SetOption("AlignAsBlizzTooltip", false) + GameCooltip:SetOption("AlignAsBlizzTooltipFrameHeightOffset", -6) + GameCooltip:SetOption("YSpacingMod", -6) + local iconSize = Details.DefaultTooltipIconSize + local topAbility = ActorSkillsSortTable [1] and ActorSkillsSortTable [1][2] or 0.0001 if (#ActorSkillsSortTable > 0) then @@ -3992,7 +3998,7 @@ function damageClass:ToolTip_DamageDone (instancia, numero, barra, keydown) GameCooltip:AddLine(nome_magia, FormatTooltipNumber (_, _math_floor(totalDPS)) .." ("..percent.."%)") end - GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W + 4, icon_size.H + 4, icon_border.L, icon_border.R, icon_border.T, icon_border.B) + GameCooltip:AddIcon (icone_magia, nil, nil, iconSize, iconSize, icon_border.L, icon_border.R, icon_border.T, icon_border.B) Details:AddTooltipBackgroundStatusbar (false, totalDamage/topAbility*100) end else @@ -4015,7 +4021,7 @@ function damageClass:ToolTip_DamageDone (instancia, numero, barra, keydown) if (spellName) then GameCooltip:AddLine(spellName, FormatTooltipNumber (_, damageDone) .. " (" .. _math_floor(damageDone / self.total * 100) .. "%)") Details:AddTooltipBackgroundStatusbar (false, damageDone / self.total * 100) - GameCooltip:AddIcon (spellIcon, 1, 1, icon_size.W, icon_size.H, 0.1, 0.9, 0.1, 0.9) + GameCooltip:AddIcon (spellIcon, 1, 1, iconSize, iconSize, 0.1, 0.9, 0.1, 0.9) end end end diff --git a/core/control.lua b/core/control.lua index 667f53229..fb91b8a12 100644 --- a/core/control.lua +++ b/core/control.lua @@ -1590,10 +1590,10 @@ GameCooltip:SetOption("RightBorderSize", 2) --offset between the right border and the right icon, default: -10 + offset GameCooltip:SetOption("VerticalOffset", 5) --amount of space to leave between the top border and the first line of the tooltip, default: 0 GameCooltip:SetOption("RightTextMargin", 0) --offset between the right text to the right icon, default: -3 - GameCooltip:SetOption("AlignAsBlizzTooltip", true) - GameCooltip:SetOption("AlignAsBlizzTooltipFrameHeightOffset", -8) + GameCooltip:SetOption("AlignAsBlizzTooltip", false) GameCooltip:SetOption("LineHeightSizeOffset", 4) GameCooltip:SetOption("VerticalPadding", -4) + GameCooltip:SetOption("YSpacingMod", -6) GameCooltip:SetBackdrop(1, Details.cooltip_preset2_backdrop, bgColor, borderColor) end @@ -1775,6 +1775,12 @@ self:RefreshMainWindow(true) end + function Details:RefreshAllMainWindowsTemp() + return Details:RefreshMainWindow(-1) + end + + local nextBreakdownUpdateAt = 0 + function Details:RefreshMainWindow(instanceObject, bForceRefresh) --getting deprecated soon if (not instanceObject or type(instanceObject) == "boolean") then bForceRefresh = instanceObject @@ -1813,7 +1819,14 @@ local actorObject = Details:GetActorObjectFromBreakdownWindow() if (actorObject) then if (actorObject and not actorObject.__destroyed) then - return actorObject:MontaInfo() --MontaInfo a nil value + if (nextBreakdownUpdateAt < GetTime()) then + if (Details.in_combat) then + nextBreakdownUpdateAt = GetTime() + 0.5 + else + nextBreakdownUpdateAt = GetTime() + 5 + end + return actorObject:MontaInfo() + end else Details:Msg("Invalid actor object on breakdown window.") if (actorObject.__destroyed) then diff --git a/core/gears.lua b/core/gears.lua index 48a022c55..3e1446e89 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -508,7 +508,8 @@ function _detalhes:RefreshUpdater(suggested_interval) if (specialserials[specialSerial]) then return end --_detalhes.atualizador = _detalhes:ScheduleRepeatingTimer("RefreshMainWindow", updateInterval, -1) - _detalhes.atualizador = Details.Schedules.NewTicker(updateInterval, Details.RefreshMainWindow, Details, -1) + --_detalhes.atualizador = Details.Schedules.NewTicker(updateInterval, Details.RefreshMainWindow, Details, -1) + _detalhes.atualizador = C_Timer.NewTicker(updateInterval, Details.RefreshAllMainWindowsTemp) end ---set the amount of time between each update of all windows diff --git a/frames/window_breakdown/breakdown_spells_spellframes.lua b/frames/window_breakdown/breakdown_spells_spellframes.lua index d9e5f03ff..639f4db36 100644 --- a/frames/window_breakdown/breakdown_spells_spellframes.lua +++ b/frames/window_breakdown/breakdown_spells_spellframes.lua @@ -960,7 +960,7 @@ local updateSpellBar = function(spellBar, index, actorName, combatObject, scroll spellBar.spellId = spellId spellBar.spellIconFrame.spellId = spellId - spellBar.statusBar.backgroundTexture:SetAlpha(Details.breakdown_spell_tab.spellbar_background_alpha) + --spellBar.statusBar.backgroundTexture:SetAlpha(Details.breakdown_spell_tab.spellbar_background_alpha) --statusbar color by school local r, g, b = Details:GetSpellSchoolColor(spellTable.spellschool or 1) diff --git a/frames/window_breakdown/window_playerbreakdown.lua b/frames/window_breakdown/window_playerbreakdown.lua index 8bcad7299..0d18855f8 100644 --- a/frames/window_breakdown/window_playerbreakdown.lua +++ b/frames/window_breakdown/window_playerbreakdown.lua @@ -202,6 +202,16 @@ function Details222.BreakdownWindow.ApplyFontSettings(fontString) detailsFramework:SetFontFace(fontString, Details.breakdown_general.font_face) end +function Details222.BreakdownWindow.ApplyTextureSettings(statusBar) + local textureFile = SharedMedia:Fetch("statusbar", Details.breakdown_general.bar_texture) + local texture = statusBar:GetStatusBarTexture() + if (texture) then + texture:SetTexture(textureFile) + else + statusBar:SetStatusBarTexture(textureFile) + end +end + ------------------------------------------------------------------------------------------------------------------------------ --self = instancia --jogador = classe_damage ou classe_heal diff --git a/frames/window_breakdown/window_playerbreakdown_list.lua b/frames/window_breakdown/window_playerbreakdown_list.lua index 12156401b..018c38a87 100644 --- a/frames/window_breakdown/window_playerbreakdown_list.lua +++ b/frames/window_breakdown/window_playerbreakdown_list.lua @@ -281,6 +281,8 @@ local createPlayerScrollBox = function(breakdownWindowFrame, breakdownSideMenu, Details222.BreakdownWindow.ApplyFontSettings(self.itemLevelText) Details222.BreakdownWindow.ApplyFontSettings(self.percentileText) + Details222.BreakdownWindow.ApplyTextureSettings(self.totalStatusBar) + --set the statusbar local r, g, b = self.playerObject:GetClassColor() self.totalStatusBar:SetStatusBarColor(r, g, b, 1) @@ -364,12 +366,10 @@ local createPlayerScrollBox = function(breakdownWindowFrame, breakdownSideMenu, rankText.textsize = fontSize local totalStatusBar = CreateFrame("statusbar", nil, line) - totalStatusBar:SetSize(scrollbox_size[1]-player_line_height, 4) + totalStatusBar:SetSize(scrollbox_size[1]-player_line_height, player_line_height) totalStatusBar:SetMinMaxValues(0, 100) - totalStatusBar:SetStatusBarTexture([[Interface\AddOns\Details\images\bar_skyline]]) totalStatusBar:SetFrameLevel(line:GetFrameLevel()+1) totalStatusBar:SetAlpha(0.5) - totalStatusBar:SetPoint("bottomleft", specIcon, "bottomright", 0, 0) line.specIcon = specIcon diff --git a/frames/window_breakdown/window_playerbreakdown_spells.lua b/frames/window_breakdown/window_playerbreakdown_spells.lua index cdf507628..4576cc50d 100644 --- a/frames/window_breakdown/window_playerbreakdown_spells.lua +++ b/frames/window_breakdown/window_playerbreakdown_spells.lua @@ -562,7 +562,7 @@ function spellsTab.OnCreateTabCallback(tabButton, tabFrame) --~init --create a button in the breakdown window to open the options for this tab 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:SetPoint("bottomright", tabFrame, "bottomright", -10, -16) optionsButton:SetTemplate("STANDARD_GRAY") optionsButton:SetIcon(Details:GetTextureAtlas("breakdown-icon-optionsbutton")) optionsButton.textsize = 12 @@ -662,9 +662,14 @@ end function spellsTab.UpdateBarSettings(bar) if (bar.statusBar) then bar.statusBar:SetAlpha(Details.breakdown_spell_tab.statusbar_alpha) --could be moved to when the bar is updated - bar.statusBar:GetStatusBarTexture():SetTexture(Details.breakdown_spell_tab.statusbar_texture) - bar.statusBar.backgroundTexture:SetColorTexture(unpack(Details.breakdown_spell_tab.statusbar_background_color)) - bar.statusBar.backgroundTexture:SetAlpha(Details.breakdown_spell_tab.statusbar_background_alpha) + + --bar.statusBar:GetStatusBarTexture():SetTexture(Details.breakdown_spell_tab.statusbar_texture) + Details222.BreakdownWindow.ApplyTextureSettings(bar.statusBar) + + --bar.statusBar.backgroundTexture:SetColorTexture(unpack(Details.breakdown_spell_tab.statusbar_background_color)) + --bar.statusBar.backgroundTexture:SetAlpha(Details.breakdown_spell_tab.statusbar_background_alpha) + + detailsFramework:SetTemplate(bar.statusBar.backgroundTexture, "STANDARD_GRAY") end end diff --git a/functions/profiles.lua b/functions/profiles.lua index 970164444..3307111c4 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -1448,6 +1448,7 @@ local default_global_data = { font_color = {0.9, 0.9, 0.9, 0.923}, font_outline = "NONE", font_face = "DEFAULT", + bar_texture = "Skyline", }, frame_background_color = {0.1215, 0.1176, 0.1294, 0.8}, diff --git a/images/bar_textures/bar_skyline_compact.png b/images/bar_textures/bar_skyline_compact.png new file mode 100644 index 0000000000000000000000000000000000000000..6e81c18af272b598f001f8fa4d5ba9e4430d0aea GIT binary patch literal 4557 zcmcgwcU)815)L38S6Bo^c^CpHHI*9aNq`_tiUKNbNNz|ZBq0ecRF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4@*k|~|84VwzP6(Loc?mWt6u7FczJ;UTwwV`C4Y1l7)jMS$DzELmo}$0$PF)AiR^BR_ni(rY zl$H}|h_K8&yyfxO(H*skM3k7@*I<<4J2dS6sEEF*{Yv$Ty}F;c=`cRYeERbB%|rbur~I;#R75Av`JFOqX>*(? zwuu#>mN7Aw;eZy{199lSm9o&xJi0{>o8yWSGAWL zJ519o?fap(3)K~EQ)(17u4|i?i1yUlpKLL8+jo$csi#4m4$a=R4XzsF)`eNOWMxcO z^ovtTl{#^#E6>jlsupakFO;jcT#@^Z)_Hwv;pX>w=ni7(!+~+hZ1v=c^qv?E!M`v> Mf(yRX_NVxN0x2)a=Kufz literal 0 HcmV?d00001 diff --git a/startup.lua b/startup.lua index 3ea35d465..e80438ef7 100644 --- a/startup.lua +++ b/startup.lua @@ -550,6 +550,8 @@ function Details:StartMeUp() Details.standard_skin = false --enforce to show 6 abilities on the tooltip --_detalhes.tooltip.tooltip_max_abilities = 6 freeeeeedooommmmm + --no no, enforece 8, 8 is much better, 8 is more lines, we like 8 + Details.tooltip.tooltip_max_abilities = 8 Details.InstallRaidInfo()