|
11-25-2010, 11:07 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
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
|
11-26-2010, 12:11 AM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
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".
|
11-26-2010, 01:06 AM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
Quote:
Originally Posted by Drumstix42
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.
|
11-26-2010, 09:59 AM
|
|
A Griffon
|
|
Join Date: Mar 2005
Server: Permafrost
Posts: 256
|
|
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
var=2
var=3
var=4
Result is that var == 4
Example 3 works as a single line because "
" are XML entities for "\r\n". (A carriage return and a new line)
|
11-26-2010, 02:49 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
You lost me there, Is this possible if so where is my mistake?
Thanks,
Draven
|
11-26-2010, 07:50 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
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.
|
11-26-2010, 09:13 PM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
I didn't test my code, so I can mess with it later when I have some spare time.
|
11-26-2010, 10:08 PM
|
Fetish Core author
|
|
Join Date: Jun 2005
Server: Crushbone
Posts: 2,667
|
|
Quote:
Originally Posted by Draven_Caine
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.
__________________
|
11-27-2010, 12:11 AM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
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.
|
11-27-2010, 04:36 AM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
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.
Last edited by Drumstix42 : 11-27-2010 at 04:45 AM.
|
11-27-2010, 02:59 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
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.
|
11-27-2010, 03:48 PM
|
|
A Griffon
|
|
Join Date: Mar 2005
Server: Permafrost
Posts: 256
|
|
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)
|
11-27-2010, 04:13 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
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
|
11-27-2010, 07:32 PM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
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
|
11-27-2010, 10:23 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
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
Last edited by Draven_Caine : 11-27-2010 at 10:25 PM.
|
11-29-2010, 07:26 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
Drumstix, have you tested this against the crafting tables? I get "Unknown" as the lvl.
|
11-29-2010, 07:36 PM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
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
|
11-29-2010, 08:44 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
Quote:
Originally Posted by Drumstix42
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
|
11-30-2010, 04:42 AM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
Looks good mate. I don't do much graphic design, but it's always nice to see new designs/layouts for the interface.
|
12-04-2010, 03:07 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
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
|
12-06-2010, 09:34 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
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
|
12-07-2010, 12:04 AM
|
|
A Griffon
|
|
Join Date: Mar 2005
Server: Permafrost
Posts: 256
|
|
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 > 100
val2=val / 100
val=OVER ? val2 : val
val=int(val)
|
12-07-2010, 12:20 AM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
I kinda doubt the int() function will parse the mentored number correctly, especially since there is a space, but it's worth a try.
|
12-07-2010, 01:54 PM
|
|
A Griffon
|
|
Join Date: Mar 2005
Server: Permafrost
Posts: 256
|
|
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.
|
12-07-2010, 02:15 PM
|
|
A Griffon
|
|
Join Date: Mar 2005
Server: Permafrost
Posts: 256
|
|
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.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:17 AM.
|
|