Thread Tools Display Modes
01-22-15, 10:16 PM   #1
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
kgPanels: Tooltip for Button

I'd like to add tooltips to my kgPanels Buttons. But I'm just too silly for it
I googled this thread and some other things but it did not help me much: http://www.wowinterface.com/forums/s...ad.php?t=40264
I only managed to get a Tooltip of different Microbuttons

The tooltip shoud be anchored ontop of the button with this Text:
Left Klick:
1. Show Action Bar
2. Show Bar on Mouseover

Right Klick:
1. Hide Action Bar
2. Show Bar on Mouseover

Currently the button only have this:

OnLeave
Code:
self:SetAlpha(0)
OnEnter
Code:
self:SetAlpha(1)
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________
  Reply With Quote
01-22-15, 11:27 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Add to the OnEnter function:
Code:
GameTooltip:SetOwner(self, "ANCHOR_NONE")
GameTooltip:SetPoint("BOTTOM", self, "TOP", 0, 5)
GameTooltip:SetText([[
|cff00bfffLeft-Click:|r
1. Show Action Bar
2. Show Bar on Mouseover

|cff00bfffRight-Click:|r
1. Hide Action Bar
2. Show Bar on Mouseover
]], 1, 1, 1)
and to the OnLeave:
Code:
GameTooltip:Hide()
I just used the same blue you used in your post, but I suspect it may be a bit dark in-game, so you might need to play with it a bit.
__________________
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.

Last edited by Phanx : 01-23-15 at 06:39 AM.
  Reply With Quote
01-23-15, 06:18 AM   #3
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
Awesome Phanx even with color, now I see why me try at
GameTooltip:SetText("This is my awesome tooltip!", 0.5, 0.5, 0.5, 0.75, 1)
did not work

ps: there is an f missing in line 7 |cff00bfffRight-Click:|r
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________

Last edited by Tonyleila : 01-23-15 at 06:20 AM.
  Reply With Quote
01-23-15, 07:00 AM   #4
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
By the way is there an easy way to add a translation to the tooltip?
I coud find this but not shure how to add it:

Code:
local L = GetLocale() == "deDE" and {
text=
|cff00bfffLinks-Klick:|r
1. Verstecke Aktionsleiste 3
2. Leiste bei Mouseover

|cff00bfffRechts-Klick:|r
1. Zeige Aktionsleiste  3
2. Leiste bei Mouseover
} or {
text=
|cff00bfffLeft-Click:|r
1. Hide Action Bar 3
2. Bar on Mouseover

|cff00bfffRight-Click:|r
1. Show Action Bar 3
2. Bar on Mouseover
}
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________
  Reply With Quote
01-23-15, 07:08 AM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Put that in your OnLoad:
Code:
if GetLocale() == "deDE" then self.tooltip = [[
|cff00bfffLinks-Klick:|r
1. Verstecke Aktionsleiste 3
2. Leiste bei Mouseover

|cff00bfffRechts-Klick:|r
1. Zeige Aktionsleiste 3
2. Leiste bei Mouseover
]]
else self.tooltip = [[
|cff00bfffLeft-Click:|r
1. Hide Action Bar 3
2. Bar on Mouseover

|cff00bfffRight-Click:|r
1. Show Action Bar 3
2. Bar on Mouseover
]]
end
Then change your OnEnter script to:
Code:
GameTooltip:SetOwner(self, "ANCHOR_NONE")
GameTooltip:SetPoint("BOTTOM", self, "TOP", 0, 5)
GameTooltip:SetText(self.tooltip, 1, 1, 1)
__________________
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
01-23-15, 07:37 AM   #6
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
Nice, but I had the feeling its causing problems with the Dominos script coud that be possible? Or maybe it was just a lag...

Lua Code:
  1. self:Show()
  2. self:SetAlpha(0)
  3.  
  4. self.frame = Dominos.Frame:Get(5)
  5.  
  6. self.defaultFadeAlpha = Dominos.db.profile.frames[5].fadeAlpha
  7. self.defaultAlpha = Dominos.db.profile.frames[5].alpha or 1
  8.  
  9. self.oldExpAlpha = Dominos.Frame.GetExpectedAlpha
  10. self.newExpAlpha = function(frame) return self.defaultAlpha end
  11.  
  12. if self.frame.sets.leilanofade then
  13. local f = self.frame
  14. f.GetExpectedAlpha = self.newExpAlpha
  15. f:UpdateAlpha()
  16. end
  17.  
  18. if GetLocale() == "deDE" then self.tooltip = [[
  19. |cff00bfffLinks-Klick:|r
  20. 1. Verstecke Aktionsleiste 5
  21. 2. Leiste 5 bei Mouseover
  22.  
  23. |cff00bfffRechts-Klick:|r
  24. 1. Zeige Aktionsleiste 5
  25. 2. Leiste 5 bei Mouseover
  26. ]]
  27. else self.tooltip = [[
  28. |cff00bfffLeft-Click:|r
  29. 1. Hide Action Bar 5
  30. 2. Bar 5 on Mouseover
  31.  
  32. |cff00bfffRight-Click:|r
  33. 1. Show Action Bar 5
  34. 2. Bar 5 on Mouseover
  35. ]]
  36. end
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________
  Reply With Quote
01-23-15, 06:45 PM   #7
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
OK nevermind, it worked fine the whole day I guess it was just lagg when I tryed it out first.
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________
  Reply With Quote
01-25-15, 09:21 AM   #8
JDoubleU00
A Firelord
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 463
Hey, isn't there suppose to be a .zip file with the completed code posted by Phanx?
__________________
Author of JWExpBar and JWRepBar.
  Reply With Quote
01-25-15, 10:46 AM   #9
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
Originally Posted by rocnroll View Post
Hey, isn't there suppose to be a .zip file with the completed code posted by Phanx?
Why? Its a script for kgpanels why woud anyone post a zip file of it?
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________
  Reply With Quote
01-25-15, 07:13 PM   #10
JDoubleU00
A Firelord
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 463
Originally Posted by Tonyleila View Post
Why? Its a script for kgpanels why woud anyone post a zip file of it?
I was trying to be funny based on a post you made Tonyleila.
__________________
Author of JWExpBar and JWRepBar.
  Reply With Quote
01-25-15, 08:54 PM   #11
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
Originally Posted by rocnroll View Post
I was trying to be funny based on a post you made Tonyleila.
OK now I know but I'm still not laughing
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » kgPanels: Tooltip for Button

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