Elitist Jerks
Register
Blogs
Chat
Forums
New Posts


Go Back   Elitist Jerks > Public Discussion > User Interface and AddOns

Reply
 
LinkBack (17) Thread Tools
Old 05/21/08, 2:26 AM   #176 (permalink)
Von Kaiser
 
Draenei Priest
 
Feathermoon
Originally Posted by zork View Post
My new mod rFilter2 is out.

It is capable of tracking player buffs, target debuffs and cooldowns.

Screenshots

yay pictures

Memory:
http://zorktdmog.zo.funpic.de/roth_u...608_225652.jpg

SVN-Download from Google-Code:
rothui - Google Code

Texture:
http://rothui.googlecode.com/svn/tru...ures/gloss.tga

Code:
Revision 146: /trunk/rFilter2

How-to:
To edit in your own spells check this part in the rFilter2.lua. I think it is easy to understand if you compare it to the screenshots.

  
 Code type stuff
You can comment out stuff by adding "--" at the start of the line.
Don't forget to count up the number when adding entries.

Hopefully some of you test it and give me some feedback and/or error-reports.
My one question is how do you set this up for multiple toons do you have to make a separate version and enable it for only one toon, or will it work properly if you just add a long list of buffs, debuffs, and cooldowns? Although if you do add a long list it kind of defeats the purpose of using it over one with a large LUA file, correct?
Comments, corrections?
 
User is offline.
Reply With Quote
Old 05/21/08, 3:22 AM   #177 (permalink)
Don Flamenco
 
zork's Avatar
 
Dwarf Warrior
 
Eredar (EU)
Check the latest version.

