Quantcast Calling Functions in XML Files - WoWInterface
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
11-14-05, 11:59 AM   #1
Rapture
A Murloc Raider
Join Date: Nov 2005
Posts: 8
Calling Functions in XML Files

Hello,

I've begun working on an AddOn based off of StunWatch for Warlock spells and I'm in the process of working on the XML file for it. I've got a couple questions about calling functions and also about Positions/Offsets.

I am making 3 sets of bars (DoTs, Curses, and Misc) and for each set there are X amount of bars. When I looked at StunWatch's XML file, the code for each bar was something like:

Code:
<Frame name="StunWatchBar1" parent="StunWatch" inherits="StunWatchBarTemplate">
	<Anchors>
		<Anchor point="TOPLEFT">
			<Offset>
				<AbsDimension x="0" y="-80" />
			</Offset>
		</Anchor>
	</Anchors>
	<Scripts>
		<OnShow>
			StunWatchBar1_OnShow()
		</OnShow>
	</Scripts>
</Frame>
So I basically copied this and modified it like so:

Code:
<Frame name="DoT_Bar1" parent="SpellTimer" inherits="SpellTimerBarTemplate">
	<Anchors>
		<Anchor point="TOPLEFT">
			<Offset>
				<AbsDimension x="0" y="-220" />
			</Offset>
		</Anchor>
	</Anchors>
	<Scripts>
		<OnShow>
			DoT_Bar1_OnShow()
		</OnShow>
	</Scripts>
</Frame>
Let's say I have 12 DoT bars, is there a way to use a function for the OnShow event that has an arguement? I'm trying to minimize repetition of code so I'm wanting to do something like:

Code:
<OnShow>
	DoT_Bar_OnShow(X)
</OnShow>
Where X is the bar I'm triggering. Is this possible?

Also, I'm wanting to make a background border for each set of bars (to help keep them organized). So will I need to create 3 bar templates and anchor the corresponding bar to that template? Or is there a way to create a background frame (similar to Necrosis's Spell Timer background) for each set?

Finally, in relation to offsets, are they based off of the current position of the parent frame or is it based off of the X/Y point on the screen?

Thanx in advance,
Rapture

Edit: Notice I posted this in the wrong section. Sorry about that.

Last edited by Rapture : 11-14-05 at 12:09 PM.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Calling Functions in XML Files

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