EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   Help!?!?! (https://www.eq2interface.com/forums/forumdisplay.php?f=24)
-   -   Concatenating? (https://www.eq2interface.com/forums/showthread.php?t=11197)

samejima 06-22-2008 12:49 AM

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.

Drumstix42 06-22-2008 01:11 AM

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)


lordebon 06-22-2008 08:10 PM

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.

Drumstix42 06-22-2008 08:59 PM

OnHoverIn, yeah, that could work, too. Seems more prone to unintentional variable setting though. /shrug :rolleyes:

gm9 06-23-2008 01:44 AM

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.

samejima 06-23-2008 02:25 AM

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?

gm9 06-23-2008 04:57 AM

Add this to the topmost <Page> node of your window:
eq2usescomwndcontrols="true"

samejima 06-23-2008 04:46 PM

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?

Wyynd 06-23-2008 05:28 PM

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.

samejima 06-23-2008 06:24 PM

Thanks a lot sounds annoying but an easy fix :D 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

Drumstix42 06-23-2008 08:16 PM

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):
Code:

sTemp_a=2
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.

Landiin 06-24-2008 11:17 AM

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.


All times are GMT -5. The time now is 12:52 PM.

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