Thread Tools Display Modes
09-14-10, 01:51 PM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Texturized Combobar

For the new oUF_D3Orbs in Cataclysm I created a new combobar. I made some textures to make it look shiny and I love the outcome.

Textures:
http://code.google.com/p/rothui/source/detail?r=532
http://code.google.com/p/rothui/source/detail?r=533



Using the newly introduced textureSubLevel aswell. Read http://forums.worldofwarcraft.com/th...99864&sid=2000 (Same drawlayer but different sublevels = AWESOME!)

Textures used: 2 edge textures (left and right)
For each segment: background, filling, glow and gloss.

Number of segments and color can be adjusted.

CODE
Code:
--FUNCTIONS
  --update combo
  local function updateCombo(self, event, unit)
    if unit == "pet" then return end
    local bar = self.ComboBar
  
    local cp
    if(UnitExists'vehicle') then
      cp = GetComboPoints('vehicle', 'target')
    else
      cp = GetComboPoints('player', 'target')
    end
  
    local cpoints = self.CPoints
    for i=1, MAX_COMBO_POINTS do
      local adjust = cp/MAX_COMBO_POINTS
      bar.filling[i]:SetVertexColor(combocolor.r*adjust,combocolor.g*adjust,combocolor.b*adjust,1)
       bar.glow[i]:SetVertexColor(combocolor.r*adjust,combocolor.g*adjust,combocolor.b*adjust,0.4)
            
      if(i <= cp) then
        cpoints[i]:Show()
        bar.glow[i]:Show()
      else
        cpoints[i]:Hide()
        bar.glow[i]:Hide()
      end
    end
    
  end

  --create combo
  local function d3o2_createComboPoints(self,unit)
    
    self.CPoints = {}
    
    local t
    local bar = CreateFrame("Frame","oUF_D3Orbs_ComboBar",self)
    local w = 64*(MAX_COMBO_POINTS+2)
    local h = 64
    bar:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
    bar:SetWidth(w)
    bar:SetHeight(h)
    
    t = bar:CreateTexture(nil,"BACKGROUND",nil,-8)
    t:SetSize(64,64)
    t:SetPoint("LEFT",0,0)
    t:SetTexture("Interface\\AddOns\\rTextures\\combo_left")
    bar.leftedge = t

    t = bar:CreateTexture(nil,"BACKGROUND",nil,-8)
    t:SetSize(64,64)
    t:SetPoint("RIGHT",0,0)
    t:SetTexture("Interface\\AddOns\\rTextures\\combo_right")
    bar.rightedge = t

    bar.back = {}
    bar.filling = {}
    bar.glow = {}
    bar.gloss = {}
    
    for i = 1, MAX_COMBO_POINTS do
      local back = "back"..i
      bar.back[i] = bar:CreateTexture(nil,"BACKGROUND",nil,-8)  
      bar.back[i]:SetSize(64,64)
      bar.back[i]:SetPoint("LEFT",i*64,0)
      bar.back[i]:SetTexture("Interface\\AddOns\\rTextures\\combo_back")

      bar.filling[i] = bar:CreateTexture(nil,"BACKGROUND",nil,-7)  
      bar.filling[i]:SetSize(64,64)
      bar.filling[i]:SetPoint("LEFT",i*64,0)
      bar.filling[i]:SetTexture("Interface\\AddOns\\rTextures\\combo_fill")
      --bar.filling[i]:SetVertexColor(combocolor.r,combocolor.g,combocolor.b,1)
      bar.filling[i]:SetBlendMode("ADD")

      bar.glow[i] = bar:CreateTexture(nil,"BACKGROUND",nil,-6)  
      bar.glow[i]:SetSize(64*1.25,64*1.25)
      bar.glow[i]:SetPoint("CENTER", bar.filling[i], "CENTER", 0, 0)
      bar.glow[i]:SetTexture("Interface\\AddOns\\rTextures\\combo_glow")
      bar.glow[i]:SetBlendMode("BLEND")
      --bar.glow[i]:SetVertexColor(combocolor.r,combocolor.g,combocolor.b,0.4)
      bar.glow[i]:Hide()

      bar.gloss[i] = bar:CreateTexture(nil,"BACKGROUND",nil,-5)  
      bar.gloss[i]:SetSize(64,64)
      bar.gloss[i]:SetPoint("LEFT",i*64,0)
      bar.gloss[i]:SetTexture("Interface\\AddOns\\rTextures\\combo_highlight")
      bar.gloss[i]:SetBlendMode("ADD")

      self.CPoints[i] = bar.filling[i]
    end

    bar:SetScale(combobarscale)
    self.ComboBar = bar

    self.CPoints.Override = updateCombo
  end

  --move stuff without restriction of locking
  local function moveme_no_restrict(f)
    f:SetMovable(true)
    f:SetUserPlaced(true)
    f:EnableMouse(true)
    f:RegisterForDrag("LeftButton","RightButton")
    f:SetScript("OnDragStart", function(self) if IsAltKeyDown() and IsShiftKeyDown() then self:StartMoving() end end)
    f:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)
  end

