/
## Interface: 40100 |
## Interface: 40200 |
## Title: oUF_Hank_v3 |
## Author: Hank |
## Version: 3.0.10b |
## Version: 3.0.11 |
## Dependencies: oUF |
## OptionalDeps: oUF_SpellRange, oUF_Totembar |
## Notes: oUF layout for |cFFFFA628hank|rui |
self.EclipseBar.counter:SetFontObject("UFFontMedium") |
self.EclipseBar.counter:SetPoint("RIGHT", self.EclipseBar, "LEFT", -5, 0) |
-- Initialize direction (oUF doesn't do that before direction changes) |
if GetEclipseDirection() == "sun" then |
self.EclipseBar.directionIsLunar = true |
self.EclipseBar.direction:SetVertexColor(unpack(cfg.colors.power.ECLIPSE.LUNAR)) |
else |
self.EclipseBar.direction:SetVertexColor(unpack(cfg.colors.power.ECLIPSE.SOLAR)) |
end |
-- Initialize direction on load |
self.EclipseBar.direction:SetVertexColor(unpack(cfg.colors.power.ECLIPSE[GetEclipseDirection() == "sun" and "SOLAR" or "LUNAR"])) |
-- Play direction indicator animation on direction change (100% solar or lunar) |
self.EclipseBar.PostDirectionChange = function() |
self.EclipseBar:SetScript("OnUpdate", function(_ , elapsed) |
AnimateTexCoords(self.EclipseBar.direction, 256, 64, 22, 22, 11, elapsed, 0.025) |
if self.EclipseBar.direction.frame > 6 then |
if self.EclipseBar.directionIsLunar then |
self.EclipseBar.direction:SetVertexColor(unpack(cfg.colors.power.ECLIPSE.LUNAR)) |
else |
self.EclipseBar.direction:SetVertexColor(unpack(cfg.colors.power.ECLIPSE.SOLAR)) |
end |
self.EclipseBar.direction:SetVertexColor(unpack(cfg.colors.power.ECLIPSE[GetEclipseDirection() == "sun" and "SOLAR" or "LUNAR"])) |
end |
if self.EclipseBar.direction.frame == 11 then |
self.EclipseBar:SetScript("OnUpdate", nil) |
-- Solar / lunar power updated |
self.EclipseBar.PostUpdatePower = function() |
-- Currently in solar phase |
if self.EclipseBar.SolarBar:GetValue() > self.EclipseBar.LunarBar:GetValue() then |
if self.EclipseBar.SolarBar:GetValue() < self.EclipseBar.LunarBar:GetValue() then |
-- Solar phase has just been entered => play animation |
if self.EclipseBar.lastPhase == "moon" then |
self.EclipseBar.bg.frame = nil |
end |
-- Fill circle |
self.EclipseBar.fill:SetTexCoord((10 - math.floor(self.EclipseBar.SolarBar:GetValue() / 10)) * 22 / 256, (11 - math.floor(self.EclipseBar.SolarBar:GetValue() / 10)) * 22 / 256, 22 / 64, 44 / 64) |
self.EclipseBar.fill:SetTexCoord((10 + math.floor(self.EclipseBar.SolarBar:GetValue() / 10)) * 22 / 256, (11 + math.floor(self.EclipseBar.SolarBar:GetValue() / 10)) * 22 / 256, 22 / 64, 44 / 64) |
-- Update cast counter |
if self.EclipseBar.directionIsLunar then |
if GetEclipseDirection() == "sun" then |
self.EclipseBar.counter:SetText(math.ceil((100 + self.EclipseBar.SolarBar:GetValue()) / 20) .. " Starfires") |
else |
self.EclipseBar.counter:SetText(math.ceil((100 - self.EclipseBar.SolarBar:GetValue()) / 13) .. " Wraths") |
end |
-- Fill circle |
self.EclipseBar.fill:SetTexCoord((11 - math.floor(self.EclipseBar.LunarBar:GetValue() / 10)) * 22 / 256, (10 - math.floor(self.EclipseBar.LunarBar:GetValue() / 10)) * 22 / 256, 22 / 64, 44 / 64) |
self.EclipseBar.fill:SetTexCoord((11 + math.floor(self.EclipseBar.LunarBar:GetValue() / 10)) * 22 / 256, (10 + math.floor(self.EclipseBar.LunarBar:GetValue() / 10)) * 22 / 256, 22 / 64, 44 / 64) |
-- Update cast counter |
if self.EclipseBar.directionIsLunar then |
if GetEclipseDirection() == "sun" then |
self.EclipseBar.counter:SetText(math.ceil((100 - self.EclipseBar.LunarBar:GetValue()) / 20) .. " Starfires") |
else |
self.EclipseBar.counter:SetText(math.ceil((100 + self.EclipseBar.LunarBar:GetValue()) / 13) .. " Wraths") |