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)

Eloa 01-01-2005 12:56 PM

Anyone know about Event Properties: OnActivate, OnDisable, ...?
 
Since the guide is almost moot on the subject I was just wondering if anyone has any information on how to work with these. Specifically how to get them to control another object. Say my tree looks like this:


Tier1
+Tier2
++Tier3


I have figured out that I can go into Tier3 and put in on the OnActivate [opacity=0] and it will change the Tier3 opacity. Well I want to say, put in the OnActivate for Tier3, I want it to change the opacity of Tier1, or 2, any ideas on this? I've tried a few different ways with no luck at all. Thanks in advance.

RECAP: What we have figured out up until post #28
"/" commands work.
ie: Onpress: /dance (will make you dance)

"/" commands that require parameters need special formatting.
OnPress="say='this is a test' say='this is a test'"

You can control other objects from another.
ie:
root
+mainhud
++Map
+++Somemapelement
.
working with somemap_element and putting in
OnPress: Parent.Size="2,2" (will make Map size 2,2)
OnPress: Parent.Parent.Opacity="0" (will make mainhud invisible)
OnPress: Parent.Parent.Player.Healthbar.Opacity="0" (will make healthbar in Player invisible)

You cannot Parent.Parent... up to the root level
ie: In mainhud.player you cannot use Parent.Parent.Inventory.Market.Blah

Update with discovery by Zonx:
Instead simply ignore the module level. Parent.Market.Blah



You can use math commands.
You can't do math on things with multiple values (Size, for instance)
Math works on text objects (though it makes it show 3 decimal places whether you like it or not; 6+1=7.000)
If you're using math, you need to make sure you're using the full reference.
ie:
OnPress="parent.BLARG.opacity=(parent.BLARG.opacity-0.05)" works.
OnPress="parent.BLARG.opacity=(opacity-0.05)" checks the opacity of the button you're pressing, not BLARG.

You can't change the Opacity values of windows with eq2usescomwndcontrols="true", the Window Settings opacity value will instantly go back into effect.
You can use Visible to show/hide the frame/titlebar/backdrop, though.

You can use ! to reverse Boolean values... OnPress="parent.Test.visible=(!parent.Test.visible)" works great.

How to do IF statements.
OnPress="Param=((parent.Test.visible)==(true))" Sets Param to the true/false value of the statement. ==, >, and < operations are supported. !=, <=, and >= are not, but you can get around them using ! on the statement.

Various changes to bring up to date. -Deathbane

Deathbane27 01-02-2005 04:40 AM

We were discussing this here:
http://www.eq2interface.com/forums/showthread.php?t=806

But all we could get it to do was post single-word slash commands like /toggleshowadventurexp and /showinventory...

So THAT is why = had such an interesting property... :p

Working with this now, I'll let you know what I find.

Deathbane27 01-02-2005 06:05 AM

You can do math! :D

Code:

<Button Name="WEE" Opacity="0.750" OnPress="opacity=(1-opacity)" Size="100,40" Style="/ButtonStyles.text_button_default">WEE</Button>
Makes a button that switches between 75% and 25% opacity every time you click it.

Still working on referencing other UI elements. (My test window has 6 buttons so I can do 6 tests per UI reload, might want to do something similar.)

Please use this thread to discuss UI element scripts. Use the other thread for attempts to get multi-word slash commands working.

Deathbane27 01-02-2005 06:15 AM

If you're using this to change Text/LocalTooltip attributes, you can use single quotes to put in spaces. This still doesn't help execute slash commands, though. (Tried OnPress="OnPress='/mood happy'". Clicked it second time and it did /mood then /happy, as usual.)

Deathbane27 01-02-2005 06:26 AM

(Buttons are in Player window. Buttons "WEE" through "WEE4" try to control button "BLARG".)

Following doesn't work: (OnPress="" implied)


