Hello Wow Interface,
I am new at add-on development and came here in the hope to get some help, all help is appreciated!
First off I want to note am vaguely familiar with event handling and have not gotten to that part yet.
I am working on a simple Auction House Add-on for different search function-ability.
So far I have managed to hook my code into the Blizzards Auction UI, I have successfully created a new tab in the auction house but got overlapped by other add-ons, so I decided to have a separate frame that opens with the AH (which I was successful) and added the new tab to the new frame.
What I'm having troubles with is, when I click the tab the auction house will change tabs successfully (I don't know why, but good), but when I add an onlcick handler to the tab button the AH loses the ability to change tabs and gives an error. I assume the onlick handler is what will hide content on the ah and display the new content
The Code:
Urchin.toc
Code:
## Interface: 70000
## Title: Urchin
## Version: 0.1
## LoadOnDemand: 1
## LoadWith: Blizzard_AuctionUI
Urchin.xml
Urchin.xml
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Urchin.lua"/>
<Script file="UI/AdvancedSellTab.xml"/>
<Frame
name="myTabContainerFrame"
toplevel="true"
frameStrata="DIALOG"
movable="true"
enableMouse="true"
hidden="false"
parent="AuctionFrame">
<Size>
<AbsDimension x="480" y="325"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset><AbsDimension x="-200" y="200"/></Offset>
</Anchor>
</Anchors>
<Backdrop
bgFile="Interface\DialogFrame\UI-DialogBox-Background"
edgeFile="Interface\DialogFrame\UI-DialogBox-Border"
tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="32"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
</Backdrop>
<Layers>
<Layer level="ARTWORK">
<Texture name="myFrameHeader" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size>
<AbsDimension x="356" y="64"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="12"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString inherits="GameFontNormal" text="My Frame">
<Anchors>
<Anchor point="TOP" relativeTo="myFrameHeader">
<Offset>
<AbsDimension x="0" y="-14"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="AuctionFrameTab4" inherits="AuctionTabTemplate" id="4" text="New">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-8" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>AdvancedSellTabFrame:show();</OnClick>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnLoad>self:RegisterForDrag("LeftButton");</OnLoad>
<OnDragStart>self:StartMoving();</OnDragStart>
<OnDragStop>self:StopMovingOrSizing();</OnDragStop>
</Scripts>
</Frame>
</Ui>
Urchin.lua is blank
AdvancedSellTab.xml
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Frame
name="AdvancedSellTabFrame"
toplevel="true"
frameStrata="DIALOG"
movable="true"
enableMouse="true"
hidden="true"
parent="AuctionFrame">
<Size>
<AbsDimension x="480" y="325"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset><AbsDimension x="-200" y="200"/></Offset>
</Anchor>
</Anchors>
<Backdrop
bgFile="Interface\DialogFrame\UI-DialogBox-Background"
edgeFile="Interface\DialogFrame\UI-DialogBox-Border"
tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="32"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
</Backdrop>
<Layers>
<Layer level="ARTWORK">
<Texture name="myFrameHeader" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size>
<AbsDimension x="356" y="64"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="12"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString inherits="GameFontNormal" text="My Frame">
<Anchors>
<Anchor point="TOP" relativeTo="myFrameHeader">
<Offset>
<AbsDimension x="0" y="-14"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
</Frames>
</Frame>
</Ui>
I know it looks and feels a little different/funny, but in my overall goal that frame that acts external will be a separate window within the AH allowing multitasking. The tab hanging off of the right of the window will influence the actual AH shown frames, and eventually at the bottom of the new window will have separate tabs specifically for the floating window.
When I get rid of the OnClick for the tab button the AH changes tabs successfully, but when I use the OnClick to show the new AH frame that overlays the AH (not the floating window) I just get an error
Code:
Message: [string "AuctionFrameTab4:OnClick"]:1: attempt to index global 'AdvancedSellTabFrame' (a nil value)
Time: 10/19/16 17:22:22
Count: 4
Stack: [string "*:OnClick"]:1: in function <[string "*:OnClick"]:1>
Locals: self = AuctionFrameTab4 {
0 = <userdata>
}
button = "LeftButton"
down = false
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index global 'AdvancedSellTabFrame' (a nil value)"
Also to note that the frame code was ripped from wowwiki for the time being (just my way of getting a hold of things)
I do have prior experience with php
I hope this was explanatory enough, thank you for any help