Added option to change the vertical offset for bar text.

Added option to change the horizontal offset for the left bar text.
This commit is contained in:
SVENT\Eric
2023-02-23 18:16:32 +01:00
parent 6d43f0fb5c
commit 2a358c8305
3 changed files with 48 additions and 11 deletions
+18 -11
View File
@@ -4165,7 +4165,7 @@ function gump:CreateNewLine(instance, index)
return newLine
end
function Details:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, rightcolorbyclass, leftoutline, rightoutline, customrighttextenabled, customrighttext, percentage_type, showposition, customlefttextenabled, customlefttext, smalloutline_left, smalloutlinecolor_left, smalloutline_right, smalloutlinecolor_right, translittext)
function Details:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, rightcolorbyclass, leftoutline, rightoutline, customrighttextenabled, customrighttext, percentage_type, showposition, customlefttextenabled, customlefttext, smalloutline_left, smalloutlinecolor_left, smalloutline_right, smalloutlinecolor_right, translittext, yoffset, leftoffset)
--size
if (size) then
@@ -4255,6 +4255,13 @@ function Details:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, r
self.row_info.textL_translit_text = translittext
end
if (yoffset) then
self.row_info.text_yoffset = yoffset
end
if (leftoffset) then
self.row_info.textL_offset = leftoffset
end
self:InstanceReset()
self:InstanceRefreshRows()
end
@@ -4804,14 +4811,14 @@ function Details:InstanceRefreshRows(instance)
row.lineText4:SetText("")
row.lineText2:SetPoint("right", row.statusbar, "right", -self.fontstrings_text2_anchor, 0)
row.lineText3:SetPoint("right", row.statusbar, "right", -self.fontstrings_text3_anchor, 0)
row.lineText4:SetPoint("right", row.statusbar, "right", -self.fontstrings_text4_anchor, 0)
row.lineText2:SetPoint("right", row.statusbar, "right", -self.fontstrings_text2_anchor, self.row_info.text_yoffset)
row.lineText3:SetPoint("right", row.statusbar, "right", -self.fontstrings_text3_anchor, self.row_info.text_yoffset)
row.lineText4:SetPoint("right", row.statusbar, "right", -self.fontstrings_text4_anchor, self.row_info.text_yoffset)
if (no_icon) then
row.statusbar:SetPoint("topleft", row, "topleft")
row.statusbar:SetPoint("bottomright", row, "bottomright")
row.lineText1:SetPoint("left", row.statusbar, "left", 2, 0)
row.lineText1:SetPoint("left", row.statusbar, "left", self.row_info.textL_offset + 2, self.row_info.text_yoffset)
row.icone_classe:Hide()
row.iconHighlight:Hide()
else
@@ -4826,7 +4833,7 @@ function Details:InstanceRefreshRows(instance)
end
row.statusbar:SetPoint("bottomright", row, "bottomright")
row.lineText1:SetPoint("left", row.icone_classe, "right", 3, 0)
row.lineText1:SetPoint("left", row.icone_classe, "right", self.row_info.textL_offset + 3, self.row_info.text_yoffset)
end
else
row.lineText1:ClearAllPoints()
@@ -4839,14 +4846,14 @@ function Details:InstanceRefreshRows(instance)
row.lineText2:SetJustifyH("left")
row.lineText1:SetJustifyH("right")
row.lineText4:SetPoint("left", row.statusbar, "left", self.fontstrings_text4_anchor + 1, 0)
row.lineText3:SetPoint("left", row.statusbar, "left", self.fontstrings_text3_anchor + 1, 0)
row.lineText2:SetPoint("left", row.statusbar, "left", self.fontstrings_text2_anchor + 1, 0)
row.lineText4:SetPoint("left", row.statusbar, "left", self.fontstrings_text4_anchor + 1, self.row_info.text_yoffset)
row.lineText3:SetPoint("left", row.statusbar, "left", self.fontstrings_text3_anchor + 1, self.row_info.text_yoffset)
row.lineText2:SetPoint("left", row.statusbar, "left", self.fontstrings_text2_anchor + 1, self.row_info.text_yoffset)
if (no_icon) then
row.statusbar:SetPoint("topleft", row, "topleft")
row.statusbar:SetPoint("bottomright", row, "bottomright")
row.lineText1:SetPoint("right", row.statusbar, "right", -2, 0)
row.lineText1:SetPoint("right", row.statusbar, "right", self.row_info.textL_offset - 2, self.row_info.text_yoffset)
row.icone_classe:Hide()
row.iconHighlight:Hide()
--[[ Deprecation of right_to_left_texture in favor of StatusBar:SetReverseFill 5/2/2022 - Flamanis
@@ -4866,7 +4873,7 @@ function Details:InstanceRefreshRows(instance)
row.statusbar:SetPoint("topleft", row, "topleft")
row.lineText1:SetPoint("right", row.icone_classe, "left", -2, 0)
row.lineText1:SetPoint("right", row.icone_classe, "left", self.row_info.textL_offset - 2, self.row_info.text_yoffset)
end
end