BLARG.Opacity=0
/BLARG.Opacity=0
.BLARG.Opacity=0
\BLARG.Opacity=0
MainHUD.Player.BLARG.Opacity=0
root.MainHUD.Player.BLARG.Opacity=0
/MainHUD.Player.BLARG.Opacity=0
/root.MainHUD.Player.BLARG.Opacity=0
\MainHUD.Player.BLARG.Opacity=0
../BLARG
../
..

Replacing the period between BLARG and Opacity with any of the following characters also does not work:
: -


+ kills everything before it and makes it refer to itself, unless you start with /


If at first you don't succeed... blame Microsoft!



You can change multiple attributes at once. OnPress="opacity=0.75 size=200,50 text='Clicky time!' dance" does successfully change the opacity, size, and text, and make your character dance.

Eloa 01-02-2005 06:56 AM

I myself tried many of those, but didn't document which ones as I was just in a mad frustration of throwing weird things in. This would be such a useful property if we can just figure out how to use it, that is if it is possible to do this with it. Thanks for trying and I'll keep you up to date with any discoveries.

--edit--
I do remember I tried
eq2ui.MainHUD.Player.BLARG.Opacity=0
eq2ui.xml.MainHUD.Player.BLARG.Opacity=0

Deathbane27 01-02-2005 07:05 AM

FOUND IT!!!!!!!!!!!!!!!!!!


Parent.Element.Property=Value

So to change the opacity of HealthBar, which is on the same page as the button you press, you use:

OnPress="Parent.HealthBar.Opacity=0.250"

WOOT!

BUWAHAHA!!! I've got a button in my Player window that changes the color of my Compass!

:nana: :nana: :nana: :nana: :nana: :nana: :nana: :nana:

Edit: And you can use Parent.Parent to refer to two pages above you, etc.

Deathbane27 01-02-2005 07:20 AM

Hmm.

There doesn't appear to be any way to reference "root", and thus you can't reference anything in Inventory from MainHUD, for example. Still looking.

Talyns 01-02-2005 07:36 AM

WOW!! What devolpments.. Too bad I'm dead tired and need sleep..

HowAbout Parent.Parent.

Eloa 01-02-2005 07:38 AM

I can't believe it, that is awesome...trying it with my app right now....

Deathbane27 01-02-2005 07:40 AM

Tried that, if you Parent past MainHUD it doesn't do anything.

(If Parent refers to MainHUD.Player, and Parent.Parent refers to MainHUD, then Parent.Parent.Parent.Inventory should refer to Inventory, but doesn't.)

Nuts, you can't do math on things with 2 values (Size, for instance). I was hoping for a hotkey bank with scaling buttons. :p Nor Boolean values. (1-true isn't false, sadly.) (EDIT: Use ! to invert true/false.)

Can't change the Opacity values of windows with eq2usescomwndcontrols="true", the Window Settings opacity value will instantly go back into effect. You can use Visible to show/hide the frame/titlebar/backdrop, though. :D

Talyns 01-02-2005 07:50 AM

Quote:

Originally Posted by Deathbane27
Tried that, if you Parent past MainHUD it doesn't do anything.

(If Parent refers to MainHUD.Player, and Parent.Parent refers to MainHUD, then Parent.Parent.Parent.Inventory should refer to Inventory, but doesn't.)

Nuts, you can't do math on things with 2 values (Size, for instance). I was hoping for a hotkey bank with scaling buttons. :p Nor Boolean values. (1-true isn't false, sadly.)

Can't change the Opacity values of windows with eq2usescomwndcontrols="true", the Window Settings opacity value will instantly go back into effect. You can use Visible to show/hide the frame/titlebar/backdrop, though. :D

Gah.. Now I gotta play with this stuff!! Guess I'm not going to sleep tonight :p

Deathbane27 01-02-2005 07:57 AM

My dearest Insomniac,

Add OnHide="visible=true" to the Clock window.

Your annoying sidekick-wannabe,
Deathbane

:D



Unfortunately, this doesn't work on custom windows. I can't even get OnPress to work. :( Was hoping I could get Ellyanna's stat window to autoload or at least OnHoverIn on something...

We still need to get multiword slash commands working!

Eloa 01-02-2005 08:03 AM

Der.........

Eloa 01-02-2005 08:11 AM

You know this is likely to be one of the biggest discoveries of the UIBuilder in quite a long while...Congrats Deathbane :)

