IF statements in UI's

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

TAGBOT
orc pawn
orc pawn
Posts: 17
Joined: Fri Apr 09, 2004 12:27 pm

IF statements in UI's

Post by TAGBOT » Sat Apr 10, 2004 9:50 pm

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.
Last edited by TAGBOT on Sat Apr 10, 2004 11:53 pm, edited 1 time in total.

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Sat Apr 10, 2004 10:39 pm

${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},""]}

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Sat Apr 10, 2004 11:27 pm

/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
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

TAGBOT
orc pawn
orc pawn
Posts: 17
Joined: Fri Apr 09, 2004 12:27 pm

Post by TAGBOT » Sat Apr 10, 2004 11:51 pm

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.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Sun Apr 11, 2004 12:56 am

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
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

TAGBOT
orc pawn
orc pawn
Posts: 17
Joined: Fri Apr 09, 2004 12:27 pm

Post by TAGBOT » Sun Apr 11, 2004 1:13 am

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.

GD
a snow griffon
a snow griffon
Posts: 353
Joined: Sat Jun 29, 2002 11:57 pm

Post by GD » Sun Apr 11, 2004 2:12 pm

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.
Opinions are like assholes, everyone has one, but most of them stink.

fryfrog
a hill giant
a hill giant
Posts: 271
Joined: Fri Jun 20, 2003 5:37 am

Post by fryfrog » Sun Apr 11, 2004 9:05 pm

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.

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Post by ieatacid » Mon Apr 12, 2004 12:36 am

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?

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Mon Apr 12, 2004 3:29 am

Here's an idea use a second fucking label
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0