View Single Post
10-29-19, 02:44 PM   #1
Noresa
A Murloc Raider
Join Date: Oct 2019
Posts: 4
Add another Button into the Blizzard Game Menu

Hello Guys,

I want to learn about Addon creating and .lua. Recently I am trying to figure out how I simply add another Button to the Game Menu with different functions. For example open up a config Menu of another AddOn, or simply a little script to open the Character Panel for example.

I guess this all can be done with the functions and templates from the Blizzard GameMenuFrame.lua and the Button design can be pulled from "GameMenuButtonTemplate".

My problem is I don't know how to set it all together, I've done the basics with the resources I could find, like creating a Button, creating a Button that makes an Emote on Press, creating a panel etc.

Question is how can I get to the Game Menu and add a button there. Step 1 is finding out how to add it to the menu and after that is done, Step 2 I can do all the function things I want and play around further.

Any Advice would be great.

Regards


EDIT: Okay, got my fingers wet. So I've started with hiding the Help Button for my own Button, after that I created a frame and as a parentFrame I just gave the "GameMenuFrame". Played around a little and used a SetScript to do an Emote when pressing the button, but now I have to figure out how to close the Frame after pressing the button and how to open the frames I want.

Code Snippet:

Code:
GameMenuButtonHelp:Hide()

local frame = CreateFrame("Button","UIPanelButtonTemplateTest",
GameMenuFrame, "UIPanelButtonTemplate")
frame:SetHeight(20)
frame:SetWidth(145)
frame:SetText("Hello World Button")
frame:ClearAllPoints()
frame:SetPoint("TOP", 0, -30)
frame:RegisterForClicks("AnyUp")
frame:SetScript("OnClick", function()
	DoEmote("dance", UnitName("target"))
end )

Last edited by Noresa : 10-29-19 at 08:11 PM.
  Reply With Quote