Framework update
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
local dversion = 223
|
||||
local dversion = 224
|
||||
|
||||
local major, minor = "DetailsFramework-1.0", dversion
|
||||
local DF, oldminor = LibStub:NewLibrary (major, minor)
|
||||
|
||||
+1
-1
@@ -856,7 +856,7 @@ local SwitchOnClick = function (self, button, forced_value, value)
|
||||
|
||||
local success, errorText = xpcall (slider.OnSwitch, geterrorhandler(), slider, slider.FixedValue, value)
|
||||
if (not success) then
|
||||
error ("Details! Framework: OnSwitch() " .. (button.GetName and button:GetName() or "-NONAME-") .. " error: " .. (errorText or ""))
|
||||
return
|
||||
end
|
||||
|
||||
--> trigger hooks
|
||||
|
||||
+45
-1
@@ -128,6 +128,18 @@ local OnMouseUpFunc = function(statusBar, mouseButton)
|
||||
end
|
||||
|
||||
--timer functions
|
||||
function TimeBarMetaFunctions:SetIconSize(width, height)
|
||||
if (width and not height) then
|
||||
self.statusBar.icon:SetWidth(width)
|
||||
|
||||
elseif (not width and height) then
|
||||
self.statusBar.icon:SetHeight(height)
|
||||
|
||||
elseif (width and height) then
|
||||
self.statusBar.icon:SetSize(width, height)
|
||||
end
|
||||
end
|
||||
|
||||
function TimeBarMetaFunctions:SetIcon(texture, L, R, T, B)
|
||||
if (texture) then
|
||||
self.statusBar.icon:Show()
|
||||
@@ -136,10 +148,10 @@ function TimeBarMetaFunctions:SetIcon(texture, L, R, T, B)
|
||||
self.statusBar.leftText:ClearAllPoints()
|
||||
self.statusBar.leftText:SetPoint("left", self.statusBar.icon, "right", 2, 0)
|
||||
self.statusBar.icon:SetTexture(texture)
|
||||
|
||||
if (L) then
|
||||
self.statusBar.icon:SetTexCoord(L, R, T, B)
|
||||
end
|
||||
|
||||
else
|
||||
self.statusBar.icon:Hide()
|
||||
self.statusBar.leftText:ClearAllPoints()
|
||||
@@ -147,6 +159,14 @@ function TimeBarMetaFunctions:SetIcon(texture, L, R, T, B)
|
||||
end
|
||||
end
|
||||
|
||||
function TimeBarMetaFunctions:GetIcon()
|
||||
return self.statusBar.icon
|
||||
end
|
||||
|
||||
function TimeBarMetaFunctions:SetTexture(texture)
|
||||
self.statusBar.barTexture:SetTexture(texture)
|
||||
end
|
||||
|
||||
function TimeBarMetaFunctions:SetLeftText(text)
|
||||
self.statusBar.leftText:SetText(text)
|
||||
end
|
||||
@@ -154,6 +174,24 @@ function TimeBarMetaFunctions:SetRightText(text)
|
||||
self.statusBar.rightText:SetText(text)
|
||||
end
|
||||
|
||||
function TimeBarMetaFunctions:SetFont(font, size, color, shadow)
|
||||
if (font) then
|
||||
DF:SetFontFace(self.statusBar.leftText, font)
|
||||
end
|
||||
|
||||
if (size) then
|
||||
DF:SetFontSize(self.statusBar.leftText, size)
|
||||
end
|
||||
|
||||
if (color) then
|
||||
DF:SetFontColor(self.statusBar.leftText, color)
|
||||
end
|
||||
|
||||
if (shadow) then
|
||||
DF:SetFontOutline(self.statusBar.leftText, shadow)
|
||||
end
|
||||
end
|
||||
|
||||
function TimeBarMetaFunctions:SetDirection(direction)
|
||||
direction = direction or "right"
|
||||
self.direction = direction
|
||||
@@ -240,8 +278,14 @@ function TimeBarMetaFunctions:SetTimer(currentTime, startTime, endTime)
|
||||
self.statusBar.hasTimer = true
|
||||
self.statusBar.direction = self.direction
|
||||
self.statusBar.throttle = 0
|
||||
self.statusBar:Show()
|
||||
|
||||
self.statusBar:SetScript("OnUpdate", OnUpdateFunc)
|
||||
|
||||
local kill = self:RunHooksForWidget("OnTimerStart", self.statusBar, self)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user