EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > XML Modification Help & Info

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Unread 09-20-2010, 02:54 AM
gdujj gdujj is offline
A Brown Bear
 
Join Date: Sep 2010
Server: Unkown
Posts: 11
Default Conditionals explanation / dynamic class colours / if statements

Hi there,

I've got my dynamic data inputting into a healthbar; I've filtered that dynamic data to remove the default colours. Great!

But all healthbars all now a plan old white color, because I've set "Color='#FFFFFF'".

What I'd really, really love to do is have that Color value change depending on, say, Archetype. I already have this as a text label placed on the healthbar. So on the Archetype's OnTextChange area in the UI builder, I really probably need to do something like this:

OnTextChange="ArchetypeLabel.text="Priest" ? 'HealthBar.Color=#FF000000' : ''"

.. but obviously with 4 conditional statements in there (for priest, fighter, mage and scout). But then it seems inefficient to have the 4 IF statements when really I want 4 conditions, with 1 if and three Elses.

Gah, can someone point me to a working example of this sort of thing so I can expand it for my more complicated purposes? (I've based my above approach on current addons' approach to changing class icons, little images like a shield for a tank, etc, along with searches and looking at the stickies on this forum).

or perhaps there is some way I could say on the HealthBar itself, you know, maybe in OnActivate or OnShow... "if GameData.self.archetype=='Priest' ? 'do priest bg color' : 'nevermind, go to default' else if GameData.self.archetype=='Fighter' ? 'do fighter bg color' : 'nevermind, go to default'... and so on.

Even just a simple example using the above (change font color or bar background based on X, where X is HP value or classtype or whatever, would be good).
Reply With Quote
 



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 03:21 PM.


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