--CALL INSIDE TARGET FRAME STYLE FUNC
    d3o2_createComboPoints(self,unit)        
    moveme_no_restrict(self.ComboBar)
QUESTION:
I want to do this for HolyPower and SoulBurn (or how it is called) aswell. I think haste added some stuff already.

Anyone tried this yet, code available?
__________________
| 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 : 10-12-10 at 03:40 AM.
  Reply With Quote
09-14-10, 02:13 PM   #2
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
When I wrote the souldshards and holypower elements I based them on the current combopoints/runebar implementation.

Hopefully you should be able to use very similar code to create the same effect for holy power and soul shards.


------
addition of holypower to my own layout : clicky

addition of soul shards to my own layout : clicky

Last edited by yj589794 : 09-14-10 at 02:26 PM. Reason: added links to my layout
  Reply With Quote
09-14-10, 03:35 PM   #3
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Awesome ty. Hmm using this for runes...why not. Other than that I want to use it for exp/rep display aswell. p3lim has some stuff that can be used to do that imo.
__________________
| 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-14-10 at 03:39 PM.
  Reply With Quote
09-27-10, 10:10 AM   #4
Tobbe8716
An Aku'mai Servant
 
Tobbe8716's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 36
I must say thats anawesome combo bar
__________________
Arp UI oUF_Arp
  Reply With Quote
