EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   Level: None (https://www.eq2interface.com/forums/showthread.php?t=15140)

Draven_Caine 11-25-2010 11:07 PM

Level: None
 
Is there a way if the lvl is None to not have it parse?

Like if the lvl is a lvl number show, if the lvl is none dont show it?

Thanks,
Draven

Drumstix42 11-26-2010 12:11 AM

Make that element invisible, and make a new text element exactly like it. Don't use the dynamicdata for the next text however.

In the invisible element you would add a OnTextChanged property and do something like this:

Code:

sCurrentLevel=Text
bCheck=(Text == 'None')
sResult=(bCheck ? ' ' : sCurrentLevel)
Parent.NewLevelDisplay.text=sResult

where NewLevelDisplay is your new, visible text element. That should make it show the level as long as it's not equal to "None".

Draven_Caine 11-26-2010 01:06 AM

Quote:

Originally Posted by Drumstix42 (Post 94531)
Make that element invisible, and make a new text element exactly like it. Don't use the dynamicdata for the next text however.

In the invisible element you would add a OnTextChanged property and do something like this:

Code:

sCurrentLevel=Text
bCheck=(Text == 'None')
sResult=(bCheck ? ' ' : sCurrentLevel)
Parent.NewLevelDisplay.text=sResult

where NewLevelDisplay is your new, visible text element. That should make it show the level as long as it's not equal to "None".

This is my actual lvl item:
Code:

<Text Activated="true" DynamicData="/GameData.Target.Level" Font="/TextStyles.SuperLarge.SuperLargeStyle" Location="12,42" MaxLines="1" Name="Level" OnTextChanged="sCurrentLevel=Text bCheck=(Text == 'None') sResult=(bCheck ? ' ' : sCurrentLevel) Parent.LevelTextObject.text=sResult" ScrollExtent="32,40" Size="32,32" TextAlignment="Center" TruncateElipsis="false" Visible="false">60</Text>
This is my NewTextObject:
Code:

<Text Activated="true" Font="/TextStyles.SuperLarge.SuperLargeStyle" Location="12,42" MaxLines="1" Name="LevelTextObject" ScrollExtent="32,40" Size="32,32" TextAlignment="Center" TruncateElipsis="false" Visible="false">60</Text>
Its still showing the None as a level. None isnt a level lol.

Thanks,
Draven

EQAditu 11-26-2010 09:59 AM

You're making a mistake of thinking that the script interpreter reads separated commands left to right. It reads things from right to left(so that expressions are evaluated before going into a variable) and then from the top line to the bottom.

Example 1:
var=1
var=2
var=3
var=4

Result is that var == 4

Example 2:
var=1 var=2 var=3 var=4
Result is that var == 1

Example 3:
var=1&#xD;&#xA;var=2&#xD;&#xA;var=3&#xD;&#xA;var=4
Result is that var == 4

Example 3 works as a single line because "&#xD;&#xA;" are XML entities for "\r\n". (A carriage return and a new line)

Draven_Caine 11-26-2010 02:49 PM

You lost me there, Is this possible if so where is my mistake?

Thanks,
Draven

Draven_Caine 11-26-2010 07:50 PM

Ok, i have it working kinda. None doesnt appear the first time a target something, but any other time it does. SO if i reload my ui and clik a node forsay, than no lvl number appears. If i target it a second time none reappears ... sigh ... so close :)

Any idea why it would ignore the "OnTextChanged" the 2nd, 3rd, ect times?

Thanks,
Draven

Drumstix42 11-26-2010 09:13 PM

I didn't test my code, so I can mess with it later when I have some spare time.

lordebon 11-26-2010 10:08 PM

Quote:

Originally Posted by Draven_Caine (Post 94543)
Ok, i have it working kinda. None doesnt appear the first time a target something, but any other time it does. SO if i reload my ui and clik a node forsay, than no lvl number appears. If i target it a second time none reappears ... sigh ... so close :)

Any idea why it would ignore the "OnTextChanged" the 2nd, 3rd, ect times?

Thanks,
Draven

Is it showing Level None again only after targeting another thing with no level, or even after targeting something with a level and then going back to something with none?

My guess would be that if it's happening when you're targeting successive things with level none then the OnTextChanged isn't firing because the window is just being hidden and shown -- I've never tested that trigger in that window, but it makes some sense since the text isn't changing even though the window may be hiding or other text (like the name) may be changing.

In that case, I'd try moving the script to a different handler (being sure to update the paths accordingly), something like the OnShow for the window itself maybe.

Draven_Caine 11-27-2010 12:11 AM

This problem is from targeting the same target 2 times in a row, even after moving the variable to a different window it still has the same issue, now if i target my pet (level 60) and than a node (level none) it changes nicely.

Any other ideas? ;)

Thanks,
Draven

P.S. I would like to thank everyone for being so nice and helping with this issue.

Drumstix42 11-27-2010 04:36 AM

Okay, this should work for you:

First, don't hide the actual Level text element, because DynamicData would just continue to try to show it anyway. The easy fix for that is to just change that element to have a size of Size=(0,0) which basically makes it invisible.

Secondly, here's a better method...
Code:

sCheck1=(Text == 'None')
sCheck2=(Text == 0)
sCond=(sCheck1 || sCheck2)
bCheck=(sCond ? ' ' : Text)
Parent.NewLevelDisplay.text=bCheck

