View Single Post
06-02-05, 01:14 PM   #4
diiverr
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 67
Cleaned all my junk posts out of this thread.


Using the above advice, a future DiivSkins will be much more "friendly" to the first time user. Thank you much for your help folks.

If you are lurking and curious how this all worked out, here's the code.

Lua snip:
Code:
function DS_OnEvent()
	if event=="VARIABLES_LOADED" then
		if not DS_UsedBefore then
			-- do one-time stuff for first use here

			-- display the primary game menu without a keypress
			GameMenuFrame:Show();
			-- display an attatched text frame to this menu
			DS_Init:Show();

			-- hide all the DiivSkin crud normally visible at start up
			DS_Hbar1:Hide();
			DS_Hbar2:Hide();
			DS_Hbar3:Hide();
			DS_Hbar4:Hide();
			DS_Hbar5:Hide();
			DS_Hbar6:Hide();
			DS_Hbar7:Hide();
			DS_Hbar8:Hide();
			DS_Vbar1:Hide();
			DS_Vbar2:Hide();
			DS_Vbar3:Hide();
			DS_Vbar4:Hide();
			DS_leftendcap:Hide();
			DS_rightendcap:Hide();
			DS_leftendcap_2:Hide();
			DS_rightendcap_2:Hide();
			DS_smallcorner_R:Hide();
			DS_smallcorner_L:Hide();
			DS_link_1:Hide();
			DS_link_2:Hide();

			--register the variable as true, so the above never happens again.
			DS_UsedBefore = true
		end
	end
end
Now, instead of THIS , we get THIS .

If you are following along at home, the above is referenced in my XML by this code here:
Code:
			<Scripts>
				<OnLoad>
					DS_OnLoad();
					DS_Init:Hide();
				</OnLoad>
				<OnEvent>
					DS_OnEvent();
				</OnEvent>
			</Scripts>
What that does is call the two functions above, and also hide the text frame by default, so it doesn't display every time you access the game menu. Thanks to the "first use" code above, This all will only happen once. Aftere a relog, or a ReloadUI, we're back to business as usual.

Gello, Kaelten, Thanks again the help.

Last edited by diiverr : 06-02-05 at 05:03 PM.
  Reply With Quote