http://rothui.googlecode.com/svn/tru...2/rFilter2.lua


  -----------------------------------------------------
  -- EDIT YOUR BUFFS/DEBUFFS IN HERE
  -- IMPORTANT, TAGS HAVE TO BE UNIQUE!!!
  -----------------------------------------------------

  -- to enable the icons OOC, put this to 1 while moving the icons and to 0 when ready
  -- 0 = off // 1 = on
  local testmode = 1

  --DEFAULT_CHAT_FRAME:AddMessage("found "..rf2_player_name.." : "..rf2_player_class)
  
  if rf2_player_name == "Grombur" and rf2_player_class == "HUNTER" then
    rf2_spell_list = {
      buffs = {
        [1] = { tag = "battle", spellid = 2048, size = 32, fontsize = 24, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
        [2] = { tag = "commanding", spellid = 469, size = 32, fontsize = 24, posx = 40, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
      debuffs = {
        [1] = { tag = "demo", spellid = 25203, size = 32, fontsize = 24, posx = 0, posy = 40, framestrata = "BACKGROUND", anchor = "UIParent"},
        [2] = { tag = "sunder", spellid = 25225, size = 32, fontsize = 24, posx = 40, posy = 40, framestrata = "BACKGROUND", anchor = "UIParent"},
        [3] = { tag = "clap", spellid = 25264, size = 32, fontsize = 24, posx = 80, posy = 40, framestrata = "BACKGROUND", anchor = "UIParent"},
        [4] = { tag = "scorpid", spellid = 3043, size = 32, fontsize = 24, posx = 120, posy = 40, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
      cooldowns = {
        [1] = { tag = "wrath", spellid = 19574, size = 32, fontsize = 24, posx = 0, posy = 80, framestrata = "BACKGROUND", anchor = "UIParent"},
        [2] = { tag = "rapid", spellid = 3045, size = 32, fontsize = 24, posx = 40, posy = 80, framestrata = "BACKGROUND", anchor = "UIParent"},
        [3] = { tag = "arcane", spellid = 27019, size = 32, fontsize = 24, posx = 80, posy = 80, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
    }
  elseif rf2_player_name == "Rothar" and rf2_player_class == "WARRIOR" then
    rf2_spell_list = {
      buffs = {
        [1] = { tag = "battle", spellid = 2048, size = 18, fontsize = 16, posx = -25, posy = -230, framestrata = "BACKGROUND", anchor = "UIParent"},
        [2] = { tag = "commanding", spellid = 469, size = 18, fontsize = 16, posx = 0, posy = -230, framestrata = "BACKGROUND", anchor = "UIParent"},
        [3] = { tag = "rampage", spellid = 30033, size = 18, fontsize = 16, posx = 25, posy = -230, framestrata = "BACKGROUND", anchor = "UIParent"},
        --[3] = { tag = "berserker", spellid = 18499, size = 32, fontsize = 24, posx = 160, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
        --[5] = { tag = "block", spellid = 2565, size = 32, fontsize = 24, posx = 80, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
      debuffs = {
        [1] = { tag = "sunder", spellid = 25225, size = 18, fontsize = 16, posx = -75, posy = -200, framestrata = "BACKGROUND", anchor = "UIParent"},
        [2] = { tag = "demo", spellid = 25203, size = 18, fontsize = 16, posx = -50, posy = -200, framestrata = "BACKGROUND", anchor = "UIParent"},
        [3] = { tag = "clap", spellid = 25264, size = 18, fontsize = 16, posx = -25, posy = -200, framestrata = "BACKGROUND", anchor = "UIParent"},
        [4] = { tag = "scorpid", spellid = 3043, size = 18, fontsize = 16, posx = 0, posy = -200, framestrata = "BACKGROUND", anchor = "UIParent"},
        [5] = { tag = "fearie", spellid = 26993, size = 18, fontsize = 16, posx = 25, posy = -200, framestrata = "BACKGROUND", anchor = "UIParent"},
        [6] = { tag = "fearieferal", spellid = 27011, size = 18, fontsize = 16, posx = 25, posy = -200, framestrata = "BACKGROUND", anchor = "UIParent"},
        [7] = { tag = "curseofreck", spellid = 27226, size = 18, fontsize = 16, posx = 50, posy = -200, framestrata = "BACKGROUND", anchor = "UIParent"},
        [8] = { tag = "curseoftong", spellid = 11719, size = 18, fontsize = 16, posx = 75, posy = -200, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
      cooldowns = {
        [1] = { tag = "bloodrage", spellid = 2687, size = 32, fontsize = 24, posx = -140, posy = -215, framestrata = "BACKGROUND", anchor = "UIParent"},
        [2] = { tag = "berserkercool", spellid = 18499, size = 32, fontsize = 24, posx = -180, posy = -215, framestrata = "BACKGROUND", anchor = "UIParent"},
        --[1] = { tag = "revenge", spellid = 30357, size = 32, fontsize = 24, posx = 0, posy = 80, framestrata = "BACKGROUND", anchor = "UIParent"},
        --[2] = { tag = "shieldslam", spellid = 30356, size = 32, fontsize = 24, posx = 40, posy = 80, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
    }   
  else
    rf2_spell_list = {
      buffs = {
        [1] = { tag = "battle", spellid = 2048, size = 32, fontsize = 24, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
        --[2] = { tag = "commanding", spellid = 469, size = 32, fontsize = 24, posx = 40, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
      debuffs = {
        [1] = { tag = "demo", spellid = 25203, size = 32, fontsize = 24, posx = 0, posy = 40, framestrata = "BACKGROUND", anchor = "UIParent"},
        [2] = { tag = "sunder", spellid = 25225, size = 32, fontsize = 24, posx = 40, posy = 40, framestrata = "BACKGROUND", anchor = "UIParent"},
        --[3] = { tag = "clap", spellid = 25264, size = 32, fontsize = 24, posx = 80, posy = 40, framestrata = "BACKGROUND", anchor = "UIParent"},
        --[4] = { tag = "scorpid", spellid = 3043, size = 32, fontsize = 24, posx = 120, posy = 40, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
      cooldowns = {
        [1] = { tag = "revenge", spellid = 30357, size = 32, fontsize = 24, posx = 0, posy = 80, framestrata = "BACKGROUND", anchor = "UIParent"},
        --[2] = { tag = "shieldslam", spellid = 30356, size = 32, fontsize = 24, posx = 40, posy = 80, framestrata = "BACKGROUND", anchor = "UIParent"},
        --[3] = { tag = "bloodrage", spellid = 2687, size = 32, fontsize = 24, posx = 80, posy = 80, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
    }    
  end
Important lines:
if rf2_player_name == "Grombur" and rf2_player_class == "HUNTER" then
or
elseif rf2_player_name == "Rothar" and rf2_player_class == "WARRIOR" then
You can set up as many configurations as you want.

 
User is offline.
Reply With Quote
Old 05/22/08, 1:01 AM   #178 (permalink)
Glass Joe
 
Murloc Priest
 
Frostwolf
Not sure if you take any feature requests, but I'm wondering how hard it would be to Grey out the debuff icon when it's not applied instead of having it gone all together.
 
User is offline.
Reply With Quote
Old 05/22/08, 3:53 AM   #179 (permalink)
Don Flamenco
 
zork's Avatar
 
Dwarf Warrior
 
Eredar (EU)
Currently I run a version where I change the Alpha to 0.2 on my Icons if they are not active.

To make something grey you need to use the "SetVertexcolor()"-function. (API LayeredRegion SetVertexColor - WoWWiki - Your guide to the World of Warcraft).
This function can only be used on special layers, textures are one of those and our icon-texture will work.

We need to give our icon-texture a unique name so we can call it, currently the icon-texture is unnamed (nil).

Find:
    --create icon texture
    local t = f:CreateTexture(nil,"BACKGROUND")
    t:SetTexture(SpellIcon)
    t:SetTexCoord(0.1,0.9,0.1,0.9)
    t:SetAllPoints(f)
    f.texture = t
Change it to:
    --create icon texture
    local t = f:CreateTexture(frameName.."_icon","BACKGROUND")
    t:SetTexture(SpellIcon)
    t:SetTexCoord(0.1,0.9,0.1,0.9)
    t:SetAllPoints(f)
    f.texture = t
Now you could change the color whereever you want like this:
local f4 = _G["rf2_"..frameTag.."_icon"] -- frametag is the unique tag of that spell
f4:SetVertexColor(0.3,0.3,0.3)

 
User is offline.
Reply With Quote
Old 05/30/08, 7:04 AM   #180 (permalink)
Glass Joe
 
Tauren Shaman
 
Stonemaul (EU)
rBars
Who to make on mouseOver buttons opacity 0.8 and mouseOut opacity 1?

Last edited by MooMoo : 05/30/08 at 7:43 AM.
 
User is offline.
Reply With Quote
Old 06/07/08, 11:37 AM   #181 (permalink)
Glass Joe
 
Orc Warrior
 
Talnivarr (EU)
Hi.

Been trying to figure out how to change the rBuffbars, as in I want to 'undock' the debuff anchors from the buff one etc and be able to move every 'icon' by it self.
I figured I do it the same way as I did with the actionbars but I just can't seem to get it to work on the buffs, are they locked somehow or similar?

    if(event=="PLAYER_LOGIN") then
      	  
      TemporaryEnchantFrame:ClearAllPoints()
      TemporaryEnchantFrame:SetPoint("TOPRIGHT", Minimap, "TOPLEFT", -30, 5)
      TemporaryEnchantFrame.SetPoint = function() end

      BuffButton1:ClearAllPoints()
      BuffButton1:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
      BuffButton2:ClearAllPoints()
      BuffButton2:SetPoint("CENTER", UIParent, "CENTER", 5, 0)

      DeBuffButton1:ClearAllPoints()
      DeBuffButton1:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
      DeBuffButton2:ClearAllPoints()
      DeBuffButton2:SetPoint("CENTER", UIParent, "CENTER", 5, 0)
and so on (the above code isn't actually what I intend to end up with, just trying to get the buffs/debuffs to move individually)
it returns a nil value even though I'am sure that's the right names etc, anyone know what I do wrong?

also 2 question regarding rFilter2. (been using it for awhile and seems to work fine in general)
though is it possible to speed up the update rate slightly? I feel that it's a tad to slow for pvp really :|

and would it be to much fuzz to had add track for hostile buffs aswell (mainly pvp again) like divine shield, cheating death etc.
I guess it's done by making a new index (hostliebuffs) and changing the "UnitBuff("player", i)" to "UnitBuff("target", i)"
but since it's hostile buffs one needs to somehow add the duration of all the abilitys tracked manually?

/iNF

Last edited by infin1te : 06/08/08 at 7:34 AM.
 
User is offline.
Reply With Quote
Old 06/12/08, 5:15 AM   #182 (permalink)
Don Flamenco
 
zork's Avatar
 
Dwarf Warrior
 
Eredar (EU)
I just want to show you what I was working on lately:
http://zorktdmog.zo.funpic.de/roth_u...108_202808.jpg

I finished rFilter2 for me. It has now two states of alpha, one for out of combat and one for in combat. The grey vertex is working properly now. I found the function that is capable of making items monochrome.

Furthermore I experimented a bit with the border of actionbuttons. You can do nifty things with it when you colorize different states (out of range, not enough mana etc.)

All screens can be found here:
Index of /roth_ui

More about Texture Desaturation can be found here:
API Texture SetDesaturated - WoWWiki - Your guide to the World of Warcraft

Blizzard Example:
http://wowcompares.com/2428278/Frame...onTemplate.lua

To make a texture monochrome do:
texture:SetDesaturated(1)
otherwise do:
texture:SetDesaturated(nil)

Last edited by zork : 06/12/08 at 5:20 AM.

 
User is offline.
Reply With Quote
Old 06/13/08, 7:46 AM   #183 (permalink)
Glass Joe
 
Human Paladin
 
Farstriders
rfilters2

Originally Posted by zork View Post
I just want to show you what I was working on lately:
http://zorktdmog.zo.funpic.de/roth_u...108_202808.jpg

I finished rFilter2 for me. It has now two states of alpha, one for out of combat and one for in combat. The grey vertex is working properly now. I found the function that is capable of making items monochrome.

Furthermore I experimented a bit with the border of actionbuttons. You can do nifty things with it when you colorize different states (out of range, not enough mana etc.)

All screens can be found here:
Index of /roth_ui
It is very nice. I look forward to your next UI iteration and I really should look deeper into rFilters, wich is one of the rare mods from you that I don't use. I just don't really seem to understand what it does, I guess.

Anyway, just dropping by to say I really appreciate all your work. Keep it up!

...elaith19
 
User is offline.
Reply With Quote
Old 06/22/08, 8:58 AM   #184 (permalink)
Glass Joe
 
Blood Elf Hunter
 
Khadgar (EU)
rFilter2

i've been trying to get the filter to work for a couple of days now, and can't seem to get it to work (the icons don't show up at all)
i've set all the positions to 0 so the icons would be in the middle of my screen iirc
got the texture folder in my addons as well
i'll post the code i have atm to show my buffs/debuffs, if somebody would be able to help me with a mistake or something
thanks in advance

  -- to enable the icons OOC, put this to 1 while moving the icons and to 0 when ready
  -- 0 = off // 1 = on
  local testmode = 1
  
  --alpha when buff/debuff/cd not active
  --values between 0 and one are allowed
  local alpha_when_not_active = 1
  
  local alpha_when_in_combat = 1
  
  --make icon grey when buff noch active
  --0 = off // 1 = on
  local use_grey_vertex = 1

  --DEFAULT_CHAT_FRAME:AddMessage("found "..rf2_player_name.." : "..rf2_player_class)

  if rf2_player_name == "Takashi" and rf2_player_class == "WARRIOR" then
    rf2_spell_list = {
      buffs = {
        [1] = { tag = "battle",     spellid = 2048, unit = "player", size = 20, fontsize = 16, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
        [2] = { tag = "rampage", spellid = 30030, size = 18, fontsize = 14, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
      debuffs = {
        [1] = { tag = "sunder",       spellid = 25225,  unit = "target", size = 20, fontsize = 16, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
        [2] = { tag = "demo",         spellid = 25203,  unit = "target", size = 20, fontsize = 16, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
        [3] = { tag = "clap",         spellid = 25264,  unit = "target", size = 20, fontsize = 16, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
      cooldowns = {
        --[1] = { tag = "revenge", spellid = 30357, size = 32, fontsize = 24, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
        --[2] = { tag = "shieldslam", spellid = 30356, size = 32, fontsize = 24, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
        --[3] = { tag = "bloodrage", spellid = 2687, size = 32, fontsize = 24, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
    }   
  else
    rf2_spell_list = {
      buffs = {
        [1] = { tag = "battle", spellid = 2048, unit = "player", size = 32, fontsize = 24, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
	    [2] = { tag = "rampage", spellid = 30030, size = 18, fontsize = 14, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
      debuffs = {
        [1] = { tag = "demo", spellid = 25203, unit = "target", size = 32, fontsize = 24, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
        [2] = { tag = "sunder", spellid = 25225, unit = "target", size = 32, fontsize = 24, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
        [3] = { tag = "clap", spellid = 25264, unit = "target", size = 32, fontsize = 24, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
      cooldowns = {
        --[1] = { tag = "revenge", spellid = 30357, size = 32, fontsize = 24, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
        --[2] = { tag = "shieldslam", spellid = 30356, size = 32, fontsize = 24, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
        --[3] = { tag = "bloodrage", spellid = 2687, size = 32, fontsize = 24, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
    }    
  end

edit: downloaded an interface that had a working rfilter2 and used that, it's working now
don't know what was wrong with it

Last edited by matsjuw : 06/23/08 at 4:13 AM.
 
User is offline.
Reply With Quote
Old 07/01/08, 8:09 PM   #185 (permalink)
Don Flamenco
 
zork's Avatar
 
Dwarf Warrior
 
Eredar (EU)
I am a huge fan of Diablo and so I am in diablo-fever again right now.

Now what first came into my mind when I saw the Diablo 3 gameplay trailer? I said to myself: I want this UI! Now!
So why not just do it myself? So I grabbed some graphics from diablo3.com and made some TGA-files from it.

Here is the first sneak peak:


The Orbs show Health and Mana and they change on Unit_Health or Unit_Mana-Status.

An earlier Screen shows a near half-full orb:
http://zorktdmog.zo.funpic.de/roth_u...208_014709.jpg

I don't know where this is getting me, but its looks kinda cool for now.

*update*

I found some really nice, big screenshots showing the interface. So I could started drawing my actionbar-texture. It will have place for 10 icons (more will destroy the look and feel, so mouseover or macros will be needed).

Current design layout:
http://rothui.googlecode.com/svn/tru...d3barframe.png

I made a much smaller minimap-texture too. I am curious about how everything will turn out. We will see.

Last edited by zork : 07/02/08 at 9:20 AM.

 
User is offline.
Reply With Quote
Old 07/05/08, 12:12 PM   #186 (permalink)
Von Kaiser
 
Undead Rogue
 
Vek'nilash (EU)
Ey was wondering how hard would it be to add focus units target? I'm not that great with lua coding myself, editining existing code is not a problem but I don't feel too secure of adding stuff on my own

Last edited by Kuosi : 07/06/08 at 5:53 AM.
 
User is offline.
Reply With Quote
Old 07/08/08, 8:59 AM   #187 (permalink)
Don Flamenco
 
zork's Avatar
 
Dwarf Warrior
 
Eredar (EU)
rUnits are kinda old and shaby, try oUF + oUF_Lily and no, there is no easy way other than using Pitbull/ag_UF.

I made great progress on the Diablo 3 interface, currently working on the target frame.
Check WoWInterface Downloads : Graphical : Roth UI for further information.

 
User is offline.
Reply With Quote
Old 07/14/08, 4:42 PM   #188 (permalink)
Von Kaiser
 
Draenei Priest
 
Feathermoon
I have to say the new UI looks awesome roth, I agree the default Diablo UI looks really cool and your recreation looks equally nice. I was however surprised to see that you used bongos over rBars or something similar. I was just wondering why didn't you simply edit rbars to fit? Also just a suggestion, rather than making hidden macros or key-bindings you may want to consider some mouse over bars unless your just trying to avoid on update. Anyways keep up the good work!
 
User is offline.
Reply With Quote
Old 07/15/08, 3:27 AM   #189 (permalink)
Don Flamenco
 
zork's Avatar
 
Dwarf Warrior
 
Eredar (EU)
I left rBars on the road for quite some time. It was to time intensive and I need bars with more flexibility. Bongos2 had all this. So easy decision.

 
User is offline.
Reply With Quote
Old 07/17/08, 4:55 PM   #190 (permalink)
Von Kaiser
 
Draenei Priest
 
Feathermoon
I must admit I haven't tried bongos in along time, I was really turned off to it because it didn't handle shapeshifting properly and you couldn't toggle through the bars with the shift+bar# key-bindings. I suppose its been a long enough time for me to give it another whirl but i have to say, bartenders, and rbars are still my favorites.
 
User is offline.
Reply With Quote
Old 07/18/08, 6:31 AM   #191 (permalink)
Glass Joe
 
Pinkiy's Avatar
 
Gnome Mage
 
Argent Dawn (EU)
rbuff:

i wonder if anyone has done this before but i've got this UI and i'm advised that i need to amend the lua file and i'm not really sure what it all means really :P

all i want for it to do is give me a coloured boarder for my weapon poisons and oils that you can apply and such and maybe red for debuffs i guess following the blizz colour trend? i currently like the black boarder and gloss look of my buffs its just the others i want to change. i know elk buff bars used to display them as purple i think.

currently the code is this and any assistance is greatly appreciated

BUFF_FLASH_TIME_ON = 0.8;
BUFF_FLASH_TIME_OFF = 0.8;
BUFF_MIN_ALPHA = 0.70;

local addon = CreateFrame"Frame"
local _G = getfenv(0)

addon:SetScript("OnEvent", function()

if(event=="PLAYER_LOGIN") then

TemporaryEnchantFrame:ClearAllPoints()
TemporaryEnchantFrame:SetPoint("TOPRIGHT", Minimap, "TOPLEFT", -15, 0)
TemporaryEnchantFrame.SetPoint = function() end

BuffFrame:SetScale(1)

TicketStatusFrame:Hide()
TicketStatusFrame.Show = function() end

elseif(event=="PLAYER_AURAS_CHANGED") then
local i
i = 1
while _G["BuffButton"..i] do addon:Update("BuffButton"..i, 1) i = i + 1 end
i = 1
while _G["DebuffButton"..i] do addon:Update("DebuffButton"..i, 2) i = i + 1 end
i = 1
while _G["TempEnchant"..i] do addon:Update("TempEnchant"..i, 3) i = i + 1 end
end

end)

function addon:Update(name, isDebuff)

local b = _G[name.."Border"]
local i = _G[name.."Icon"]
local f = _G[name]
local c = _G[name.."Gloss"]
local ff = _G[name.."Duration"]

ff:SetFont(NAMEPLATE_FONT, 11, "")
ff:ClearAllPoints()
ff:SetPoint("TOP",f,"BOTTOM",0,0)

if not c then

local fg = CreateFrame("Frame", name.."Gloss", f)
fg:SetAllPoints(f)

local t = f:CreateTexture(nil,"ARTWORK")
t:SetTexture("Interface\\AddOns\\rTextures\\gloss.tga")
t:SetPoint("TOPLEFT", fg, "TOPLEFT", -0, 0)
t:SetPoint("BOTTOMRIGHT", fg, "BOTTOMRIGHT", 0, -0)
fg.texture = t

--
if isDebuff == 2 then
local t = f:CreateTexture(nil,'ARTWORK')
t:SetTexture('Interface\\AddOns\\rTextures\\gloss_red')
t:SetPoint('TOPLEFT', fg, 'TOPLEFT', -0, 0)
t:SetPoint('BOTTOMRIGHT', fg, 'BOTTOMRIGHT', 0, -0)
fg.texture = t
elseif isDebuff == 3 then
local t = f:CreateTexture(nil,'ARTWORK')
t:SetTexture('Interface\\AddOns\\rTextures\\gloss_purple')
t:SetPoint('TOPLEFT', fg, 'TOPLEFT', -0, 0)
t:SetPoint('BOTTOMRIGHT', fg, 'BOTTOMRIGHT', 0, -0)
fg.texture = t
else
local t = f:CreateTexture(nil,'ARTWORK')
t:SetTexture('Interface\\AddOns\\rTextures\\gloss_green')
t:SetPoint('TOPLEFT', fg, 'TOPLEFT', -0, 0)
t:SetPoint('BOTTOMRIGHT', fg, 'BOTTOMRIGHT', 0, -0)
fg.texture = t
end
--

i:SetTexCoord(0.1,0.9,0.1,0.9)
i:SetPoint("TOPLEFT", fg, "TOPLEFT", 2, -2)
i:SetPoint("BOTTOMRIGHT", fg, "BOTTOMRIGHT", -2, 2)

end

if b then b:Hide() end

end

SecondsToTimeAbbrev = function(time)
local hr, m, s, text
if time <= 0 then text = ""
elseif(time < 3600 and time > 40) then
m = floor(time / 60)
s = mod(time, 60)
text = (m == 0 and format("|cffffffff%d|r", s)) or format("|cffffffff%d:%02d|r", m, s)
elseif time < 40 then
m = floor(time / 60)
s = mod(time, 60)
text = (m == 0 and format("|cffffffff%d|r", s))
else
hr = floor(time / 3600)
m = floor(mod(time, 3600) / 60)
text = format("%d:%2d", hr, m)
end
return text
end

addon:RegisterEvent"PLAYER_AURAS_CHANGED"
addon:RegisterEvent"PLAYER_LOGIN"
 
User is offline.
Reply With Quote
Old 07/21/08, 4:15 AM   #192 (permalink)
Don Flamenco
 
zork's Avatar
 
Dwarf Warrior
 
Eredar (EU)
What you need can be found here:
World of Warcraft API - WoWWiki - Your guide to the World of Warcraft

The original Blizzard function can be found here:
http://wowcompares.com/2438606/FrameXML/BuffFrame.lua

Its interesting how they get to the weapon type...seems not very common.

Original function:
function BuffFrame_Enchant_OnUpdate(elapsed)
	local hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges = GetWeaponEnchantInfo();
 
	-- No enchants, kick out early
	if ( not hasMainHandEnchant and not hasOffHandEnchant ) then
		TempEnchant1:Hide();
		TempEnchant1Duration:Hide();
		TempEnchant2:Hide();
		TempEnchant2Duration:Hide();
		BuffFrame:SetPoint("TOPRIGHT", "TemporaryEnchantFrame", "TOPRIGHT", 0, 0);
		return;
	end
	-- Has enchants
	local enchantButton;
	local textureName;
	local buffAlphaValue;
	local enchantIndex = 0;
	if ( hasOffHandEnchant ) then
		enchantIndex = enchantIndex + 1;
		textureName = GetInventoryItemTexture("player", 17);
		TempEnchant1:SetID(17);
		TempEnchant1Icon:SetTexture(textureName);
		TempEnchant1:Show();
 
		-- Show buff durations if necessary
		if ( offHandExpiration ) then
			offHandExpiration = offHandExpiration/1000;
		end
		BuffFrame_UpdateDuration(TempEnchant1, offHandExpiration);
 
		-- Handle flashing
		if ( offHandExpiration and offHandExpiration < BUFF_WARNING_TIME ) then
			TempEnchant1:SetAlpha(BuffFrame.BuffAlphaValue);
		else
			TempEnchant1:SetAlpha(1.0);
		end
 
	end
	if ( hasMainHandEnchant ) then
		enchantIndex = enchantIndex + 1;
		enchantButton = getglobal("TempEnchant"..enchantIndex);
		textureName = GetInventoryItemTexture("player", 16);
		enchantButton:SetID(16);
		getglobal(enchantButton:GetName().."Icon"):SetTexture(textureName);
		enchantButton:Show();
 
		-- Show buff durations if necessary
		if ( mainHandExpiration ) then
			mainHandExpiration = mainHandExpiration/1000;
		end
 
		BuffFrame_UpdateDuration(enchantButton, mainHandExpiration);
 
		-- Handle flashing
		if ( mainHandExpiration and mainHandExpiration < BUFF_WARNING_TIME ) then
			enchantButton:SetAlpha(BuffFrame.BuffAlphaValue);
		else
			enchantButton:SetAlpha(1.0);
		end
	end
	--Hide unused enchants
	for i=enchantIndex+1, 2 do
		getglobal("TempEnchant"..i):Hide();
		getglobal("TempEnchant"..i.."Duration"):Hide();
	end
 
	-- Position buff frame
	TemporaryEnchantFrame:SetWidth(enchantIndex * 32);
	BuffFrame:SetPoint("TOPRIGHT", "TemporaryEnchantFrame", "TOPLEFT", -5, 0);
end
The standard overlay border for temporary enchants lives here:
Interface\Buttons\UI-TempEnchant-Border

 
User is offline.
Reply With Quote