- Most modules now support a new bar filling mode: Expanding outwards from the middle.

This commit is contained in:
rokiyo
2010-10-30 15:08:05 +00:00
parent 7abe2276fb
commit 52a0e26759
6 changed files with 694 additions and 649 deletions

View File

@ -54,18 +54,35 @@ function IceBarElement.prototype:Enable()
self.moduleSettings.myTagVersion = IceHUD.CurrTagVersion self.moduleSettings.myTagVersion = IceHUD.CurrTagVersion
end end
-- fixup for the new 'invert' option -- fixup for the old new 'invert' option. (This was here before I got here - Andre)
if not self.moduleSettings.updatedReverseInverse then if not self.moduleSettings.updatedReverseInverse then
self.moduleSettings.updatedReverseInverse = true self.moduleSettings.updatedReverseInverse = true
if self.moduleSettings.reverse then if self.moduleSettings.reverse then
self.moduleSettings.reverse = false self.moduleSettings.reverse = false
self.moduleSettings.inverse = true self.moduleSettings.inverse = "NORMAL"
self:SetBarFramePoints(self.barFrame) self:SetBarFramePoints(self.barFrame)
end end
end end
-- fixup for the new new 'invert' option
-- This is the new fixup code... Not sure if I'm doin' it right, or if the old and the new fixups can be merged.
-- The way I figure it, someone who hasn't updated in like forever might not have had either fixup occur, and yet
-- people who have been updating frequently will have already had the old fixup occur... DUN DUN DUN.
-- Also... Setting the module default for moduleSettings.inverse seemed to automatically set all my characters
-- to that default... So I'm not I can test whether or not my fixup does what I think it does. o.O
if not self.moduleSettings.updatedInverseExpand then
self.moduleSettings.updatedInverseExpand = true
if self.moduleSettings.inverse == true then
self.moduleSettings.inverse = "INVERSE"
else
self.moduleSettings.inverse = "NORMAL"
end
self:SetBarFramePoints(self.barFrame)
end
self:RegisterFontStrings() self:RegisterFontStrings()
-- allows frames that show/hide via RegisterUnitWatch to not show text when they shouldn't -- allows frames that show/hide via RegisterUnitWatch to not show text when they shouldn't
@ -124,7 +141,7 @@ function IceBarElement.prototype:GetDefaultSettings()
settings["side"] = IceCore.Side.Left settings["side"] = IceCore.Side.Left
settings["offset"] = 1 settings["offset"] = 1
settings["scale"] = 1 settings["scale"] = 1
settings["inverse"] = false settings["inverse"] = "NORMAL"
settings["reverse"] = false settings["reverse"] = false
settings["barFontSize"] = 12 settings["barFontSize"] = 12
settings["lockUpperTextAlpha"] = true settings["lockUpperTextAlpha"] = true
@ -146,10 +163,23 @@ function IceBarElement.prototype:GetDefaultSettings()
settings["shouldUseOverride"] = false settings["shouldUseOverride"] = false
settings["rotateBar"] = false settings["rotateBar"] = false
settings["markers"] = {} settings["markers"] = {}
settings["bAllowExpand"] = true
return settings return settings
end end
do
local function getFillOptions(self)
local values = {
["NORMAL"] = "Normal",
["INVERSE"] = "Inverse",
}
if self.moduleSettings.bAllowExpand then
values["EXPAND"] = "Expanding"
end
return values
end
-- OVERRIDE -- OVERRIDE
function IceBarElement.prototype:GetOptions() function IceBarElement.prototype:GetOptions()
@ -232,9 +262,10 @@ function IceBarElement.prototype:GetOptions()
opts["inverse"] = opts["inverse"] =
{ {
type = 'toggle', type = 'select',
name = L["Invert bar"], name = L["Invert bar"],
desc = L["Controls which direction the bar fills up. With this checked, the bar will fill opposite from normal (e.g. for health: 0% at the top, 100% at the bottom)."], desc = L["Controls what it means for the bar to be filled. A normal bar will grow larger as the value grows from 0% to 100%. A reversed bar will shrink as the value grows from 0% to 100%."],
values = getFillOptions(self),
get = function() get = function()
return self.moduleSettings.inverse return self.moduleSettings.inverse
end, end,
@ -817,6 +848,7 @@ if not self.moduleSettings.bHideMarkerSettings then
end end
return opts return opts
end end
end
function IceBarElement.prototype:SetBarVisibility(visible) function IceBarElement.prototype:SetBarVisibility(visible)
if visible then if visible then
@ -828,8 +860,10 @@ end
function IceBarElement.prototype:SetBarFramePoints(frame) function IceBarElement.prototype:SetBarFramePoints(frame)
frame:ClearAllPoints() frame:ClearAllPoints()
if (self.moduleSettings.inverse) then if self.moduleSettings.inverse == "INVERSE" then
frame:SetPoint("TOPLEFT", self.frame, "TOPLEFT") frame:SetPoint("TOPLEFT", self.frame, "TOPLEFT")
elseif self.moduleSettings.inverse == "EXPAND" then
frame:SetPoint("LEFT", self.frame, "LEFT")
else else
frame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT") frame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT")
end end
@ -1071,12 +1105,15 @@ function IceBarElement.prototype:SetScale(inScale, force)
if force or oldScale ~= self.CurrScale then if force or oldScale ~= self.CurrScale then
local scale = self.CurrScale local scale = self.CurrScale
if (self.moduleSettings.reverse) then if self.moduleSettings.reverse then
scale = 1 - scale scale = 1 - scale
end end
if (self.moduleSettings.inverse) then if self.moduleSettings.inverse == "INVERSE" then
min_y = 0; min_y = 0;
max_y = scale; max_y = scale;
elseif self.moduleSettings.inverse == "EXPAND" then
min_y = 0.5 - (scale * 0.5);
max_y = 0.5 + (scale * 0.5);
else else
min_y = 1-scale; min_y = 1-scale;
max_y = 1; max_y = 1;
@ -1349,8 +1386,10 @@ function IceBarElement.prototype:RotateFrame(frame)
end end
local anchorPoint local anchorPoint
if self.moduleSettings.inverse then if self.moduleSettings.inverse == "INVERSE" then
anchorPoint = "TOPLEFT" anchorPoint = "TOPLEFT"
elseif self.moduleSettings.inverse == "EXPAND" then
anchorPoint = "LEFT"
else else
anchorPoint = "BOTTOMLEFT" anchorPoint = "BOTTOMLEFT"
end end

View File

@ -35,6 +35,7 @@ function CastBar.prototype:GetDefaultSettings()
settings["usesDogTagStrings"] = false settings["usesDogTagStrings"] = false
settings["rangeColor"] = true settings["rangeColor"] = true
settings["shouldHideBarRotation"] = true settings["shouldHideBarRotation"] = true
settings["bAllowExpand"] = false
return settings return settings
end end

View File

@ -46,6 +46,7 @@ function EclipseBar.prototype:GetDefaultSettings()
height = 6, height = 6,
} }
defaults.shouldHideBarRotation = true defaults.shouldHideBarRotation = true
defaults.bAllowExpand = false
return defaults return defaults
end end

View File

@ -56,6 +56,8 @@ function PlayerHealth.prototype:GetDefaultSettings()
settings["PartyRoleIconOffset"] = {x=90, y=-59} settings["PartyRoleIconOffset"] = {x=90, y=-59}
settings["PartyRoleIconScale"] = 0.9 settings["PartyRoleIconScale"] = 0.9
settings["bAllowExpand"] = false
return settings return settings
end end

View File

@ -83,6 +83,7 @@ function SliceAndDice.prototype:GetDefaultSettings()
settings["lowerTextString"] = "" settings["lowerTextString"] = ""
settings["lowerTextVisible"] = false settings["lowerTextVisible"] = false
settings["hideAnimationSettings"] = true settings["hideAnimationSettings"] = true
settings["bAllowExpand"] = false
return settings return settings
end end

View File

@ -48,6 +48,7 @@ function IceThreat.prototype:GetDefaultSettings()
settings["showScaledThreat"] = false settings["showScaledThreat"] = false
settings["displaySecondPlaceThreat"] = true settings["displaySecondPlaceThreat"] = true
settings["secondPlaceThreatAlpha"] = 0.75 settings["secondPlaceThreatAlpha"] = 0.75
settings["bAllowExpand"] = false
return settings return settings
end end