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).