EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > UI Developer Discussion

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 06-15-2006, 06:48 PM
Celestian Celestian is offline
A Crazed Gnoll
Interface Author - Click to view interfaces
 
Join Date: Nov 2004
Server: Antonia Bayle
Posts: 23
Default if then else and gamedata

Ok, say I wanted to check to see if a player was a Templar and if so make a page visible. Something like...

OnActivate="Visible=(GameData.Self.SubClass==Templar)"
or something like:
OnActivate="Visible=(Parent.Parent.Player.SubClass.Text==Templar)"

Now first, can you use GameData in this fashion or do I need to use the Parent.* vars, if so where are the "Self" player fields. I looked in the default ui and couldn't find them myself.

Can you use if, then, else statements? If so whats the proper format?

If there is a FAQ on such things please feel free to point me to them, thanks!

Last edited by Celestian : 06-15-2006 at 06:55 PM.
Reply With Quote
  #2  
Unread 06-15-2006, 07:05 PM
Dolby's Avatar
Dolby Dolby is offline
Bacon Eater
Premium Member
EQ2Interface Admin
This person is a EQ2Map developer.
 
Join Date: Feb 2004
Posts: 2,452
Default

this thread may give you some insight on how things work. Scroll down a few posts and that should be what you’re looking for I think.

Would love to see some interfaces use some of this logic.
Reply With Quote
  #3  
Unread 06-15-2006, 07:16 PM
Celestian Celestian is offline
A Crazed Gnoll
Interface Author - Click to view interfaces
 
Join Date: Nov 2004
Server: Antonia Bayle
Posts: 23
Default

Thanks for the link that definately cleared up some of the if then else questions I had. I followed the other thread as well and it does appear that GameData.* is not how you can compare values.

I am still kinda confused on that point but it seems I will use the Parent.* tree but unsure exactly how to find the "Self" values using it.

Again thanks!
Reply With Quote
  #4  
Unread 06-15-2006, 09:01 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

Game Data is essentially a dynamic data link. A pipe that feeds data to other XML objects. Most of these DDs pass multiple attributes, so I doubt you'll be able to do comparisons on them directly.

The usual comparison method is to attach the desired DD to a standard XML object (like a text field) hidden off screen, then do your comparison against the LocalText of that object.
Reply With Quote
  #5  
Unread 06-16-2006, 02:14 PM
Celestian Celestian is offline
A Crazed Gnoll
Interface Author - Click to view interfaces
 
Join Date: Nov 2004
Server: Antonia Bayle
Posts: 23
Default

Ok did some further testing. I created a Text object (PlayerClassName) in Player xml and the dynamicdata for the text is /GameData.Self.SubClass

I then have a page called "TemplarPage" underthat page are several options and images that are specific to templars. What I have done is this on that page:

OnActivate="Visible=(PlayerClassName.LocalText=='Templar')"

However it always displays the information under the TemplarPage no matter what class I login with. Does making the page, with objects below it, not visible not also make items within that page hidden?
Reply With Quote
  #6  
Unread 06-16-2006, 05:05 PM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

You would need to link it to the OnShow event of that window, as OnActivate won't get triggered.
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
  #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
Reply



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
Forum Jump


All times are GMT -5. The time now is 09:25 AM.


Our Network
EQInterface | EQ2Interface | WoWInterface | LoTROInterface | ESOUI | MMOUI