Skip to content

Commit

Permalink
Another round of polishing and few aditions
Browse files Browse the repository at this point in the history
- Added bar texture "Skyline Compact".
- Tooltip show 8 spells, up from 6.
- Breakdown color scheme improved.
- Backend changes.
  • Loading branch information
Tercioo committed Mar 8, 2024
1 parent c1e1191 commit acc03f4
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 15 deletions.
6 changes: 6 additions & 0 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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]])
Expand Down
10 changes: 8 additions & 2 deletions classes/class_damage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
19 changes: 16 additions & 3 deletions core/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion core/gears.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frames/window_breakdown/breakdown_spells_spellframes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions frames/window_breakdown/window_playerbreakdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions frames/window_breakdown/window_playerbreakdown_list.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions frames/window_breakdown/window_playerbreakdown_spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions functions/profiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
Binary file added images/bar_textures/bar_skyline_compact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit acc03f4

Please sign in to comment.