Originally Posted by onewordname
yea ive seen most of that stuff the buttons ive found to be the easiest part but the tooltips and display of friends online i cant get my head around I cant find out what the name of the game menu tooltip is called to add it or how to add mouseover scripts to kgpanels.
|
Tooltips are easy enough. They are slightly different for MicroMenu buttons, though.
An example tooltip for the Talents button.
-- OnEnter
Code:
local TipText = MicroButtonTooltipText(TALENTS_BUTTON, "TOGGLETALENTS")
GameTooltip:SetOwner(self)
GameTooltip_AddNewbieTip(self, TipText, 1.0, 1.0, 1.0, "")
GameTooltip:Show()
-- OnLeave
Code:
if GameTooltip:IsShown() then GameTooltip:Hide() end
Note: TipText will get set to something different for each button.
Button codes are:
MicroButtonTooltipText(CHARACTER_BUTTON, "TOGGLECHARACTER0")
MicroButtonTooltipText(SPELLBOOK_ABILITIES_BUTTON, "TOGGLESPELLBOOK")
MicroButtonTooltipText(TALENTS_BUTTON, "TOGGLETALENTS")
MicroButtonTooltipText(ACHIEVEMENT_BUTTON, "TOGGLEACHIEVEMENT")
MicroButtonTooltipText(QUESTLOG_BUTTON, "TOGGLEQUESTLOG")
MicroButtonTooltipText(SOCIAL_BUTTON, "TOGGLESOCIAL")
MicroButtonTooltipText(GUILD, "TOGGLEGUILDTAB")
MicroButtonTooltipText(PLAYER_V_PLAYER, "TOGGLECHARACTER4")
MicroButtonTooltipText(DUNGEONS_BUTTON, "TOGGLELFGPARENT")
For the GM Request / Help button, TipText gets set slightly differently.
Code:
TipText = HELP_BUTTON
For finding out the number of friends online, you'd want something like the following:
-- OnLoad
Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("FRIENDLIST_UPDATE")
self:RegisterEvent("BN_FRIEND_ACCOUNT_ONLINE")
self:RegisterEvent("BN_FRIEND_ACCOUNT_OFFLINE")
-- OnEvent
Code:
local FriendsOnline = 0
for i = 1, GetNumFriends() do
if select(5, GetFriendInfo(i)) then FriendsOnline = FriendsOnline + 1 end
end
local BNFriendsOnline = 0
for j = 1, BNGetNumFriends() do
if select(7, BNGetFriendInfo(j)) then BNFriendsOnline = BNFriendsOnline + 1 end
end
local FriendString = string.format("%d/%d", FriendsOnline, BNFriendsOnline)
self.text:SetText(FriendString)
Disclaimer: Since I have no WoW account atm, this is all dry coded and may have errors / may not work.