Skip to content

Commit

Permalink
Two other files from the commit remake
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed May 28, 2019
1 parent 6069094 commit b3ab193
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 3 deletions.
62 changes: 60 additions & 2 deletions Libs/DF/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5226,7 +5226,16 @@ DF.HeaderFunctions = {
frame:ClearAllPoints()

local headerFrame = headerFrames [i]
frame:SetPoint (anchor, self, anchor, headerFrame.XPosition, 0)
local offset = 0

if (headerFrame.columnAlign == "right") then
offset = headerFrame:GetWidth()
if (frame:GetObjectType() == "FontString") then
frame:SetJustifyH ("right")
end
end

frame:SetPoint (headerFrame.columnAlign, self, anchor, headerFrame.XPosition + headerFrame.columnOffset + offset, 0)
end
end,
}
Expand Down Expand Up @@ -5266,13 +5275,51 @@ DF.HeaderCoreFunctions = {
--> grow direction
if (not previousHeaderFrame) then
headerFrame:SetPoint ("topleft", self, "topleft", 0, 0)

if (growDirection == "right") then
if (self.options.use_line_separators) then
headerFrame.Separator:Show()
headerFrame.Separator:SetWidth (self.options.line_separator_width)
headerFrame.Separator:SetColorTexture (unpack (self.options.line_separator_color))

headerFrame.Separator:ClearAllPoints()
if (self.options.line_separator_gap_align) then
headerFrame.Separator:SetPoint ("topleft", headerFrame, "topright", 0, 0)
else
headerFrame.Separator:SetPoint ("topright", headerFrame, "topright", 0, 0)
end
headerFrame.Separator:SetHeight (self.options.line_separator_height)
end
end

else
if (growDirection == "right") then
headerFrame:SetPoint ("topleft", previousHeaderFrame, "topright", self.options.padding, 0)

if (self.options.use_line_separators) then
headerFrame.Separator:Show()
headerFrame.Separator:SetWidth (self.options.line_separator_width)
headerFrame.Separator:SetColorTexture (unpack (self.options.line_separator_color))

headerFrame.Separator:ClearAllPoints()
if (self.options.line_separator_gap_align) then
headerFrame.Separator:SetPoint ("topleft", headerFrame, "topright", 0, 0)
else
headerFrame.Separator:SetPoint ("topleft", headerFrame, "topright", 0, 0)
end
headerFrame.Separator:SetHeight (self.options.line_separator_height)

if (headerSize == i) then
headerFrame.Separator:Hide()
end
end

elseif (growDirection == "left") then
headerFrame:SetPoint ("topright", previousHeaderFrame, "topleft", -self.options.padding, 0)

elseif (growDirection == "bottom") then
headerFrame:SetPoint ("topleft", previousHeaderFrame, "bottomleft", 0, -self.options.padding)

elseif (growDirection == "top") then
headerFrame:SetPoint ("bottomleft", previousHeaderFrame, "topleft", 0, self.options.padding)
end
Expand Down Expand Up @@ -5330,6 +5377,9 @@ DF.HeaderCoreFunctions = {
headerFrame.XPosition = self.HeaderWidth-- + self.options.padding
headerFrame.YPosition = self.HeaderHeight-- + self.options.padding

headerFrame.columnAlign = headerData.align or "left"
headerFrame.columnOffset = headerData.offset or 0

--> add the header piece size to the total header size
local growDirection = string.lower (self.options.grow_direction)

Expand Down Expand Up @@ -5368,8 +5418,11 @@ DF.HeaderCoreFunctions = {
local newHeader = CreateFrame ("frame", "$parentHeaderIndex" .. nextHeader, self)

DF:CreateImage (newHeader, "", self.options.header_height, self.options.header_height, "ARTWORK", nil, "Icon", "$parentIcon")
DF:CreateImage (newHeader, "", 1, 1, "ARTWORK", nil, "Separator", "$parentSeparator")
DF:CreateLabel (newHeader, "", self.options.text_size, self.options.text_color, "GameFontNormal", "Text", "$parentText", "ARTWORK")

newHeader.Separator:Hide()

tinsert (self.HeadersCreated, newHeader)
headerFrame = newHeader
end
Expand Down Expand Up @@ -5401,7 +5454,12 @@ local default_header_options = {
header_backdrop_border_color = {0, 0, 0, 0},
header_width = 120,
header_height = 20,


use_line_separators = false,
line_separator_color = {.1, .1, .1, .6},
line_separator_width = 1,
line_separator_height = 200,
line_separator_gap_align = false,
}

function DF:CreateHeader (parent, headerTable, options)
Expand Down
2 changes: 1 addition & 1 deletion functions/dungeon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function mythicDungeonCharts:OnBossDefeated()
local currentCombat = Details:GetCurrentCombat()
local segmentType = currentCombat:GetCombatType()
local bossInfo = currentCombat:GetBossInfo()
local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo()
local mythicLevel = C_ChallengeMode and C_ChallengeMode.GetActiveKeystoneInfo()

if (mythicLevel and mythicLevel > 0) then
if (mythicDungeonCharts.ChartTable and mythicDungeonCharts.ChartTable.Running and bossInfo) then
Expand Down

0 comments on commit b3ab193

Please sign in to comment.