EQ2Interface.com
Search Downloads


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

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 11-25-2010, 11:07 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default 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
Reply With Quote
  #2  
Unread 11-26-2010, 12:11 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

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".
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #3  
Unread 11-26-2010, 01:06 AM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

Quote:
Originally Posted by Drumstix42 View Post
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

Last edited by Draven_Caine : 11-26-2010 at 01:15 AM. Reason: Fixed an error that the web created.
Reply With Quote
  #4  
Unread 11-26-2010, 09:59 AM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

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)
Reply With Quote
  #5  
Unread 11-26-2010, 02:49 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

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

Thanks,
Draven
Reply With Quote
  #6  
Unread 11-26-2010, 07:50 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

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

Last edited by Draven_Caine : 11-26-2010 at 08:40 PM.
Reply With Quote
  #7  
Unread 11-26-2010, 09:13 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

I didn't test my code, so I can mess with it later when I have some spare time.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #8  
Unread 11-26-2010, 10:08 PM
lordebon lordebon is offline
Fetish Core author
This person is a EQ2Map developer.
Featured
 
Join Date: Jun 2005
Server: Crushbone
Posts: 2,667
Default

Quote:
Originally Posted by Draven_Caine View Post
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.
__________________
Reply With Quote
  #9  
Unread 11-27-2010, 12:11 AM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

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.
Reply With Quote
  #10  
Unread 11-27-2010, 04:36 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

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.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>

Last edited by Drumstix42 : 11-27-2010 at 04:45 AM.
Reply With Quote
  #11  
Unread 11-27-2010, 02:59 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

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

Last edited by Draven_Caine : 11-27-2010 at 03:29 PM.
Reply With Quote
  #12  
Unread 11-27-2010, 03:48 PM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

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)
Reply With Quote
  #13  
Unread 11-27-2010, 04:13 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

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
Reply With Quote
  #14  
Unread 11-27-2010, 07:32 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

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
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #15  
Unread 11-27-2010, 10:23 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

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
Attached Thumbnails
Click image for larger version

Name:	Target.png
Views:	297
Size:	48.6 KB
ID:	7564  

Last edited by Draven_Caine : 11-27-2010 at 10:25 PM.
Reply With Quote
  #16  
Unread 11-29-2010, 07:26 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

Drumstix, have you tested this against the crafting tables? I get "Unknown" as the lvl.
Reply With Quote
  #17  
Unread 11-29-2010, 07:36 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

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
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #18  
Unread 11-29-2010, 08:44 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

Quote:
Originally Posted by Drumstix42 View Post
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
Reply With Quote
  #19  
Unread 11-30-2010, 04:42 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

Looks good mate. I don't do much graphic design, but it's always nice to see new designs/layouts for the interface.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #20  
Unread 12-04-2010, 03:07 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

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

Last edited by Draven_Caine : 12-04-2010 at 03:17 PM. Reason: Found the fix
Reply With Quote
  #21  
Unread 12-06-2010, 09:34 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

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
Reply With Quote
  #22  
Unread 12-07-2010, 12:04 AM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

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)
Reply With Quote
  #23  
Unread 12-07-2010, 12:20 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

I kinda doubt the int() function will parse the mentored number correctly, especially since there is a space, but it's worth a try.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #24  
Unread 12-07-2010, 01:54 PM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

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.
Reply With Quote
  #25  
Unread 12-07-2010, 02:15 PM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

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.
Reply With Quote
Reply



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 12:21 AM.


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