Thread Tools Display Modes
05-24-11, 03:44 AM   #1
onewordname
A Defias Bandit
Join Date: May 2011
Posts: 3
creating buttons with kgpanels

After about 12hrs straight I managed to make a button that opens my character screen and changes alpha when opened........Is there anything out there that can help someone who has no idea about scripts to cheat ? like templates or something.

I dont want to modify what the buttons do I just want them to look different.

Im trying to get wow to mimic starcraft2. todo list is:

MicroMenu as buttons
FriendsMicroButton with text showing number of friends online
possibly target/player frame overlay thats clickable.

If anyone can give any sort of advice if im wasting my time or theres anything I can do to make this easier because Ive spent about 30hrs now surfing the net and the scripts I do find dont give me any insight on how to replicate it.
  Reply With Quote
05-24-11, 09:33 AM   #2
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,364
Here are two links that might be able to help you:
kgPanels Wiki and kgPanels-Sample Scripts (although you probably already know them).

A while ago I saw this posted somewhere and copied it:

Someone at WoWUIGallery had asked about the micro menu in the RealUI. Although the author uses his own addon to create the texted based micro menu, this can be done in kgpanels pretty easily.

(I'll use the character frame as an example)
Simply create a panel. Use whatever border and background you want. For the sake of this information, create a panel 32 X 32.

Goto the text options and put in "C" w/o the ". Depending on what font you are using adjust the size if need be. Adjust the color if need be.

Go back to the main panel settings. Click on Intercept Mouse clicks. If not checked the script will not work.

Goto the scripts options. Go down to OnClick. Type in

if pressed then
ToggleCharacter("PaperDollFrame")
end

Click Accept.

You should now have a small square with a C in the middle. If you click it, it should open the Character Frame. Click it again to close.

That's all there is too it. Below I've listed the toggles for various frames:

ToggleCharacter("PaperDollFrame")
ToggleSpellBook("spell")
ToggleTalentFrame()
ToggleAchievementFrame()
ToggleFrame(QuestLogFrame)
TogglePVPFrame()
ToggleLFDParentFrame()
ToggleHelpFrame()
I'm sorry, but I have absolutely no idea who posted it. All credit goes to who ever did, though.

You'll have to figure out some of the other buttons names, though, as this was done pre-Cataclysm and there are some new micro menu buttons. You might be able to get the names using the "/fstack" command and mousing over them.

You might also want to take a look at nibMicroMenu, which is a text-based micro menu addon.

Last edited by jeffy162 : 05-24-11 at 09:51 AM. Reason: More.
  Reply With Quote
05-24-11, 11:51 PM   #3
onewordname
A Defias Bandit
Join Date: May 2011
Posts: 3
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.
  Reply With Quote
05-25-11, 03:38 AM   #4
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by onewordname View Post
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.

Last edited by Nibelheim : 05-25-11 at 03:44 AM.
  Reply With Quote
05-26-11, 01:57 AM   #5
onewordname
A Defias Bandit
Join Date: May 2011
Posts: 3
Thank you both tremendously for all your help. Ive made some progress tho the scripting is still weighing me down aligning text and coloring it, I havnt colored the menu bar yet but just put the labels in to get a feel for it, mini map buttons(stancebar in their place for now) and player/target frames next.

Last edited by onewordname : 06-08-11 at 09:05 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » creating buttons with kgpanels


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