View Single Post
12-04-15, 07:12 PM   #7
Furchee
A Murloc Raider
 
Furchee's Avatar
Join Date: Dec 2015
Posts: 5
Originally Posted by SDPhantom View Post
It that all the code or do you have an XML file with the frame in it?

In all honesty, for a simple addon like this, you could just hook LootFrame itself.
[[Snipped]]
Note: Line 12 uses a casting method to insure id is given a number to index the lookup table. This is given the inherent behavior of X or Y in which if X evaluates to a false condition (false or nil), Y is used.



PS: From the code example, it appears to be mixed with code from vanilla WoW. Globals like this are no longer in use.
Yes actually, there is a frame file that I see calls out the two functions.
With your code I do not see a way to call the functions with the xml file though? -if I'm understanding this right.
XML file :
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
	<Script file="FastDisenchant.lua"/>

	<Frame name="FastDisenchant_Frame">
		<Scripts>
			<OnLoad>
				FastDisenchant_OnLoad();
			</OnLoad>
			<OnEvent>
				FastDisenchant_OnEvent(event);
			</OnEvent>
		</Scripts>
	</Frame>
</Ui>

Edit: Fixed! I simply replaced FastDisenchant_OnLoad(); with LootFrame:HookScript(); and removed the <OnEvent> section of the code.
Thank you so much!

Last edited by Furchee : 12-04-15 at 07:17 PM.
  Reply With Quote