Again, make sure the NewLevelDisplay has no dynamicdata attributed to it.

I tested it in game and it seems to work nicely. At first I just checked the level to be greater than 0, because None would fail that and it would show. But when you encounter mentored players, it would break it as well. So I just split the check up against level None or level 0.

Cheers.

Draven_Caine 11-27-2010 02:59 PM

Awesome work,
Now a few other parts are a little off but has close to the same issue.

When level is "none" the level doesn't show, which is great but I also need the label "Level" not to show. This is just a standard text field.
This could also be fixed if instead of the level not appearing if the level is "none" we have it parse "0".

Code:

Parent.NewLevelDisplay.text=bCheck bCheck=(sCond ? ' ' : Text) sCond=(sCheck1 || sCheck2) sCheck2=(Text == 0) sCheck1=(Text == 'None')
How do we change this slightly so that it parses Zero if it returns empty?

Thanks,
Draven

EQAditu 11-27-2010 03:48 PM

If you want the level label to disappear, put this as the last part of the script, with edits for the element name:
Parent.LevelTextElement.Visible=(sCond ? false : true)

If you want the indicator to display '0' instead of a blank character, change the following:
bCheck=(sCond ? ' ' : Text)
bCheck=(sCond ? '0' : Text)

Draven_Caine 11-27-2010 04:13 PM

Thanks to everyone, this part of my UI is now under-control.

I just made the none appear zero hehe. Off to finish this window, ill post a pic later for everyone.

Thanks,
Draven

Drumstix42 11-27-2010 07:32 PM

Cool glad ya got it how ya want. I implemented it into my Target/Implied windows as well, because I agree harvestables/etc shouldn't really have a level, especially "None". I didn't think level zero makes sense, so I just left it as is ;)

Draven_Caine 11-27-2010 10:23 PM

1 Attachment(s)
Ok,
Here is the screenshot after I finished the target window today. I'll have to explain the window a bit.

Legend:
  • Icons at the bottom - buffs and debuffs
  • The four icons above the buffs - quick buttons for afk, af, ect
  • Left-side hourglasses - your life and power (graphical and numerical)
  • Right-side hourglasses - your pet life and power (graphically and numerical). If you dont have a pet the brackets arent there.
  • Arrow above the window is your targets con.

All the info on the canvas (inside the frame) is your normal info (raid, AA, level, power, life from your target).

Thanks,
Draven

Draven_Caine 11-29-2010 07:26 PM

Drumstix, have you tested this against the crafting tables? I get "Unknown" as the lvl.

Drumstix42 11-29-2010 07:36 PM

Simple as adding a new line, and appending the check line:

sCheck1=(Text == 'None')
sCheck2=(Text == 0)
sCheck3=(Text == 'Unknown')
sCond=(sCheck1 || sCheck2 || sCheck3)
bCheck=(sCond ? '0' : Text)
Parent.NewLevelDisplay.text=bCheck

Draven_Caine 11-29-2010 08:44 PM

Quote:

Originally Posted by Drumstix42 (Post 94586)
Simple as adding a new line, and appending the check line:

sCheck1=(Text == 'None')
sCheck2=(Text == 0)
sCheck3=(Text == 'Unknown')
sCond=(sCheck1 || sCheck2 || sCheck3)
bCheck=(sCond ? '0' : Text)
Parent.NewLevelDisplay.text=bCheck

Thats it!! You fixed it right up for me. I can't thank you enough. Now to move it to the other fields hehe.

BTW what do you think of the screenshot of my UI target window?

Thanks,
Draven

Drumstix42 11-30-2010 04:42 AM

Looks good mate. I don't do much graphic design, but it's always nice to see new designs/layouts for the interface.

Draven_Caine 12-04-2010 03:07 PM

Ok, now how would I do this for an image? If all returns as "0" than use the image thing.

What I am looking for is if life percent returns 0% than print 0% (which is done) and parse the background image also.

EDIT: I just had to remove the /gamedata from the page to have the background parse as I wanted.

Thanks,
Draven

Draven_Caine 12-06-2010 09:34 PM

Ok found a related issue.

On the lvl when you target someone that is mentored how do I get rid of the part in the brackets 20 (43) ... it would be the brackets and the 43 i want gone.

Thanks,
Draven

EQAditu 12-07-2010 12:04 AM

Usually something like that would require string operations which we do not have, but you can probably use int() to get it right.

val -> "20 (43)"
int(val) -> 2043 (maybe)
val / 100 -> 20.43
int(val) -> 20


Though we would only want the 3rd line to happen if val > 100. So I guess something like...

val=int(val)
OVER=val &gt; 100
val2=val / 100
val=OVER ? val2 : val
val=int(val)

Drumstix42 12-07-2010 12:20 AM

I kinda doubt the int() function will parse the mentored number correctly, especially since there is a space, but it's worth a try.

EQAditu 12-07-2010 01:54 PM

Well, it worked that way for commas and such. It didn't truncate the value, it just removed the non-numerical values and concatenated the numbers together.

For instance, the location "12,34" becomes "1234". A well defined int parser would refuse to deal with with that, so I assume it just takes any numbers it finds regardless of what else is in there. It's worth a try at least.

EQAditu 12-07-2010 02:15 PM

Evidently the solution is easier if not as fun. Running int() on the above will simply return "20". No need for the rest of the logic.


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

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI