Add heading background color option. Fix vertical grip resizing when Omen's scale is not 1.0. Fix deDE localization file to be UTF8.

This commit is contained in:
Xinhuan
2008-10-14 17:10:21 +08:00
parent b7888cdaca
commit 7142aea5c6
3 changed files with 90 additions and 65 deletions
+27 -4
View File
@@ -116,6 +116,7 @@ local defaults = {
ShowTPS = true,
TPSWindow = 10,
ShowHeadings = true,
HeadingBGColor = {r = 0, g = 0, b = 0, a = 0,},
},
ShowWith = {
Pet = true,
@@ -275,7 +276,7 @@ local function sizing(self)
Omen:UpdateBars()
end
local function movegrip1(self)
local x = GetCursorPosition() / UIParent:GetEffectiveScale()
local x = GetCursorPosition() / UIParent:GetEffectiveScale() / Omen.Anchor:GetScale()
local x1 = Omen.Anchor:GetLeft() + 10
local x2 = db.Bar.ShowTPS and Omen.Anchor:GetLeft() + db.VGrip2 - 10 or Omen.Anchor:GetRight() - 10
if x > x1 and x < x2 then
@@ -287,7 +288,7 @@ local function movegrip1(self)
Omen:ReAnchorLabels()
end
local function movegrip2(self)
local x = GetCursorPosition() / UIParent:GetEffectiveScale()
local x = GetCursorPosition() / UIParent:GetEffectiveScale() / Omen.Anchor:GetScale()
local x1 = Omen.Anchor:GetLeft() + db.VGrip1 + 10
local x2 = Omen.Anchor:GetRight() - 10
if x > x1 and x < x2 then
@@ -526,6 +527,8 @@ function Omen:SetAnchors(useDB)
-- Set the scale, since the scaling affects the position
self.Anchor:SetScale(db.Scale)
self.VGrip1:SetWidth(1 / self.VGrip1:GetEffectiveScale())
self.VGrip2:SetWidth(1 / self.VGrip2:GetEffectiveScale())
-- Get position
if useDB then
@@ -868,7 +871,8 @@ do
bar.Text1:SetText(L["Name"])
bar.Text2:SetText(L["Threat [%]"])
bar.Text3:SetText(L["TPS"])
bar.texture:SetVertexColor(0, 0, 0, 0)
color = db.Bar.HeadingBGColor
bar.texture:SetVertexColor(color.r, color.g, color.b, color.a)
elseif barID == 1 then
-- Parent our TPS update frame to the first bar, so that TPS updates
-- updates happen when at least 1 bar (the first bar) is shown.
@@ -920,6 +924,8 @@ function Omen:UpdateBarLabelSettings()
bars[i].Text2:SetHeight(size)
bars[i].Text3:SetHeight(size)
end
color = db.Bar.HeadingBGColor
bars[0].texture:SetVertexColor(color.r, color.g, color.b, color.a)
end
function Omen:ReAnchorLabels()
@@ -1853,7 +1859,7 @@ local options = {
},
ShowHeadings = {
type = "toggle",
order = 6,
order = 8,
name = L["Show Headings"],
desc = L["Show column headings"],
set = function(info, value)
@@ -1862,6 +1868,23 @@ local options = {
Omen:UpdateBars()
end,
},
HeadingBGColor = {
type = "color",
order = 9,
name = L["Heading BG Color"],
desc = L["Heading background color"],
hasAlpha = true,
get = function(info)
local t = db.Bar.HeadingBGColor
return t.r, t.g, t.b, t.a
end,
set = function(info, r, g, b, a)
local t = db.Bar.HeadingBGColor
t.r, t.g, t.b, t.a = r, g, b, a
Omen:UpdateBarLabelSettings()
end,
disabled = function() return not db.Bar.ShowHeadings end,
},
Texture = {
type = "select", dialogControl = 'LSM30_Statusbar',
order = 10,