Skip to content

Commit

Permalink
More fixes and development
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Jan 16, 2021
1 parent 09601d7 commit d93fa52
Show file tree
Hide file tree
Showing 15 changed files with 440 additions and 142 deletions.
4 changes: 3 additions & 1 deletion Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 228
local dversion = 229

local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
Expand Down Expand Up @@ -4238,3 +4238,5 @@ end
_G.setfenv(func, newEnvironment)
end


-----------------------------------------------------------------------------------------------------------------------------------------------------------
2 changes: 0 additions & 2 deletions Libs/DF/spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -974,8 +974,6 @@ DF.PotionIDs = {
-- [] = true, --

[307165] = true, --Spiritual Anti-Venom


}

DF.FeastIDs = {
Expand Down
27 changes: 19 additions & 8 deletions Libs/DF/timebar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -197,23 +197,27 @@ function TimeBarMetaFunctions:SetDirection(direction)
self.direction = direction
end

function TimeBarMetaFunctions:HasTimer()
return self.statusBar.hasTimer
end

function TimeBarMetaFunctions:StopTimer()
if (self.statusBar.hasTimer) then
self.statusBar.hasTimer = nil
local kill = self:RunHooksForWidget("OnTimerEnd", self.statusBar, self)
if (kill) then
return
end
end

local statusBar = self.statusBar
statusBar:SetScript("OnUpdate", nil)
local statusBar = self.statusBar
statusBar:SetScript("OnUpdate", nil)

statusBar:SetMinMaxValues(0, 100)
statusBar:SetValue(100)
statusBar.rightText:SetText("")
statusBar:SetMinMaxValues(0, 100)
statusBar:SetValue(100)
statusBar.rightText:SetText("")

statusBar.spark:Hide()
statusBar.hasTimer = nil
end
statusBar.spark:Hide()
end

local OnUpdateFunc = function(self, deltaTime)
Expand Down Expand Up @@ -249,6 +253,12 @@ local OnUpdateFunc = function(self, deltaTime)
end

function TimeBarMetaFunctions:SetTimer(currentTime, startTime, endTime)

if (not currentTime or currentTime == 0) then
self:StopTimer()
return
end

if (startTime and endTime) then
if (self.statusBar.hasTimer and currentTime == self.statusBar.timeLeft1) then
--it is the same timer called again
Expand All @@ -266,6 +276,7 @@ function TimeBarMetaFunctions:SetTimer(currentTime, startTime, endTime)
self.statusBar.timeLeft2 = currentTime
end

--print("min|max values:", self.statusBar.starTime, self.statusBar.endTime)
self.statusBar:SetMinMaxValues(self.statusBar.starTime, self.statusBar.endTime)

if (self.direction == "right") then
Expand Down
Loading

0 comments on commit d93fa52

Please sign in to comment.