View Single Post
06-11-05, 10:17 AM   #33
diiverr
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 67
Originally Posted by diiverr
I assume now all I need to do to add more bars is duplicate the core texture frame and corresponding sliders, changing my "hbar1's" to "hbar2's" and so on. The lua functions they call will adjust accordingly? Very slick, and thank you very much!
LOL. I stand corrected. I did that adding the following XML:
-- bar -----
Code:
<Frame name="DiivSkins_hbar2" id="2" frameStrata="BACKGROUND" parent="UIParent" >
	<Size>
		<AbsDimension x="512" y="46"/>
	</Size>
	<Layers>
		<Layer level="ARTWORK">
			<Texture name="DiivSkins_hbar1Texture" file="Interface\AddOns\DiivSkins\Skins\diivskins_01">
				<TexCoords left="0.0019531" right="1.0" top="0.0" bottom="0.0820312"/>
			</Texture>
		</Layer>
	</Layers>
	<Anchors>
		<Anchor point="BOTTOM">
			<Offset>
				<AbsDimension x="215" y="500"/>
			</Offset>
		</Anchor>
	</Anchors>
	<Scripts>
		<OnLoad>
			this:RegisterEvent("VARIABLES_LOADED");
		</OnLoad>
		<OnEvent>
			DS_TextureOnEvent();
		</OnEvent>
	</Scripts>
</Frame>
-- slider -----
Code:
<Slider name="DiivSkins_hbar2Slider" inherits="OptionsSliderTemplate" minValue="1" maxValue="12" defaultValue="2" valueStep="1">
	<Size>
		<AbsDimension x="160" y="17"/>
	</Size>
	<Anchors>
		<Anchor point="TOPLEFT" relativeTo="DiivSkins_hbar1Slider">
			<Offset>
				<AbsDimension x="30" y="-80"/>
			</Offset>
		</Anchor>
	</Anchors>
	<Scripts>
		<OnLoad>
			getglobal(this:GetName().."Text"):SetText("Horizontal Bar 2");
			getglobal(this:GetName().."High"):SetText("12 slots");
			getglobal(this:GetName().."Low"):SetText("1 slot");
		</OnLoad>
		<OnShow>
			this:SetValue(DiivSkinSettings["hbar2"]);
		</OnShow>
		<OnValueChanged>
			if DiivSkinSettings then
				DiivSkinSettings["hbar2"] = this:GetValue();
				DS_TextureUpdate("hbar2");
			end
		</OnValueChanged>
	</Scripts>
</Slider>
This returns an error from this line of the lua:
Code:
	texture:SetTexCoord(var.a, var.b, var.c, var.d);
attempt to index local `texture' (a nil value)


So, true to topic.. I now go back to sorting out... "What am I missing"

edit:
Thinking out loud again... I am registering a variable, I now have [hbar2] in my DiivSkinSettings={}, but the update function is not performing its job, either dynamically with a slider change, or with the VARIABLES_LOADED event.

Last edited by diiverr : 06-11-05 at 10:23 AM.
  Reply With Quote