Thread Tools Display Modes
09-04-12, 04:07 PM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
EclipseBar example?

Has anyone a working eclipsebar example that he can share?

I decided to add an eclipsebar for my layout and am looking for examples.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
09-04-12, 04:55 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
oUF_Phanx has a (probably) working eclipse bar. I haven't actually tested it in 5.0, but it doesn't give any errors, and nobody has complained, so I assume it's still working.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
09-05-12, 01:43 AM   #3
eiszeit
A Chromatic Dragonspawn
 
eiszeit's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 154
Originally Posted by Phanx View Post
oUF_Phanx has a (probably) working eclipse bar. I haven't actually tested it in 5.0, but it doesn't give any errors, and nobody has complained, so I assume it's still working.
Yes, it works without problems.
__________________
Lyn • I'm a mess of unfinished thoughts
  Reply With Quote
09-07-12, 03:39 AM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
I moved all the documentation back to the code some time ago. There's still a lot missing, but it's much better than before. It's also possible to generate HTML pages from them and I plan on having a branch for them on GitHub, but probably not until 1.6 actually is pushed.

The EclipseBar is a decent example of how it looks.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-21-12, 06:28 AM   #5
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Mine works just fine, or at least i've had no complain from my wife playing as a balance with my layout
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
  Reply With Quote
09-22-12, 09:41 PM   #6
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
The thing with oUF's eclipse bar is that it does not behave like the stock one. That is maybe irritating for users that are accustomed to the standard ui.
  Reply With Quote
09-23-12, 09:18 AM   #7
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Maybe someone is interested. I finished mine.

Result:
http://imgur.com/a/oDaxo

I changed the behaviour a bit. On first load the bar is gray and you fill it up once. After that the bar will glow and from that on you deplete it. Once depleted the bar switched from lunar<->solar and start at full again.

