Thread Tools Display Modes
11-27-15, 08:52 PM   #1
dio.henrique
A Murloc Raider
 
dio.henrique's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2015
Posts: 5
BuffButton Single Move

Hello everyone!

I am a walkout addon Dev and tried a lot of things to make an addon to move one by one buffbutton (put any of that where I want to). Other words, divide them!

I appreciate any help!

With very small and simple code as possible, plz.

[i] P.S: Sorry about bad english [/ i]
  Reply With Quote
11-30-15, 11:42 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Your post is not very clear, and I don't really know what you're asking for.

Do you want to change an existing addon? If so, which addon?

Do you want to write a new addon? If so, does it affect another addon, or the default UI?

Did you already write some code? If so, where is it? Nobody can help you fix your code if we can't see it.

If you aren't able to write well in English, it's probably better to just write in your native language, and we can use Google Translate to get a more readable English version.
__________________
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
12-01-15, 04:22 PM   #3
dio.henrique
A Murloc Raider
 
dio.henrique's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2015
Posts: 5
Sorry about mistakes, Phanx

Ok, ill try to explain better.

I'm trying to write a new addon.
I was trying to 'move' buff by byff from BuffFrames, to position it where i want to, but, on blizz foruns, some guy said it's a very diffculty thing to move default buff buttons.
Then, he posted me some code to create a new button, and its gonna get the buff as i want to, by the especific name.

The problem 'now' is, im just getting a green square on the screen.

Here is the code:

Lua Code:
  1. [code]local buff = "Aspecto do Guepardo"
  2. local button = CreateFrame("Button", nil, UIParent)
  3.  
  4. button:SetSize(36,36)
  5. button:SetPoint("CENTER")
  6. button.icon = button:CreateTexture(nil,"ARTWORK")
  7. button.icon:SetTexture("Interface\\Icons\\Spell_Shadow_UnholyFrency")
  8. button.icon:SetAllPoints(true)
  9.  
  10. local function b(self, event, ...)
  11.  
  12. print("teste")
  13.  if UnitBuff("player",buff) then
  14.  button:Show()
  15.  else
  16.  button:Hide()
  17.  end
  18. end
  19.  
  20. local f = CreateFrame("Frame")
  21.  
  22.  f:SetScript("OnEvent", b)
  23.  f:RegisterUnitEvent("UNIT_AURA", "player")
  24.  
  25. update()[/code]


If the english still bad, let me know!
  Reply With Quote
12-02-15, 06:48 AM   #4
Yukyuk
A Chromatic Dragonspawn
 
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 179
Typo

You made a typing error.

Use ICONS
Lua Code:
  1. button.icon:SetTexture("Interface\\ICONS\\Spell_Shadow_UnholyFrency")

Instead of Icons
Lua Code:
  1. button.icon:SetTexture("Interface\\Icons\\Spell_Shadow_UnholyFrency")
__________________
Better to fail then never have tried at all.
  Reply With Quote
12-02-15, 08:46 AM   #5
dio.henrique
A Murloc Raider
 
dio.henrique's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2015
Posts: 5
Hey, Yukyuk

Can u help me to set the button to 'blink/wobble', just like procs..?!

Tnx for the answer, and i typed wrog the "Spell_Shadow_UnholyFrenCy", too.
Its "FrenZy".
  Reply With Quote
12-02-15, 12:51 PM   #6
Yukyuk
A Chromatic Dragonspawn
 
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 179
@dio.henrique

Can't help you with that.
Am not that experienced with the whole wow user interface yet.

Originally Posted by dio.henrique View Post
Hey, Yukyuk

Can u help me to set the button to 'blink/wobble', just like procs..?!

Tnx for the answer, and i typed wrog the "Spell_Shadow_UnholyFrenCy", too.
Its "FrenZy".
__________________
Better to fail then never have tried at all.
  Reply With Quote
12-02-15, 06:03 PM   #7
dio.henrique
A Murloc Raider
 
dio.henrique's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2015
Posts: 5
Ty anyways, man.
Hey Phanx, u r the man on wow programing, plz, throw your experience.
  Reply With Quote
12-04-15, 12:07 AM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Never done anything with the proc glow stuff, and don't really care about it (I generally dislike animations of any kind in a UI) but you might take a look at this library:

http://www.wowace.com/addons/libbuttonglow-1-0/

Also, I am not a man.
__________________
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
12-04-15, 06:01 AM   #9
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Originally Posted by Phanx View Post
Also, I am not a man.
*stabs witch king in the face*
__________________
Grab your sword and fight the Horde!
  Reply With Quote
12-08-15, 05:30 PM   #10
dio.henrique
A Murloc Raider
 
dio.henrique's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2015
Posts: 5
Thanks for the help, Phanx


Can anyone help with what is wrong on my code, cooldown frame is not showing:

Lua Code:
  1. local buff = "Treinamento de Francoatirador"
  2. local button = CreateFrame("Button", nil, PlayerFrame) --"SpellActivationOverlayTemplate"
  3. local _,_,_,_,_,duration,expiration = UnitBuff("player",buff)
  4.  
  5. button:SetSize(36,36)
  6. button:SetAlpha(0.5)
  7. button:SetPoint("CENTER", PlayerFrame, "TOPRIGHT", -22, 10)
  8. button.icon = button:CreateTexture(nil,"ARTWORK")
  9. button.icon:SetTexture("Interface\\Icons\\Ability_Hunter_SniperTraining")
  10. button.icon:SetAllPoints(true)
  11.  
  12. button.cooldown = CreateFrame("Cooldown", nil, UIParent)
  13. button.cooldown:SetPoint("CENTER")
  14. button.cooldown:SetCooldown(expiration-duration,duration)
  15.  
  16. local function b(self, event, ...)
  17.    
  18.     if UnitBuff("player", buff) then
  19.         button:Show()
  20.     else
  21.         button:Hide()
  22.     end
  23. end
  24.  
  25.  
  26. local f = CreateFrame("Frame")
  27.  
  28.     f:SetScript("OnEvent", b)
  29.     f:RegisterUnitEvent("UNIT_AURA", "player")
  Reply With Quote
12-08-15, 07:01 PM   #11
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
The cooldown has no size.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » BuffButton Single Move


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