EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > XML Modification Help & Info

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 03-27-2011, 04:09 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default Onset varible

I have an option in my collections window that when you hit the add button it adds the collectible to the collection (normal) and than auto closes the window.

Now instead of having this on the add button all the time, i wish to add a checkbox at the bottom of the window that sets this variable.

OnSet=Parent.Parent.CollectionTemplate.AddButton.OnPress='hide_window Journals.JournalsQuest'
UnSet=Parent.Parent.CollectionTemplate.AddButton.OnPress='' (blank so it removes the behavior)

This is all done thru the default window so the hierarchy and such is normal other than the on added checkbox i added at the bottom, which is at the same location as the other 2 checkboxes.

Now my issues is the checkbox doesnt change the OnPress varible when in-game. What am I doing wrong here?

Thanks,
Draven
Reply With Quote
  #2  
Unread 03-27-2011, 04:16 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Send a message via AIM to Drumstix42 Send a message via MSN to Drumstix42 Send a message via Yahoo to Drumstix42
Default

I've found that modifying default buttons within the UI is a bad idea. Sometimes it'll work, and sometimes it won't. Other times you'll get unexpected results.
I like to think that these buttons already have "OnPress" events and adding another is sometimes a bad idea.

What I do is clone whatever "default UI" button it is I'm working with and call it another name and place it ontop of that button. I put my code I need to use in that button and make the final step of the code to trigger the "default" button. In this case it would be the add button.

With the code you're trying to do, I suggest just making 2 different buttons that get toggled visibly over the button. One button would trigger the Add button and auto close, the other would just trigger the Add button. You're check box could control which one is showing.

Cheers.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #3  
Unread 03-27-2011, 04:20 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

I was thinking of that also but two problems come to mind
  • What variable should i use on the new buttons?
  • Adding the OnPress to the default button works fine, its just doesn't change dynamically in-game, it just changes each time i load the UI.

I am working on a diffrent part of the UI right now, i'll try the 2 button idea in a minute or so and report back sir.

Thanks,
Draven
Reply With Quote
  #4  
Unread 03-27-2011, 04:24 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

I changed the name of the button and it doesn't work now. First off its always visible and when you press the button the collectible item isn't added to the collection.

Draven
Reply With Quote
  #5  
Unread 03-27-2011, 04:48 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

OK re-reading your reply i think i miss understood you.

{AutoClose} <-- Add the auto close visible code to effect this one?
Make the checkbox effect this buttons visible?
How do I make this button "fire" the default button?

{Default add}

I hope i understood it ok this time around, sorry

Thanks,
Draven
Reply With Quote
  #6  
Unread 03-27-2011, 04:57 PM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

It isn't working for two reasons. One is what Drumstix said, the other is that you are only modifying the template row, not the actual row. So make sure that you create that custom button within the template. Also your checkbox will not affect anything, have your code within the new button check the state of the checkbox instead.
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
  #7  
Unread 03-27-2011, 05:06 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

OK i think you both have went right over my poor head, sadly.

Maybe oyu can post some sample code so I can follow you a bit better?

Draven
Reply With Quote
  #8  
Unread 03-27-2011, 05:46 PM
TalTal TalTal is offline
A Griffon
Featured
 
Join Date: Nov 2005
Server: Nagafen
Posts: 1,095
Send a message via Yahoo to TalTal
Default

<SNIP>
Coding not smart when tired. lol.

Silat

Last edited by TalTal : 03-27-2011 at 05:48 PM.
Reply With Quote
  #9  
Unread 03-27-2011, 06:03 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

lol @TalTal
Reply With Quote
  #10  
Unread 03-27-2011, 08:41 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Send a message via AIM to Drumstix42 Send a message via MSN to Drumstix42 Send a message via Yahoo to Drumstix42
Default

Don't actually modify the normal Add button. I wanted you to "clone" it IE make one that mimics it and that's where your extra code goes. This code then triggers the Add button

