Page 1 of 1

IF statements in UI's

Posted: Sat Apr 10, 2004 9:50 pm
by TAGBOT
Just wondering if it is possible to have "IF" statements in a UI betwwen the ToolTipReferences. I can not figure out the proper syntax, any help would be appreciated.

I would like to have in my target window the X and Y target locations blank when there is no target.

IF ${Target.X}=="NULL","", X:${Target.X}

I would also like if mana and hp are max to show a 0 regen in my player window.

IF ${Me.CurrentHPs}==${Me.MaxHPS},"0",${Me.HPRegen} and


IF ${Me.CurrentMana}==${Me.MaxMana},"0",${Me.ManaRegen}

Thanks in advance.

Posted: Sat Apr 10, 2004 10:39 pm
by wassup
${If[conditions,true,false]} is the syntax if I am not mistaken.

Not sure it will work, but

Code: Select all

${If[${Target.X},${Target.X},""]}

Posted: Sat Apr 10, 2004 11:27 pm
by Lax
/sigh

If you have no target, ${Target.X} is "NULL". The UI will not display anything that is simply "NULL". This is mentioned all over. The only time you need to do an ${If} to hide a NULL is if the end result isnt just "NULL".. like if your tooltip reference was "${Target.Y},${Target.X}" rather than having 2 labels that had one ${} each

0's you will have to hide since 0 is popularly valid. Wassup's suggestion is the way to go for those cases

Posted: Sat Apr 10, 2004 11:51 pm
by TAGBOT
I have read that NULL stuff all over, but I have X:${Target.X} and when i have no target it shows X:NULL in my target box.

Also the ${Target.headingTo} is acting weird, if I line up with a target, lets say north of me it says i need to go NE to get to it even tho I actually need to go NW to get to it.

Posted: Sun Apr 11, 2004 12:56 am
by Lax
I'll check on that. In the meantime you could use ${Target.HeadingTo.Degrees} (or Degrees.Int) and think of it like an actual compass

Posted: Sun Apr 11, 2004 1:13 am
by TAGBOT
Thanks Wassup.

I used ${If[${Target.X},X:${Target.X},]} and it is blank when there is no target.
Also both HP & Mana Regen show zero when maxed now ${If[${Me.CurrentMana}==${Me.MaxMana},0,${Me.ManaRegen}]} and ${If[${Me.CurrentHPs}==${Me.MaxHPs},0,${Me.HPRegen}]}

Now using ${Target.HeadingTo} for targets that east or west of you are 180 ddegrees out and targets north or south are off about 45 degrees.

Posted: Sun Apr 11, 2004 2:12 pm
by GD
Ya know, i just started updating my UI to use MQData, and i must say, it is MUCH faster.

I've only converted about 50% of it so far, but the increase from using the new system in my buff windows alone was about 12FPS, about where it would be if i wasn't using an MQ enhanced UI.

Posted: Sun Apr 11, 2004 9:05 pm
by fryfrog
You can say that again, I had converted the Solaria cast spells window to include the # of casts till oom that someone else posted here. It is a fairly simple calculation, Current mana / cost of spell but in the old system it alone at 10FPS easy. Now with the new system, I think the whole UI doesn't eat more than 1-3 FPS.

Posted: Mon Apr 12, 2004 12:36 am
by ieatacid
What about getting the buff window to display both buff duration and the spell name? I can get it to display duration using an If statement, I'm just stumped on how to get the spell name beneath it like on the double-blah horizontal buff window.
Image

The old $parm code for that was

Code: Select all

<TooltipReference>$if("$char(buff,1)"=="NULL","","$left(17,"$char(buff,1)") $char(buff,1,durationsecs)")</TooltipReference>
I got durations to work using mq2data like this

Code: Select all

<TooltipReference>${If[${Me.Buff[1]},${Me.Buff[1].Duration.Time},]}</TooltipReference>
Just trying to get the name back underneath it now. Any ideas?

Posted: Mon Apr 12, 2004 3:29 am
by Lax
Here's an idea use a second fucking label