Thread Tools Display Modes
06-14-05, 08:38 AM   #1
TinaMarie
A Defias Bandit
Join Date: Jun 2005
Posts: 2
First plugin questions...

I'm working on a little plugin that will add some auction house functionality. This is my first attempt at this, and I think there are some concepts I'm not getting.

My first try was to add a few buttons to the main AH page. This worked, but there's not much room, and certainly not enough to add as many as I want. Is there a way to force the outer frame (which I don't own) to resize to be bigger? I thought maybe it would auto-resize to hold all the buttons, but that doesn't happen.

Then I thought about adding a pane to the right, which might work, but looks bad.

The next try was to add a new tabbed page, which would have my controls on it. I added the "tab" button, I put some stuff on the new page, and it shows and hides as I page through the tabs. The only problem here is that the tab button doesn't hide exactly right, probably becuse I need to make some changes to AuctionFrameTab_OnClick to tell it that there's one extra button there that needs the graphics changed. Can I override it in my lua file?

What if I copy the AuctionFrame.lua/.xml to my directory? Can I modify it, then use that to entirely replace the AH interface with my own?

Thanks!

Tina Marie
  Reply With Quote
06-14-05, 08:56 AM   #2
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
You can use SetWidth or SetHeight to change the dimensions of a frame as long as it has a name. But this won't change any artwork.

You can force the artwork to stretch by setting anchors as long as the texture has a name, to cover the extra distance. But it may look odd if the UI is placing stuff ontop of stretched artwork that's now out of place.

As an example try this in game and you should see what you can do:

/script AuctionFrame:SetHeight(AuctionFrame:GetHeight() + 100)
/script AuctionFrameBotLeft:SetPoint("BOTTOMLEFT","AuctionFrame","BOTTOMLEFT")
/script AuctionFrameBot:SetPoint("BOTTOM","AuctionFrame,"BOTTOM")
/script AuctionFrameBotRight:SetPoint("BOTTOMRIGHT","AuctionFrame","BOTTOMRIGHT")

The 3 SetPoints are used on named textures in the AH frame.

Textures can have multiple anchors. In the AH all textures appear to be anchored to topleft and drawn with an offset from the topleft. Adding a "BOTTOMRIGHT" anchor to AuctionFrameBotRight will still keep the topleft anchor, but it will add a bottomright anchor that will stretch the texture.

You can copy the FrameXML file but don't ever post it someplace for distribution if you do. Mods that alter FrameXML tend to break very fast and are wisely unused by most.

If you want to change AuctionFrameTab_OnClick() you can write your own to use instead. In your mod's OnLoad:

AuctionFrameTab_OnClick = my_AuctionFrameTab_OnClick

then later in your lua:

function my_AuctionFrameTab_OnClick(index)
-- copy/paste the FrameXML's version and make your changes here
end

the game will now use your version instead of the default.

Last edited by Gello : 06-14-05 at 09:01 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » First plugin questions...

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