View Single Post
  #7  
Unread 06-16-2006, 06:31 PM
Zonx's Avatar
Zonx Zonx is offline
A Green Troll
This person is a EQ2Map developer.
Featured
 
Join Date: Dec 2004
Server: Blackburrow
Posts: 2,221
Default

Hiding a page does hide everything it contains.

You'll need a setup something like this...

PalyerWindow
|- PlayerClassName
|- TemplarPage
| `- Templar specific stuff
|- General player stuff
`- Window elements

PlayerWindow has OnShow="TemplarPage.Activated=true"

TemplarPage is initially Activated="false" and has the following script...

OnActivate="Visible=(parent.PlayerClassName.LocalText=='Templar')
Activated=false"

Note: you must parent up befor referencing adjacent objects or the reference is interpreted as an attribute or child of the object containing the script. Also note its good prctice to reset the "Activated" to false on any objects that may need to have that script retriggered. If the object is already set to Activated=true, doing so again won't trigger the event. The same applies to almost every event attribute (Pressed is an exception, it automaticaly resets to false).

Now the really tricky part of this is getting the PlayerWindow to trigger its OnShow event and at the right time. If the window is saved in a visible state, it may not fire untill the window visibility is toggled. There may also be timing issues where the OnShow fires before the PlayerClassName has been populated with DD.

A workaround for this is to use Onshow and OnHide scripts to toggle the window off and on initially. Using this method your PlayerWindow would have the following scripts...

OnShow="Visible=false"

OnHide="OnShow='TemplarPage.Activated=true
Visible=true"

This insures the client is already in a state that allows toggeling window visibility (and DDs have been rendered) before activating the TemplarPage. The initial OnShow script cues up an event to hide the window. Once the client is able to do that, the OnHide script fires... changing the OnShow script to activate the TemplarPage, then shows the window.
Reply With Quote