Code
Lua Code:
  1. --create eclipse power bar
  2.   bars.createEclipseBar = function(self)
  3.  
  4.     local bar = CreateFrame("Frame","oUF_DiabloEclipsePower",self)
  5.     bar:SetPoint(self.cfg.eclipse.pos.a1,self.cfg.eclipse.pos.af,self.cfg.eclipse.pos.a2,self.cfg.eclipse.pos.x,self.cfg.eclipse.pos.y)
  6.     bar:SetSize(256,32)
  7.     bar:SetScale(self.cfg.eclipse.scale)
  8.  
  9.     local statusbarHelper = CreateFrame("Frame",nil,bar)
  10.     statusbarHelper:SetPoint("TOPLEFT",17,-5)
  11.     statusbarHelper:SetPoint("BOTTOMRIGHT",-17,5)
  12.  
  13.     local bg = statusbarHelper:CreateTexture(nil,"BACKGROUND",nil,-8)
  14.     bg:SetAllPoints(statusbarHelper)
  15.     bg:SetTexture("Interface\\AddOns\\oUF_Diablo\\media\\demonic_fury_statusbar")
  16.     bg:SetVertexColor(self.cfg.eclipse.color.bg.r,self.cfg.eclipse.color.bg.g,self.cfg.eclipse.color.bg.b)
  17.  
  18.     --lunar bar
  19.     local lunar = CreateFrame("StatusBar",nil,statusbarHelper)
  20.     lunar:SetAllPoints(statusbarHelper)
  21.     local fill = lunar:CreateTexture(nil,"BACKGROUND",nil,-6)
  22.     fill:SetTexture("Interface\\AddOns\\oUF_Diablo\\media\\demonic_fury_statusbar")
  23.     lunar:SetStatusBarTexture(fill)
  24.     lunar:SetStatusBarColor(self.cfg.eclipse.color.lunar.r,self.cfg.eclipse.color.lunar.g,self.cfg.eclipse.color.lunar.b)
  25.  
  26.     --solar bar
  27.     local solar = CreateFrame("StatusBar",nil,statusbarHelper)
  28.     solar:SetAllPoints(statusbarHelper)
  29.     local fill = solar:CreateTexture(nil,"BACKGROUND",nil,-6)
  30.     fill:SetTexture("Interface\\AddOns\\oUF_Diablo\\media\\demonic_fury_statusbar")
  31.     solar:SetStatusBarTexture(fill)
  32.     solar:SetStatusBarColor(self.cfg.eclipse.color.solar.r,self.cfg.eclipse.color.solar.g,self.cfg.eclipse.color.solar.b)
  33.  
  34.     --border
  35.     local border = CreateFrame("Frame",nil,statusbarHelper)
  36.     border:SetFrameLevel(max(solar:GetFrameLevel()+1,lunar:GetFrameLevel()+1))
  37.     border:SetAllPoints(bar)
  38.     local t = border:CreateTexture(nil,"BACKGROUND",nil,-4)
  39.     t:SetAllPoints(bar)
  40.     t:SetTexture("Interface\\AddOns\\oUF_Diablo\\media\\demonic_fury_border")
  41.     bar.border = t
  42.  
  43.     --tick
  44.     local t = border:CreateTexture(nil,"BACKGROUND",nil,-5)
  45.     t:SetPoint("TOP",0,6)
  46.     t:SetSize(48,48)
  47.     t:SetAlpha(0.6)
  48.     t:SetTexture("Interface\\MainMenuBar\\UI-ExhaustionTickNormal")
  49.     bar.tickTexture = t
  50.  
  51.     --glow
  52.     local t = border:CreateTexture(nil,"BACKGROUND",nil,-2)
  53.     t:SetSize(512,64)
  54.     t:SetPoint("CENTER")
  55.     t:SetTexture("Interface\\AddOns\\oUF_Diablo\\media\\demonic_fury_glow")
  56.     t:SetVertexColor(0,0.5,1)
  57.     t:SetBlendMode("BLEND")
  58.     bar.glow = t
  59.     bar.glow:Hide()
  60.  
  61.     bar.PostUnitAura = function()
  62.       if bar.hasSolarEclipse then
  63.         bar.glow:SetVertexColor(self.cfg.eclipse.color.solar.r,self.cfg.eclipse.color.solar.g,self.cfg.eclipse.color.solar.b)
  64.         bar.glow:Show()
  65.         return
  66.       end
  67.       if bar.hasLunarEclipse then
  68.         bar.glow:SetVertexColor(self.cfg.eclipse.color.lunar.r,self.cfg.eclipse.color.lunar.g,self.cfg.eclipse.color.lunar.b)
  69.         bar.glow:Show()
  70.         return
  71.       end
  72.       bar.glow:Hide()
  73.     end
  74.  
  75.     bar.PostDirectionChange = function()
  76.       if GetEclipseDirection() == "sun" then
  77.         bar.LunarBar:SetStatusBarColor(self.cfg.eclipse.color.lunar.r,self.cfg.eclipse.color.lunar.g,self.cfg.eclipse.color.lunar.b)
  78.         bar.LunarBar:Show()
  79.         bar.SolarBar:Hide()
  80.       elseif GetEclipseDirection() == "moon" then
  81.         bar.LunarBar:Hide()
  82.         bar.SolarBar:SetStatusBarColor(self.cfg.eclipse.color.solar.r,self.cfg.eclipse.color.solar.g,self.cfg.eclipse.color.solar.b)
  83.         bar.SolarBar:Show()
  84.       else
  85.         bar.LunarBar:SetStatusBarColor(0.8,0.8,0.8)
  86.         bar.SolarBar:SetStatusBarColor(0.8,0.8,0.8)
  87.         bar.LunarBar:Show()
  88.         bar.SolarBar:Show()
  89.       end
  90.     end
  91.  
  92.     bar.PostUpdatePower = function()
  93.       local lmin, lmax = bar.LunarBar:GetMinMaxValues()
  94.       local lval = bar.LunarBar:GetValue()
  95.       local smin, smax = bar.SolarBar:GetMinMaxValues()
  96.       local sval = bar.SolarBar:GetValue()
  97.       bar.SolarBar:SetValue(bar.SolarBar:GetValue()*(-1))
  98.       bar.LunarBar:SetValue(bar.LunarBar:GetValue()*(-1))
  99.     end
  100.  
  101.     bar.PostUpdateVisibility = bar.PostDirectionChange
  102.  
  103.     func.applyDragFunctionality(bar)
  104.     --combat fading
  105.     if self.cfg.eclipse.combat.enable then
  106.       rCombatFrameFader(bar, self.cfg.eclipse.combat.fadeIn, self.cfg.eclipse.combat.fadeOut) --frame, buttonList, fadeIn, fadeOut
  107.     end
  108.  
  109.     bar.SolarBar = solar
  110.     bar.LunarBar = lunar
  111.     self.EclipseBar = bar
  112.  
  113.   end
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 09-23-12 at 09:21 AM.
  Reply With Quote
09-25-12, 08:29 PM   #8
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
Caellian?

You have a wife?

(Because I love derailing threads)

No seriously, I still have my old eclipsebar from 6 months or more ago, seemed to work fine still.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » EclipseBar example?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off