Deathbane27 01-02-2005 08:13 AM

Bah, you give me too much credit. We were all poking sharp sticks into the darkness, I just hit the beast's eye first. :D

Eloa 01-02-2005 08:16 AM

Hmmm....Just discovered a small prob, so Mr. UI man maybe you have a solution for it. I have a Tabpane with the names of all the maps that I have, when I resize the window smaller the tabs stick out the end. You messed with this at all or maybe with our newfound knowledge can think of something real quick to do it something like the UIBuilder itself does with all the tabs (make them scrollable)?

Deathbane27 01-02-2005 08:25 AM

Hmm...

I was thinking you could make buttons with OnPress="Parent.TabPage.Location=(Locaiton-5,Location)" to scroll left or right, but I can't get math to work on coordinate data.

What I'm thinking is set up 3 location buttons and 2 sub-pages. Have the first sub-page be a thin strip, and within that a strip that's too wide to fit inside it. Have the tabs in the second sub-page. Use the buttons to alter the location of that sub-page in such a way that different tabs are visible in the window with each button.

That's the best I can come up with at the moment.

Eloa 01-02-2005 08:26 AM

Gotcha, I think that should work just fine. Thanks

Talyns 01-02-2005 08:34 AM

Quote:

Originally Posted by Deathbane27
Hmm...

I was thinking you could make buttons with OnPress="Parent.TabPage.Location=(Locaiton-5,Location)" to scroll left or right, but I can't get math to work on coordinate data.

What I'm thinking is set up 3 location buttons and 2 sub-pages. Have the first sub-page be a thin strip, and within that a strip that's too wide to fit inside it. Have the tabs in the second sub-page. Use the buttons to alter the location of that sub-page in such a way that different tabs are visible in the window with each button.

That's the best I can come up with at the moment.

Only problem is without an if statment there's no way to tell it to stop scrolling in either direction.. Plus the math thing...

I hope since theres math statements there are boolean statements like
== (equals), != (doesn't equal)...

Too tired to play around with it.. Good luck guys, have fun..

Deathbane27 01-02-2005 08:40 AM

Quote:

Originally Posted by Talyns
Only problem is without an if statment there's no way to tell it to stop scrolling in either direction..

If the user can't figure out when to stop scrolling by the blank space that starts showing up when he clicks too many times... :p


Side note: If you're using math, you need to make sure you're using the full reference.

OnPress="parent.BLARG.opacity=(parent.BLARG.opacity-0.05)" works.
OnPress="parent.BLARG.opacity=(opacity-0.05)" checks the opacity of the button you're pressing, not BLARG.

Quote:

Originally Posted by Talyns
I hope since theres math statements there are boolean statements like
== (equals), != (doesn't equal)...

Yeah, you can use ! to reverse Boolean values... OnPress="parent.Test.visible=(!parent.Test.visible)" works great.

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.

Talyns 01-02-2005 09:29 AM

Gah, this is on my mind, can't sleep.. Here's something that is nice to know.. You don't have to load eq2 to test script on buttons it works in UIBuilder (in play mode) :)

Deathbane27 01-02-2005 09:45 AM

Math works on text objects (though it makes it show 3 decimal places whether you like it or not; 6+1=7.000) so I think I could actually make a little minigame window with a running score total if I wanted. :D

Just need to figure out what kind of game I can do without any if/then statements. :p I was thinking one of those puzzles where you press a button, and it and all the bordering buttons change states. That part would be doable, but there'd be no way to tell when to advance to the next stage...

Deathbane27 01-02-2005 05:09 PM

Nuts. I was hoping to fix the 2/3 bag size problem, but none of the events are triggered by the presence or lack thereof of the individual slots.

Dolby 01-02-2005 05:37 PM

Great work guys, very interesting find. I'm stuck at work but want to get home and start playing with this. See what practical uses can come from this.


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

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