EQ2Interface.com
Search Downloads


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

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 11-28-2007, 03:09 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default Variable question

Is it possible to use a variable inside of a location string?

ie:
Code:
Parent.Parent.(OBJECT).visible=true  OBJECT=name
Where OBJECT=name is getting the name of the current, say, button. And activating a page with the same name, in a different part of the XML tree.

So far I've managed to crash the UIBuilder, or have nothing happen

*edit*
My workaround for now, which works fine, is to just use a slightly different method. Original Info Center uses a slew of buttons that each hide every related page, and then unhide the appropriate one. This is just way too many lines of script.
So, I decided to just make a hidden button that does this same thing, which when activated hides all the pages, then deactivates itself. This way, all buttons only need to set a variable with the correct name, and then activate the hidden 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
>

Last edited by Drumstix42 : 11-28-2007 at 03:27 AM.
Reply With Quote
  #2  
Unread 11-28-2007, 11:01 AM
ShadowProwler420's Avatar
ShadowProwler420 ShadowProwler420 is offline
A Griffon
 
Join Date: Nov 2004
Server: Permafrost
Posts: 660
Default

Anything is 'possible' if you put your mind to it, Drum!
__________________

"Certainty of death! Small chance of success! What are we waiting for?!"

Reply With Quote
  #3  
Unread 11-28-2007, 01:08 PM
Talyns's Avatar
Talyns Talyns is offline
A Griffon
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Jul 2004
Server: Everfrost
Posts: 604
Default

Quote:
Originally Posted by Drumstix42 View Post
Is it possible to use a variable inside of a location string?


Here's an example where a visible page gets hidden when another page is shown.. I'm not sure if thats what you're trying to accomplish but I'm pretty sure this is what you're looking for:

Code:
<?xml version="1.0" encoding="utf-8"?>
<Page Name="PageContainer" Visible="true">

<Button Name="HideActivePage" OnActivate="Activated=false" Visible="false"></Button>

<Page Name="Page1" OnShow="Parent.HideActivePage.activated=true
Parent.HideActivePage.onactivate=(&apos;Parent.&apos;)##(name)##(&apos;.visible=false Activated=false&apos;)" Visible="false"/>

<Page Name="Page2" OnShow="Parent.HideActivePage.activated=true
Parent.HideActivePage.onactivate=(&apos;Parent.&apos;)##(name)##(&apos;.visible=false Activated=false&apos;)" Visible="false"/>

</Page>
Attached Files
File Type: xml example.xml (573 Bytes, 423 views)
__________________
Talyns

Last edited by Talyns : 11-28-2007 at 01:13 PM.
Reply With Quote
  #4  
Unread 01-14-2008, 04:36 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

I've been trying to mess with your example Talyns, but I can't seem to get it to work.

I tried a simple:
OnActivate=('Parent.')##(name)##('.visible=false')

... in attempt for an object to hide itself, but it wouldn't work. I was trying at first to set a variable in another object, but thought I'd first see if I can do something basic. Is my syntax incorrect?

I have a feeling you can only set a property using a variable, but not navigate the XML tree with a variable.
I may have a work-around to what I'm currently working on, but it's no big deal.
Looking at the code again, I see how I could set where I want to go in the tree as the variable in an object, and then execute it using the onActivate. Ugh, so many steps just to do something with a variable
__________________
"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
>

Last edited by Drumstix42 : 01-14-2008 at 04:42 AM.
Reply With Quote
  #5  
Unread 01-14-2008, 05:05 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

Yeah, I definitely over complicated what I was trying to do, but your example may still be able to help in some other ideas I have
__________________
"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
  #6  
Unread 01-14-2008, 05:36 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 Drumstix42 View Post
I have a feeling you can only set a property using a variable, but not navigate the XML tree with a variable.
I'm not entirely sure what you are trying to do, but your issue may be that you can always just resolve one variable per step. You are trying to do two in one.

The first step is to resolve your (name). Once you have that done, you can then resolve the XML path and address the visible parameter.

As an example an excerpt from my curing code which pulls the cure spell name from a file based on several variables. This is a three step process where I first "build" the correct location in the XML tree for the name, then create a script to pull the name into another variable and finally execute that script:

<Button Name="Configure"/>
<Button Name="GetSpellLocation" OnPress="SpellLocation=&apos;Parent.ProfitUI_Cures.&apos; ## (Parent.Parent.Parent._HUD.ProfitUI_SubclassDetector.Subclass) ## &apos;.&apos; ## (Parent.CureName) ## &apos;Cure&apos;
Parent.Configure.OnPress=&apos;Parent.Cure=&apos; ## (SpellLocation)
Parent.Configure.Press=true"/>
__________________
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 01-14-2008, 02:11 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

Indeed. I totally overlooked the basis of it. I understand it now, and got it working. But in the end, I didn't need to use it. But I'm sure I'll use this new knowledge soon enough
__________________
"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
Reply



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 04:27 PM.


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