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 |
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 |
Quote:
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> 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> Thanks, Draven |
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) |
You lost me there, Is this possible if so where is my mistake?
Thanks, Draven |
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 |
I didn't test my code, so I can mess with it later when I have some spare time.
|
Quote:
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. |
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. |
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') 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. |
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') Thanks, Draven |
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) |
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 |
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 ;)
|
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:
All the info on the canvas (inside the frame) is your normal info (raid, AA, level, power, life from your target). Thanks, Draven |
Drumstix, have you tested this against the crafting tables? I get "Unknown" as the lvl.
|
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 |
Quote:
BTW what do you think of the screenshot of my UI target window? Thanks, Draven |
Looks good mate. I don't do much graphic design, but it's always nice to see new designs/layouts for the interface.
|
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 |
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 |
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) |
I kinda doubt the int() function will parse the mentored number correctly, especially since there is a space, but it's worth a try.
|
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. |
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