Skip to content

Commit

Permalink
Merge pull request #7 from mitjafelicijan/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
mitjafelicijan authored May 12, 2023
2 parents dd80a69 + 01be51d commit 2e33faf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
3 changes: 0 additions & 3 deletions TurtleTweaks.toc
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ camera-distance.lua
nameplates.lua
worldmap-window.lua

# Work in progress
# open-all-mail.lua

# Sandbox stuff
sandbox.lua

Expand Down
19 changes: 9 additions & 10 deletions rested-bar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ frame:SetScript("OnEvent", function()
currentRestValue = frame.getRestedPercentage()

statusBar = CreateFrame("StatusBar", nil, PlayerFrame, "TextStatusBar")
statusBar:ClearAllPoints()
statusBar:SetWidth(100)
statusBar:SetHeight(12)
statusBar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar")
statusBar:SetStatusBarColor(0, 255, 255)
statusBar:SetMinMaxValues(0, 100)

statusBar.bg = statusBar:CreateTexture(nil, "BACKGROUND")
statusBar.bg:SetAllPoints(statusBar)
Expand All @@ -60,13 +62,6 @@ frame:SetScript("OnEvent", function()
statusBar.text:SetPoint("CENTER", 0, 0)
statusBar.text:SetFont(STANDARD_TEXT_FONT, 8, "OUTLINE")

statusBar.tick = statusBar:CreateFontString(nil, "OVERLAY")
statusBar.tick:SetPoint("LEFT", 110, 0)
statusBar.tick:SetFont(STANDARD_TEXT_FONT, 12, "OUTLINE")
statusBar.tick:SetTextColor(205, 0, 205, 1)

statusBar:ClearAllPoints()

if RestedBar.config.position == "top" then
statusBar:SetPoint("TOPLEFT", 114, -10)
statusBar.bd:SetPoint("TOPLEFT", -10, 4)
Expand All @@ -90,9 +85,13 @@ end)
-- Updates the UI rested bar.
frame:SetScript("OnUpdate", function()
if RestedBar and RestedBar.enabled then
if lastRestValue ~= currentRestValue then
lastRestValue = currentRestValue
statusBar.text:SetText(lastRestValue .. "%")
statusBar.text:SetText(currentRestValue .. "%")
statusBar:SetValue(currentRestValue)

if currentRestValue < 33 then
statusBar:SetStatusBarColor(255, 255, 255)
else
statusBar:SetStatusBarColor(0, 255, 255)
end
end
end)
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 2e33faf

Please sign in to comment.