09-28-10, 12:37 AM   #5
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Hey zork, awesome work! I see that working really well for the new Lunar/Solar Eclipse Bar for Cataclysm (depending on how it's going be approach in oUF since it seems a bit tricky to implement).

Regarding this bar as a Combo Point Resource, i would suggest to color it by compo point increase. That is imagine 1 cp = light green, scaling to yellow, orange, red = 5. It's easier to get colors in a glimpse then counting squares. That is why I always use my Combo Points as numbers, colored number.

Other than that, it looks gorgeous.
__________________
My oUF Layout: oUF Lumen
  Reply With Quote
09-28-10, 03:48 AM   #6
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
It would be difficult to implement something like this for the eclipsebar.

Combo points, holy power, soul shards and DK runes all deal with a fairly small number of items.
The eclipsebar has to cope with values from -100 to +100, so it would not be easy to copy the styling.
  Reply With Quote
09-28-10, 07:34 AM   #7
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
We will see. No clue yet.
__________________
| 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-28-10, 08:20 AM   #8
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Originally Posted by neverg View Post
Hey zork, awesome work! I see that working really well for the new Lunar/Solar Eclipse Bar for Cataclysm (depending on how it's going be approach in oUF since it seems a bit tricky to implement).

Regarding this bar as a Combo Point Resource, i would suggest to color it by compo point increase. That is imagine 1 cp = light green, scaling to yellow, orange, red = 5. It's easier to get colors in a glimpse then counting squares. That is why I always use my Combo Points as numbers, colored number.

Other than that, it looks gorgeous.

This however depends entirely on how someone processes information. I for one prefer looking at textures/bars to gather information first, ignoring numbers until I need to know a very specific value, which is rarely the case. Colours are good to highlight things, though. No matter if it's text or texture.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
09-28-10, 11:08 AM   #9
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Images are _always_ processed faster from our brains than text. There is no way around that, that's how our brains work. Picture information is traced faster, thus can be responded to quicker. Of course the picture information should be clear and undoubtful.
__________________
| 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-28-10, 12:19 PM   #10
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Might be, but I here's my experience: if you have a bar and a number telling you how much health a unit has, I know quite some people that look at the number, even ignoring the bar and forgetting about their health if the number is to small and therefore not gathering any information from that unit at all. That is quite a contradiction to what you say our brain is working. Maybe yours is (and mine, too.). People are different, like there would be no oUF_Hank, otherwise.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
09-29-10, 06:34 AM   #11
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Images might be processed faster than numbers, can agree with that. But really depends on the numbers and the pictures we are talking about.

For instance, the implementation of Blizzard Combo Points it's awful. It's way to small when you try to take a quick glance at it, you literally need to count the dots. It's way faster to have a big colored number on the screen. At least in my opinion. Played a Rogue as main for 4 years, a lot of PvP and Colored Numbers were always my fav.
__________________
My oUF Layout: oUF Lumen
  Reply With Quote
09-29-10, 07:04 AM   #12
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
We can ask you if it's the colors that took your attention or if it was the combined colors and numbers that did the trick ^^

oUF is just wonderful cause it lets us do nearly whatever we want with a little bit of implication in it.
At least, what zork did was to point out the new possibilities we have with this new texture thing.
  Reply With Quote
09-29-10, 08:12 AM   #13
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Originally Posted by Rostok View Post
We can ask you if it's the colors that took your attention or if it was the combined colors and numbers that did the trick ^^

oUF is just wonderful cause it lets us do nearly whatever we want with a little bit of implication in it.
At least, what zork did was to point out the new possibilities we have with this new texture thing.
Most probably more the color than the number. But a big number is a "familar" shape, its quick to grasp information about it. But I'm talking 1 Number, more than 1 number probably isn't the same. A HP Number isn't something we "grab" faster than say a texture.

Regarding zork texture, I love it to be honest. In fact I love zork oUF Layout and UI, the only reason I don't use it it's because it doesn't fit my taste using those big orbs, tho they look amazing. I myself use rMinimap and some graphics from his UI on my UI.

The texture looks awesome for combo points, I just wanted to add that if more color feedback were available for combo points it would even be better.
__________________
My oUF Layout: oUF Lumen
  Reply With Quote
09-29-10, 12:52 PM   #14
d87
A Chromatic Dragonspawn
 
d87's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 163
The only thing ouf is doing here is registering UNIT_COMBO_POINTS event.
  Reply With Quote
09-29-10, 01:40 PM   #15
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
Originally Posted by d87 View Post
The only thing ouf is doing here is registering UNIT_COMBO_POINTS event.
That's just what it makes so great to use : that lets us make what we want in any way (or mostly) we want.

And we could change the color of the CPoints really easily with sthg like this :

local y = ((-1)*(0.25*(i-1)))+1
:SetVertexColor(1,y,0)

maybe zork will try it or maybe someone else ?
  Reply With Quote
09-29-10, 03:25 PM   #16
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Random Bob Ross quote:
Whatever you want to be in your world will be in your world.

I don't add stuff for people. I add stuff more myself but try to make it readable as far as I can for everyone in case someone wants to put hand on parts of the code.
__________________
| 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
11-21-10, 05:31 PM   #17
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Runebar code.

New runebar function in player.lua
Code:
  --create rune bar
  local createRuneBar = function(self)
    --local f = CreateFrame("Frame","oUF_DiabloRuneBar",self)
    --f:SetPoint(self.cfg.runes.pos.a1,self.cfg.runes.pos.af,self.cfg.runes.pos.a2,self.cfg.runes.pos.x,self.cfg.runes.pos.y)
    --f:SetSize(180,50)
    --func.applyDragFunctionality(f)
    --RuneButtonIndividual1:ClearAllPoints()
    --RuneButtonIndividual1:SetPoint("LEFT",f,"LEFT",10,0)
    
    oUF.colors.runes = {
      {0.8,0,0},
      {0,0.8,0},
      {0,0.8,0.8},
      {0.8,0,0.8},
    }
    
    --self.Runes = {}
    self.Runes = CreateFrame("Frame", nil, self)
    
    
    local NUM_RUNES = 6
    
    local t
    local bar = CreateFrame("Frame","oUF_DiabloRuneBar",self)
    local w = 64*(NUM_RUNES+2)
    local h = 64
    bar:SetPoint(self.cfg.runes.pos.a1,self.cfg.runes.pos.af,self.cfg.runes.pos.a2,self.cfg.runes.pos.x,self.cfg.runes.pos.y)
    bar:SetWidth(w)
    bar:SetHeight(h)
    
    t = bar:CreateTexture(nil,"BACKGROUND",nil,-8)
    t:SetSize(64,64)
    t:SetPoint("LEFT",0,0)
    t:SetTexture("Interface\\AddOns\\rTextures\\combo_left")
    bar.leftedge = t

    t = bar:CreateTexture(nil,"BACKGROUND",nil,-8)
    t:SetSize(64,64)
    t:SetPoint("RIGHT",0,0)
    t:SetTexture("Interface\\AddOns\\rTextures\\combo_right")
    bar.rightedge = t

    bar.back = {}
    bar.filling = {}
    bar.glow = {}
    bar.gloss = {}
    
    for i = 1, NUM_RUNES do
      local back = "back"..i
      bar.back[i] = bar:CreateTexture(nil,"BACKGROUND",nil,-8)  
      bar.back[i]:SetSize(64,64)
      bar.back[i]:SetPoint("LEFT",i*64,0)
      bar.back[i]:SetTexture("Interface\\AddOns\\rTextures\\combo_back")

      bar.filling[i] = CreateFrame("StatusBar",nil,bar)
      bar.filling[i]:SetSize(64,64)
      bar.filling[i]:SetPoint("LEFT",i*64,0)
      bar.filling[i]:SetStatusBarTexture("Interface\\AddOns\\rTextures\\combo_fill")
      bar.filling[i]:GetStatusBarTexture():SetHorizTile(true)
      bar.filling[i]:GetStatusBarTexture():SetBlendMode("ADD")
      --bar.filling[i]:SetStatusbarColor(self.cfg.soulshards.color.r,self.cfg.soulshards.color.g,self.cfg.soulshards.color.b,1)
      --bar.filling[i]:SetBlendMode("ADD")

      bar.glow[i] = bar.filling[i]:CreateTexture(nil,"LOW",nil,-6)  
      bar.glow[i]:SetSize(64*1.25,64*1.25)
      bar.glow[i]:SetPoint("CENTER", bar.filling[i], "CENTER", 0, 0)
      bar.glow[i]:SetTexture("Interface\\AddOns\\rTextures\\combo_glow")
      bar.glow[i]:SetBlendMode("ADD")
      --bar.glow[i]:SetVertexColor(self.cfg.soulshards.color.r,self.cfg.soulshards.color.g,self.cfg.soulshards.color.b,1)

      bar.gloss[i] = bar.filling[i]:CreateTexture(nil,"LOW",nil,-5)  
      bar.gloss[i]:SetSize(64,64)
      bar.gloss[i]:SetPoint("CENTER", bar.filling[i], "CENTER", 0, 0)
      bar.gloss[i]:SetTexture("Interface\\AddOns\\rTextures\\combo_highlight")
      --bar.gloss[i]:SetBlendMode("ADD")

      bar.filling[i].bg = bar.glow[i]

      self.Runes[i] = bar.filling[i]
    end

    bar:SetScale(self.cfg.runes.scale)    
    func.applyDragFunctionality(bar)    
    self.RuneBar = bar
    
  end
Only thing that I had to add was this in runebar.lua of oUF. The overlay needs to hide while the rune is on CD.

Code:
local UpdateRune = function(self, event, rid)
	local rune = self.Runes[rid]
	if(rune) then
		local start, duration, runeReady = GetRuneCooldown(rune:GetID())
		if(runeReady) then
			rune:SetMinMaxValues(0, 1)
			rune:SetValue(1)
			rune.bg:Show()
			rune:SetScript("OnUpdate", nil)
		else
			rune.duration = GetTime() - start
			rune.max = duration
			rune.bg:Hide()
			rune:SetMinMaxValues(1, duration)
			rune:SetScript("OnUpdate", OnUpdate)
		end
	end
Last step:
Add scale value to runebar settings in config.lua

Outcome:


I dont' like it though. Thus I'm not going to keep it.
__________________
| 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 : 11-30-10 at 12:10 PM.
  Reply With Quote
11-21-10, 06:40 PM   #18
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Not keep it? I like it and it fits to the rest of the UI, doesn't it? What are you going to use instead?
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
11-21-10, 07:02 PM   #19
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Try out similar textures but not so bright, with an increased alpha / opacity.
__________________
My oUF Layout: oUF Lumen
  Reply With Quote
11-21-10, 07:30 PM   #20
Monolit
A Black Drake
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 81
Just an idea how you could make your runebar look like:



Don't mind the quality, just a quick 3 min photoshop
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Texturized Combobar


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