Skip to content

Commit 2348acb

Browse files
author
Zoooombie
committed
[WIP] add calcs & config sub-tabs of compare tab to style
1 parent 2fcfed0 commit 2348acb

4 files changed

Lines changed: 105 additions & 84 deletions

File tree

src/Classes/CalcBreakdownControl.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -558,18 +558,18 @@ function CalcBreakdownClass:DrawBreakdownTable(viewPort, x, y, section)
558558
col.x = colX
559559
if index > 1 then
560560
-- Skip the separator for the first column
561-
SetDrawColor(0.5, 0.5, 0.5)
561+
SetDrawStyle('calc_breakdown_tooltip_table')
562562
DrawImage(nil, colX - 2, y, 1, section.height - (section.label and 16 or 0) - (section.footer and 12 or 0))
563563
end
564-
SetDrawColor(1, 1, 1)
564+
SetDrawStyle('text_calc_breakdown')
565565
StyledDrawString(colX, y + 2, "LEFT", 16, 'text_calc_breakdown', col.label)
566566
colX = colX + col.width
567567
end
568568
end
569569
local rowY = y + 20
570570
for _, row in ipairs(section.rowList) do
571571
-- Draw row separator
572-
SetDrawColor(0.5, 0.5, 0.5)
572+
SetDrawStyle('calc_breakdown_tooltip_table')
573573
DrawImage(nil, x + 2, rowY - 1, section.width - 4, 1)
574574
for _, col in ipairs(section.colList) do
575575
if col.width and row[col.key] then
@@ -689,7 +689,7 @@ function CalcBreakdownClass:Draw(viewPort)
689689
self.y = y
690690
-- Draw background
691691
SetDrawLayer(nil, 10)
692-
SetDrawColor(0, 0, 0, 0.9)
692+
SetDrawStyle('tooltip_background')
693693
DrawImage(nil, x + 2, y + 2, width - 4, height - 4)
694694
-- Draw border (this is put in sub layer 11 so it draws over the contents, in case they don't fit the screen)
695695
SetDrawLayer(nil, 11)
@@ -711,15 +711,15 @@ function CalcBreakdownClass:Draw(viewPort)
711711
if section.type == "TEXT" then
712712
local lineY = sectionY + 2
713713
for i, line in ipairs(section.lines) do
714-
SetDrawColor(1, 1, 1)
714+
SetDrawStyle('text_calc_breakdown')
715715
local _, dec = string.gsub(line, "%.%d%d.", " ") -- counts decimals with 2 or more digits
716716
StyledDrawString(x + 4, lineY, "LEFT", section.textSize, 'text_calc_breakdown', formatNumSep(line))
717717
lineY = lineY + section.textSize
718718
end
719719
elseif section.type == "TABLE" then
720720
self:DrawBreakdownTable(viewPort, x, sectionY, section)
721721
elseif section.type == "RADIUS" then
722-
SetDrawColor(1, 1, 1)
722+
SetDrawStyle('calc_breakdown_tooltip_image_border')
723723
DrawImage(nil, x + 2, sectionY, section.width - 4, section.height)
724724
self:DrawRadiusVisual(x + 4, sectionY + 2, section.width - 8, section.height - 4, section.radius)
725725
end

src/Classes/CompareCalcsHelpers.lua

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -422,12 +422,12 @@ function M.DrawSkillBreakdownPanel(build, breakdownKey, label, cellX, cellY, cel
422422

423423
-- Draw background
424424
SetDrawLayer(nil, 10)
425-
SetDrawColor(0, 0, 0, 0.9)
425+
SetDrawStyle('tooltip_background')
426426
DrawImage(nil, panelX + 2, panelY + 2, panelW - 4, panelH - 4)
427427

428428
-- Draw border
429429
SetDrawLayer(nil, 11)
430-
SetDrawColor(0.33, 0.66, 0.33)
430+
SetDrawStyle('calc_breakdown_tooltip_border')
431431
DrawImage(nil, panelX, panelY, panelW, 2)
432432
DrawImage(nil, panelX, panelY + panelH - 2, panelW, 2)
433433
DrawImage(nil, panelX, panelY, 2, panelH)
@@ -439,23 +439,24 @@ function M.DrawSkillBreakdownPanel(build, breakdownKey, label, cellX, cellY, cel
439439
for i, col in ipairs(colDefs) do
440440
col.x = colX
441441
if i > 1 then
442-
SetDrawColor(0.5, 0.5, 0.5)
442+
SetDrawStyle('calc_breakdown_tooltip_table')
443443
DrawImage(nil, colX - 2, panelY + 2, 1, panelH - 4)
444444
end
445-
SetDrawColor(1, 1, 1)
446-
DrawString(colX, panelY + 2, "LEFT", 16, "VAR", col.label)
445+
SetDrawStyle('text_calc_breakdown')
446+
StyledDrawString(colX, panelY + 2, "LEFT", 16, 'text_calc_breakdown', col.label)
447447
colX = colX + col.width
448448
end
449449

450450
-- Draw rows
451451
local rowY = panelY + headerRowH
452452
for _, row in ipairs(rows) do
453453
-- Row separator
454-
SetDrawColor(0.5, 0.5, 0.5)
454+
SetDrawStyle('calc_breakdown_tooltip_table')
455455
DrawImage(nil, panelX + 2, rowY - 1, panelW - 4, 1)
456456
for _, col in ipairs(colDefs) do
457457
if row[col.key] and row[col.key] ~= "" then
458-
DrawString(col.x, rowY + 1, "LEFT", 12, "VAR", "^7" .. row[col.key])
458+
SetDrawStyle('text_calc_breakdown')
459+
StyledDrawString(col.x, rowY + 1, "LEFT", 12, 'text_calc_breakdown', row[col.key])
459460
end
460461
end
461462
rowY = rowY + dataRowH

0 commit comments

Comments
 (0)