EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   Anyone know about Event Properties: OnActivate, OnDisable, ...? (https://www.eq2interface.com/forums/showthread.php?t=845)

Deathbane27 01-09-2005 10:30 PM

Quote:

Originally Posted by Agathorn
How far "back out" can I go?

If I have a button that exists in say Root.MainHud.StartButton can I adjust properties in say Root.MainHud.Hotkey -- not really what I want to do but just examples.. IE Can I reference and modify the properites of a different window within the same overall page, in this case MainHud.

Something like this in the startbutton window: Parent.Parent.Hotkey.Property=Value?

Yes, you can do references between windows within MainHUD, Inventory, Etc. all you want, just be sure not to go all the way back to root.

Agathorn 01-09-2005 10:42 PM

Thank You.

wpgreywolf 02-06-2005 06:00 PM

Found a decent use for this
 
I added a Character Button onto my Persona Page, that toggles MainHUD.Character on/off

Here is the code i added

<Button LocalText="Character" Location="0,132" Name="CharacterButton" OnPress="parent.parent.parent.parent.Character.visible=(!parent.parent.parent.pa rent.Character.visible)" ScrollExtent="73,27" Size="73,27" Style="/t_Styles.DefaultButton">Character</Button>

I added this code right before

<Button LocalText="Cancel"......

this was done on the TabletsII UI so your spacing may be different

Quib 02-06-2005 06:26 PM

I'm happy to see ! reverses boolean values. Nice discovery!

Quib

Deathbane27 02-06-2005 07:04 PM

Quote:

Originally Posted by Quib
I'm happy to see ! reverses boolean values. Nice discovery!

Quib

That's the problem with these chaotic discovery threads... that was on top of page 2.

Quib 02-06-2005 08:01 PM

Quote:

Originally Posted by Deathbane27
That's the problem with these chaotic discovery threads... that was on top of page 2.

Bah! Figures, very nice to know though. Will try and keep ! in mind when working on stuff.

Quib

Drumstix42 02-06-2005 11:36 PM

Quote:

Originally Posted by Deathbane27
Unfortunately I don't think there's an "if" statement. OnPress="if(parent.Test.visible==true)visible=false" hides the button whether Test is visible or not.

I haven't read through all of this thread but it just came to my attention this post... I was just thinking... heh (amazing I know)

There's another way to do IF statements in coding. Maybe there's some variation that'll work with the EQ2 XML...

Code:

OnPress="parent.Test.visible==true?visible=false:visible:true"
I don't have anything to test it out... but maybe someone could try it.

Or maybe:

Code:

OnPress="(parent.Test.visible==true)?(visible=false):(visible:true)"
(I don't really have a grasp on where to use parenthasis in the EQ2 XML coding) *note* I dunno what's up with the random spaces, they're just showing that way /shrug

Quib 02-07-2005 12:20 AM

I'm pretty sure the spaces are a flaw in the [CODE} tag, every X number of characters on one line, it adds a space.

I haven't found EQ2 to use parenthesis in any rational or logical way. Half the time I can leave them out and they won't matter, and using them doesn't seem to change the order math calculations occur; an example:
value=((2+3)*4)
results in value being 14 (3 times 4 plus 2) instead of 20 (5 times 4).

At least this is what I encountered when I was making my Relative DPS Calculator.

Quib

Deathbane27 02-07-2005 01:16 AM

I've only found parenthesis useful for letting the game know you mean a "variable" instead of the text that represents it.

Example: The text of the object Foo is "Your Mom"

parent.label.text=parent.Foo.text makes the label say "parent.Foo.text"

parent.label.text=(parent.Foo.text) makes the label say "Your Mom"

Or at least that's how I think it goes. I've always used the parenthesis after something didn't work without them, and I forget what.

Quib 02-07-2005 01:23 AM

I use (basically) parent.label.text=parent.Foo.text and my label text would always read Your Mom. If I wanted the label to show "parent.label.text=parent.Foo.text" I'd have to do parent.label.text='parent.Foo.text'

This is assuming this code is used in an OnEvent.

Quib

Selae 02-07-2005 10:22 AM

ok pardon my lack of knowledge, I try to pull what I can read and what I can see from examples to get the jist of things... lets see if I kinda get this...

If I wanted a button on a page that hides that page's parent and opens another page and its parent, would the following be on the right track?

OnPress="parent.playerstats.visible=false 'parent.Personatwo.visible=true'"

where the structure is like:
root>MainHUD>Persona>playerstats/Personatwo

and the button (and its reversed counterpart) is on the playerstats and Personatwo pages trying to hide playerstats and reveal Personatwo.

-Selae

Quib 02-07-2005 10:35 AM

Quote:

Originally Posted by Selae
OnPress="parent.playerstats.visible=false 'parent.Personatwo.visible=true'"

where the structure is like:
root>MainHUD>Persona>playerstats/Personatwo

and the button (and its reversed counterpart) is on the playerstats and Personatwo pages trying to hide playerstats and reveal Personatwo.

Dump the apostrophes; you only need those if declaring a new value that contains spaces (like value='value with spaces'). Other than that, looks good to me.

Quib

Drumstix42 02-07-2005 01:07 PM

So besides the whole parenthasis thing, did anyone try what I suggested?

Sixes 04-03-2005 07:13 AM

Quote:

Originally Posted by Eloa
OnPress="parent.BLARG.opacity=(parent.BLARG.opacity-0.05)" works.

Does anyone know if it's possible to get a second level of indirection? For example:
<Text Name="Foo">BLARG</Text>
...
OnPress="parent.Blarg.opacity=(parent.(parent.Foo.Text).opacity-0.05)"

I've not been able to make this work but I may be missing something. At least I hope I am.

Sixes

Zonx 04-03-2005 02:05 PM

So far noone has gotten any form of concatination or nested variables working. This includes paths with variable segments.

In all tests I've run, it either reads the entire thing as a string with no variable interpritation at all, or it reads the first portion as a variable clipped where the second variable begins.


All times are GMT -5. The time now is 02:01 PM.

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