Quantcast Nesting Issues - EQ2Interface
EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > UI Developer Discussion

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 05-01-2012, 02:09 PM
TalTal TalTal is offline
A Griffon
Featured
 
Join Date: Nov 2005
Server: Nagafen
Posts: 1,094
Send a message via Yahoo to TalTal
Default Nesting Issues

I had a bit of free time and wantted to try out an idea but I am having issues. Here it is:

Window in Custom:


<Page AlwaysOnTop="true" eq2usescomwndcontrols="true" Location="100,100" MinimumSize="535,518" Name="Settings" PackLocation="nfn,bottom" ScrollExtent="535,518" Size="535,518" UserMovable="true" UserResizable="false" >
<Page Location="-2,15" MinimumSize="535,498" Name="TabPages" PackLocation="nfn,bottom" ScrollExtent="535,498" Size="535,498" Visible="true">
<Page Location="0,0" MinimumSize="535,498" Name="Bar_Settings" PackLocation="left,top" ScrollExtent="535,498" Size="535,498" Visible="false">
<Button Location="235,466" MaximumSize="16384,26" Size="32,32" Name="SetButton" OnPress="
Parent.Parent.Parent.Parent.Parent.MainHUD.Clock.SetDisplay.Text='Test'
">Update</Button>
</Page>
</Page>
</Page>


Window in MainHUD (the clock):

<Page AlwaysOnBottom="true" eq2usescomwndcontrols="true" Location="0,748" MinimumSize="800,50" Name="Clock" PackLocation="nfn,bottom" ScrollExtent="800,50" Size="800,50" UserMovable="true" UserResizable="true">
<Button Name="SetDisplay" Size="32,32" OnPress="
Parent.Parent.Parent.Custom.Settings.TabPages.Bar_Settings.SetButton.Text='Press Me'
">Tester</Button>
</Page>

The onpress event of the button 'SetDisplay' will change the text of the button 'SetButton' from in-game.

The onpress event of the button 'SetButton' will NOT change the text of the button 'SetDisplay' from in-game.

I'm guessing that it is a nesting issue but I cannot track it down. Any tips?

Silat
Reply With Quote
  #2  
Unread 05-02-2012, 09:32 AM
keezyrick keezyrick is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Dec 2006
Server: Guk
Posts: 194
Default

Looks to me like you have one too many Parent nests in your command. You going outside the container by the time you call MainHUD.

<Button Location="235,466" MaximumSize="16384,26" Size="32,32" Name="SetButton" OnPress="
Parent.Parent.Parent.Parent.Parent.MainHUD.Clock.SetDisplay.Text='Test'
">Update</Button>
__________________
GUK Server
<Legion of the White Rose>
Mezzes 90 Coercer
Reply With Quote
  #3  
Unread 05-02-2012, 10:42 AM
TalTal TalTal is offline
A Griffon
Featured
 
Join Date: Nov 2005
Server: Nagafen
Posts: 1,094
Send a message via Yahoo to TalTal
Default

That one moves it to hud from custom so that you can then go back to MainHUD. At any rate trying it with 2-6 Parent.Parent's does not seem to work. I think the game does not like accessing mainhud from custom or that there is some trick to it that I do not know.

Silat
Reply With Quote
  #4  
Unread 05-02-2012, 11:24 AM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

This will probably sound crazy as I can barely remember it myself... but there are multiple versions of the UI the game has.

There's a "memory" version and a "file" version. The reason I call it those is that the "file" version has the XML reference structure of the files, while the "memory" version is the one the game actively uses but does not have the same structure for referencing.

File structure:
Code:
<root>
    <MainHUD>
        <Clock/>
    </MainHUD>
    <Custom>
        <Settings/>
    </Custom>
</root>
Memory structure:
Code:
<root>  <!-- Some called it _HUD -->
    <Clock/>  <!-- ALL windows are merged into one XML node -->
    <Settings/>
</root>
The memory structure is what you should always use as otherwise you'll have odd side effects. Similar to how if you use /show_window with the wrong capitalization. "A window" will show up, but it won't work correctly.
Reply With Quote
  #5  
Unread 05-02-2012, 04:03 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,284
Send a message via AIM to Drumstix42 Send a message via MSN to Drumstix42 Send a message via Yahoo to Drumstix42
Default

EQAditu is right, and gm9 had stated it a few times in the past in a few topics.

You can figure out it's called "_HUD" by echoing some ".Name" parameters to the chat window or to a ui text elelment.
Basically if you do it in UIBuilder one way, you just need to remove a ".Parent.MainHUD" from your code for it to work normally in-game.

You CAN still use Parent.MainHUD in some cases, or for other parts of the UI, but it will only seem to modify the code if that window is never shown automatically, or ever receives a /show_window command. This command seems almost like an initialization code, as in it adds it to the "_HUD" root.

For the reason above, is why you must use the /show_window command once per "new" custom window you add, before you try to access it via UI code.
In my UI, I use tons of customs windows to save locations/sizes as settings, and I have to make sure I use the /show_window command for all of them.
__________________
"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


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 07:32 PM.


Our Network
EQInterface | EQ2Interface | War.MMOUI | WoWInterface | VGInterface | LoTROInterface | MMOInterface