|
06-22-2008, 12:49 AM
|
A Griffon
|
|
Join Date: Jul 2005
Server: Unrest
Posts: 156
|
|
Concatenating?
Is there anyway to do this?
Code:
<Button Name="reset" OnPress="Temp=Parent.Input.Localtext
Parent. ## Temp ## .Visible=true" ScrollExtent="64,32" Size="64,32" Visible="false" />
Ideally I want to pull the number from input and show a window based on that number. I hope people understand what I'm trying to say.
|
06-22-2008, 01:11 AM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
I too was trying to do something like this in the past. It's possible to do what you want, but you have to go about it in a different way.
In other words, you can't directly navigate the tree like that (with a variable).
I'm not sure exactly what you're trying to do. But the way around is to make a second button, and then set the "tree location" as the OnPress of another button, and then trigger that button. We'll call that button "ButtonTrigger"
Code:
Temp=Parent.Input.LocalText
Parent.ButtonTrigger.OnPress=('Parent.')##(Temp)##('.visible=true')
Parent.ButtonTrigger.press=true
You can also do If statements, but that could get long if you had a lot of windows. Maybe if you wanted to hide some, when showing others. Just for example:
Code:
sString=Parent.Input.LocalText
bShowA=(Parent.WindowA.Name==sString)
bShowB=(Parent.WindowB.Name==sString)
bShowC=(Parent.WindowC.Name==sString)
Parent.WindowA.visible=(bShowA ? true : false)
Parent.WindowB.visible=(bShowB ? true : false)
Parent.WindowC.visible=(bShowC ? true : false)
Last edited by Drumstix42 : 06-22-2008 at 04:18 PM.
|
06-22-2008, 08:10 PM
|
Fetish Core author
|
|
Join Date: Jun 2005
Server: Crushbone
Posts: 2,667
|
|
Couldn't you also just use the OnHover to set the variables, and then use the OnPress to do it?
IE,
Code:
OnHover="Temp=Parent.Input.LocalText
Actn=('Parent.')##(Temp)##('.visible=true')" OnPress="Actn"
Note the syntax of that may not be 100% right, but I remember using something like that in the past where I set the variables on hovering the button and then acted on them on press.
|
06-22-2008, 08:59 PM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
OnHoverIn, yeah, that could work, too. Seems more prone to unintentional variable setting though. /shrug
|
06-23-2008, 01:44 AM
|
gm10-1
|
|
Join Date: Feb 2006
Posts: 6,479
|
|
Code:
OnHover="Temp=Parent.Input.LocalText
OnPress=('Parent.')##(Temp)##('.visible=true')"
For OnHoverIn you'd have to do it like the above, because you can't directly execute a parameter value in the OnPress. But as Drumstix said, seems like an error prone way to do it if you use it in code where timing matters.
Btw the non-OnHoverIn type concatenation to push variables to OnPress events is used all over ProfitUI, e.g. for the macro buttons on group/raid windows.
|
06-23-2008, 02:25 AM
|
A Griffon
|
|
Join Date: Jul 2005
Server: Unrest
Posts: 156
|
|
Thanks a lot guys for all the advice I'm fairly new to making more complex UI mods but its turning out really well so far. At the moment Im using it as a custom window though, can those not store location in your ui settings file? every time I Load up its hidden and pops up in the same location so I then have to move it. Is this something I'm doing wrong or just a side effect of custom windows?
|
06-23-2008, 04:57 AM
|
gm10-1
|
|
Join Date: Feb 2006
Posts: 6,479
|
|
Add this to the topmost <Page> node of your window:
eq2usescomwndcontrols="true"
|
06-23-2008, 04:46 PM
|
A Griffon
|
|
Join Date: Jul 2005
Server: Unrest
Posts: 156
|
|
Weird I thought I tried that, though it did fix my problems. Is there anyway to make it visible so I don't have to show window every time though? And secondly would this statement be correct?
sString=5
Parent.WindowA.visible=(5==sString)
Setting the windows visibility to true?
|
06-23-2008, 05:28 PM
|
A Forest Scavenger
|
|
Join Date: Dec 2004
Server: Guk
Posts: 16
|
|
I've been wondering about window visibility as well... and from the research i've done over the last few days it seems like they (SOE) have never added in a convenient way to do this.
the work around is to put a show.window command in to another window that the client does automatically open in the OnShow object. The other caveat is that you must put it in to a window that receives dynamic data updates.
for example, I chose the player window, since it is almost always receiving constant data updates, so when that window is "shown" by the client, then the OnShow event triggers and it will then open up the window you want.
I really don't understand why Sony hasn't added in a simple property that allows us to make new windows and allow them to be visible by default. it wouldn't be that hard IMO.
|
06-23-2008, 06:24 PM
|
A Griffon
|
|
Join Date: Jul 2005
Server: Unrest
Posts: 156
|
|
Thanks a lot sounds annoying but an easy fix Still not understanding if statements though. Well at least I cant get them to work :/
I'm trying to compare a local text that stores a number to another value. so
temp_a=parent.1.localtext (lets say this is -1)
temp_b=Parent.2.localtext (lets say this is 2)
Btemp=(temp_a!=temp_b)
parent.window.visible=Btemp
|
06-23-2008, 08:16 PM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
Just because I like to, I use "s" for Strings, and "b" for Booleans, and "i" for integers.
Code with comments:
This sets the variable (obviously):
sTemp_a is now 2
Compare two strings:
Code:
bShowTemp_a=(2==sTemp_a)
bShowTemp_a is now set to TRUE, because 2 does infact equal sTemp_a (2)
Set the window to what it should be:
Code:
Parent.WindowName.visible=(bShowTemp_a ? true : false)
since our Boolean variable came out to be TRUE, the window visible will be set to true.
So just replace "2" with your input variable, and the WindowName with the correct variable.
Last edited by Drumstix42 : 06-23-2008 at 08:21 PM.
|
06-24-2008, 11:17 AM
|
Slayer of clock cycles
|
|
Join Date: Nov 2004
Server: Oasis
Posts: 3,464
|
|
Keep in mind that if the window has never been initialized, setting the visible properties to true will not make the window visible. You have to initialize the window 1st by issuing the Show_Window command first. This is mostly only needed on custom window as the game initializes most of default windows.
|
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 06:40 AM.
|
|