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.

Talyns 01-03-2005 03:44 AM

Quote:

Originally Posted by Talyns
I was able to create a chat window that Has Minimize and Restore Buttons..
Also added a button to toggle the input area on and off..
None of it saves when you log out though.. When you log in all chat windows will look normal again.. If you had a minimized window it will be minimum size..

I think it's a good idea NOT to remove the input bar or minimize your mainchat window (IE 1st chat window).. You will no longer be able to bring up the chat input with enter, or '/' , etc..

When the input bar is missin; to resize the window from the bottom you have to grab where the bottom frame would be on the input bar..

this is what the code looks like (Will only work in my window though)

ChatInputToggle:
Code:

Parent.Parent.InputVisible.Visible=(!Parent.Parent.InputVisible.Visible)
Parent.Parent.ChatInput.Visible=Parent.Parent.InputVisible.Visible
Parent.Parent.WC_Frame.WC_ChatInputFrame.Visible=Parent.Parent.InputVisible.Visible
Parent.Parent.WC_Frame.NewImage.Visible=Parent.Parent.InputVisible.Visible
Parent.Parent.WC_Backdrop.InputBack.Visible=Parent.Parent.InputVisible.Visible
Parent.Parent.DefaultChannelButton.Visible=Parent.Parent.InputVisible.Visible

MinimizeButton:
Code:

Visible=false
Parent.Restore.Visible=true
Parent.Hide.Visible=false
Parent.Parent.DefaultChannelButton.Visible=false
Parent.Parent.ChatDisplay.Visible=false
Parent.Parent.ChatInput.Visible=false
Parent.Parent.WC_Frame.Visible=false
Parent.Parent.WC_Backdrop.Visible=false
Parent.MinBorder.Visible=true
Parent.MaxBorder.Visible=false
Parent.Parent.InputVisible.Size=Parent.Parent.Size
Parent.Parent.MinimumSize=160,20
Parent.Parent.Size=160,20
Parent.Parent.UserResizable=false

Restore:
Code:

Visible=false
Parent.Minimize.Visible=true
Parent.Parent.DefaultChannelButton.Visible=true
Parent.Parent.ChatDisplay.Visible=true
Parent.Parent.ChatInput.Visible=Parent.Parent.InputVisible.Visible
Parent.Parent.WC_Frame.Visible=true
Parent.Parent.WC_Backdrop.Visible=true
Parent.MinBorder.Visible=false
Parent.MaxBorder.Visible=false
Parent.Parent.MinimumSize=256,160
Parent.Parent.Size=Parent.Parent.InputVisible.Size
Parent.Parent.UserResizable=true
Parent.Hide.Visible=true

If you want to check it out look here:
http://www.eq2interface.com/forums/s...&postcount=117
You'll need TabletsII_Beta_5..

edit: Hmm can't figure out what that odd spacing is.. Doesn't look that way in the edit messageBox ..

Eloa 01-03-2005 04:29 AM

Not a property:
OnResize :mad:

insomniac 01-03-2005 04:34 AM

I somehow totally missed this thread till deathbane pointed it out to me on chat (chat btw, is very cool and more people should come play..anyway). OnHide="visible=true" is in my clock window and it rocks (thanks death!) I am still stuck on practial applications for this stuff, and a recap would be nice, its alot of stuff to go through.

when you do something like OnPress="Parent.HealthBar.Opacity=0.250" what says "healthbar" will do anything? is it the name= of the object? is there any shot of mapping this to a keyboard press instead of a button?

Eloa 01-03-2005 04:53 AM

Your recap is on the first post.

Eloa 01-03-2005 05:08 AM

I doubt that it'll be doable with a keyboard button with what we know now. I honestly doubt it'll be doable at all.

Found any way to get plain text to react to a click or onpress? That'd be pretty helpful

Deathbane27 01-03-2005 09:45 AM

Quote:

Originally Posted by insomniac
I somehow totally missed this thread till deathbane pointed it out to me on chat (chat btw, is very cool and more people should come play..anyway).

Update your sig with the correct server address. ( irc://mesra.dal.net:7000/eq2interface ) And make a sticky. :p

Quote:

when you do something like OnPress="Parent.HealthBar.Opacity=0.250" what says "healthbar" will do anything? is it the name= of the object?
Yes, it's the Name= portion.

Quote:

is there any shot of mapping this to a keyboard press instead of a button?
Tried, no luck. It doesn't seem to want to do anything that's not already in that file.


Quote:

Originally Posted by Talyns
I was able to create a chat window that Has Minimize and Restore Buttons.
Also added a button to toggle the input area on and off...

Sweet, you beat me to it. :D That's the kind of useful stuff I was hoping for, glad it's already begun.

Talyns 01-03-2005 09:48 AM

Check out my beta thread I added a 4 way switch.. Although I kinda broke the restore and minimize buttons :)

Deathbane27 01-03-2005 10:20 AM

By the way, it's perfectly acceptable to have an event change its own action.

OnPress="parent.size=100,100 OnPress='parent.size=200,200'"

First time you press that button, it'll go half size. Second press it will restore. Problem is it won't reset the second time. To get around that? DUMMY VALUES!

OnPress="parent.size=500,400 onpress=press2"
press1="parent.size=500,400 onpress=press2"
press2="parent.size=147,280 onpress=press1"


That button will toggle the parent page between the two sizes every time you press it for all eternity. :D (Or until your mouse breaks.)

That auto-showing clock I figured out for Insomniac? Problem is you can never close it with /hide_window. :p

OnHide="visible=true" OnHoverIn="OnHide=' ' "

THAT version has the clock show up on initial load, then has it ignore future OnHide events when you put the mouse over it so you can close it with /hide_window if you wish. (I tried blocking the OnHide in OnShow or OnHide, but it appears to call that two or three times during load. Clock window is extra stubborn. :mad: )

Deathbane27 01-03-2005 10:33 AM

Talyns: Thanks for finding out that you can put newlines within the script quotes. Putting them between elements causes the ui to break. :p

Talyns 01-03-2005 10:38 AM

In case you didn't know:
If you double click say, OnPress in UIBuilder.. Not the value the label.. A box will open that will let you edit in it :D
(A value must be present for it to work)

Eloa 01-03-2005 11:06 AM

So what you did having that button change back and forth is basically creating variables right? or no?

Talyns 01-03-2005 11:14 AM

That's what I would call it :)
I used something similar to rearrange the chat window..
I made my varibles to hold different sizes out of pages, that way all sizes change when window is sized..

Deathbane27 01-03-2005 11:22 AM

Quote:

Originally Posted by Eloa
So what you did having that button change back and forth is basically creating variables right? or no?

Talyns used 4 seperate buttons in the same place, each one hiding itself and making the next one visible. (But as you can see he did use variables to save the current sizes... need to take a look at this.)

But you can do variables just fine too to do it all with one button if you want.

Edit: Bah.

insomniac 01-03-2005 03:31 PM

cool eloa, thanks for the recap.
as for parenting up to the root.. has anyone tried it dynamicdata style?
inventory.inventory.buttonthingy.size?

Agathorn 01-09-2005 10:19 PM

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?


All times are GMT -5. The time now is 06:44 PM.

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