[Check box] toggles which button # is visible

{YourCloned button #1} Press it, do some stuff, press the Add button, close window
{YourCloned button #2} Press it, do some stuff, press the Add button
{Add button} gets pressed by the cloned button
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #11  
Unread 03-27-2011, 09:58 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

Quote:
Originally Posted by Drumstix42 View Post
Don't actually modify the normal Add button. I wanted you to "clone" it IE make one that mimics it and that's where your extra code goes. This code then triggers the Add button

[Check box] toggles which button # is visible

{YourCloned button #1} Press it, do some stuff, press the Add button, close window
{YourCloned button #2} Press it, do some stuff, press the Add button
{Add button} gets pressed by the cloned button
OK, i got that much but the issue I am having is how to make it do the stuff.
how to make my button press the default button?

I know how to make it visible or not and how to close the window.

Thanks both of you for bareing with me on this
Draven
Reply With Quote
  #12  
Unread 03-27-2011, 11:21 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Send a message via AIM to Drumstix42 Send a message via MSN to Drumstix42 Send a message via Yahoo to Drumstix42
Default

Reference it correctly and do a AddButton.press=true
... or whatever it's called in the XML
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #13  
Unread 03-27-2011, 11:53 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

Yeah, the press=true was my mistake, but i am having the issue of with the checkbox the buttons aren't changing visibility in-game, in the uibuilder they are.
Reply With Quote
  #14  
Unread 03-28-2011, 08:51 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

Quote:
Originally Posted by Draven_Caine View Post
Yeah, the press=true was my mistake, but i am having the issue of with the checkbox the buttons aren't changing visibility in-game, in the uibuilder they are.
I already explained cause and solution...
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
  #15  
Unread 03-28-2011, 10:08 AM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

Quote:
Originally Posted by gm9 View Post
It isn't working for two reasons. One is what Drumstix said, the other is that you are only modifying the template row, not the actual row. So make sure that you create that custom button within the template. Also your checkbox will not affect anything, have your code within the new button check the state of the checkbox instead.
It might explain cause and effect to the knowing eye but not for me /sigh nvm Ill figure it out for myself.
Reply With Quote
  #16  
Unread 03-28-2011, 10:22 AM
Landiin Landiin is offline
Slayer of clock cycles
This person is a EQ2Map developer.
Featured
 
Join Date: Nov 2004
Server: Oasis
Posts: 3,464
Send a message via ICQ to Landiin Send a message via AIM to Landiin Send a message via MSN to Landiin Send a message via Yahoo to Landiin
Default

What he is saying is...

Read the state of your checkbox (checkbox.checked) via your fake add button. You can't insert data into the correct row where the add button resides b/c the game copies the template XML (the row XML code) and adds rows as needed at runtime(when the window is created in _HUD) from the copied template XML. Thus your check box is only changing the data in the template row not the real row that your add button is really in. It does this before the window is shown so using the OnShow of the main window is useless in this case.
__________________
Landiin's EQ2MAP Updater Discussion Download

Last edited by Landiin : 03-28-2011 at 10:26 AM.
Reply With Quote
  #17  
Unread 03-28-2011, 12:40 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

Quote:
Originally Posted by Draven_Caine View Post
OK i think you both have went right over my poor head, sadly.

Maybe oyu can post some sample code so I can follow you a bit better?

Draven
You guys keep saying what cant be done and what should be done very vaguely, Can one of you post some sample code so I can follow what your saying .... please

Like where ot put the code in my "custom button"?
How to check the state of my check box from my "custom button"?
Reply With Quote
  #18  
Unread 03-28-2011, 12:53 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Send a message via AIM to Drumstix42 Send a message via MSN to Drumstix42 Send a message via Yahoo to Drumstix42
Default

I wasn't even thinking of which Add button this was until now. So yeah, as they already said, you can't reference the Add button or the cloned buttons from the Checkbox.

So, leave your checkbox as is, and don't put any special code in it.
What you'd probably have to do, is use a OnHoverIn code to show your fake Add button or not.

The code would look something like this:
OnHoverIn="Visible=(Parent.Parent.YourCheckBox.checked == true)"

That way if the checkbox wasn't checked, the fake button would hide, and the normal Add button would then be pressable. You'd have to put this "OnHoverIn" code directly on the FakeAdd button I'm thinkin though, so it would get copied through the whole template.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #19  
Unread 03-28-2011, 01:20 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

Quote:
Originally Posted by Drumstix42 View Post
I wasn't even thinking of which Add button this was until now. So yeah, as they already said, you can't reference the Add button or the cloned buttons from the Checkbox.

So, leave your checkbox as is, and don't put any special code in it.
What you'd probably have to do, is use a OnHoverIn code to show your fake Add button or not.

The code would look something like this:
OnHoverIn="Visible=(Parent.Parent.YourCheckBox.checked == true)"

That way if the checkbox wasn't checked, the fake button would hide, and the normal Add button would then be pressable. You'd have to put this "OnHoverIn" code directly on the FakeAdd button I'm thinkin though, so it would get copied through the whole template.
Awsome, almost got it.

My button has HoverIn=Visible=(Parent.Parent.FilterPage.AutoClose.checked == true)

But the issue now is if the checkbox (Named AutoClose) keeps the button visible if the check box is checked as needed, and if i uncheck the box it disappears on mouse-over, but if i re-check the box and mouse-over the button again the custom button doesn't re-appear.

The funny thing about this code is its not even for me, its for a friend that wanted this option added to her UI lol.
Reply With Quote
  #20  
Unread 03-28-2011, 02:40 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Send a message via AIM to Drumstix42 Send a message via MSN to Drumstix42 Send a message via Yahoo to Drumstix42
Default

Ah, right, once it hides itself, it wouldn't be able to trigger an OnHover again since OnHover only works for visible things. You're best bet is to use a page that sits on top of the button, and always visible, but has nothing in it AbsorbsInput=false and has no style. That page can have the OnHoverIn code to tell the fake button to appear or not. That way it always gets triggered.

Sorry for the scatterbrain-ness.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #21  
Unread 03-28-2011, 07:36 PM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

OnHoverIn is messy. The usual way is to create two custom buttons, one to overlay the default button, the second one is invisible. Invisible one gets your hide_window code in it's OnActivate event, followed by an activated=false. The first button activated the second button depending on the state of the checkbox, so Parent.SecondButton.Activated=Parent.Parent.YourCheckbox.checked.
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
  #22  
Unread 03-29-2011, 12:43 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Send a message via AIM to Drumstix42 Send a message via MSN to Drumstix42 Send a message via Yahoo to Drumstix42
Default

Yeah, that works too.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #23  
Unread 03-29-2011, 02:10 PM
Draven_Caine's Avatar
Draven_Caine Draven_Caine is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Oct 2009
Server: Unrest
Posts: 155
Default

Thanks for all the help everyone, but I couldn't get either Drumstix's or GM9's options to work, but in the good news i figured out a way other than those ways ...

I added 2 buttons to the template file both "new" buttons press the default add button, one of the custom buttons also /hide_window also. The reason I added the 2nd custom button instead of using the default add button was because my custom "add and close" button was always visible and the default "add" button wasn't. SO I added a 2nd custom button so it was always visible like my first custom button but behaves like the default add button.

The words overflow a bit on the first button for right now because this is just a temporary fix until i recode / re-skin this window in the future.

Thanks again for all the help, i just couldn't get it to work.
Draven
Attached Thumbnails
Click image for larger version

Name:	EQ2_000001.gif
Views:	661
Size:	212.6 KB
ID:	7702  
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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


Our Network
EQInterface | EQ2Interface | WoWInterface | LoTROInterface | ESOUI | MMOUI