EQ2Interface.com
Search Downloads


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

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 12-05-2006, 07:08 AM
thorvang thorvang is offline
A Rumbleroot Sapling
Interface Author - Click to view interfaces
 
Join Date: Nov 2004
Server: Antonia Bayle
Posts: 68
Default setting sizes, interface too slow?

i'm setting the size of one widget within a onShow event and right after that setting the size of another widget to the size of the previously set widget (next line of command in the same event).

but somehow the second widget always receives the size of the first widget prior to resizing. is this caused by the UI not responding that quick or what is it?

(edited to clarify)

it's two nested widgets. the inner one is sitting with packsize=proportional inside the outer one. i resize the outer one and want another widget set to the size of the now automatically resized inner widget. and that's what not functioning.

Last edited by thorvang : 12-05-2006 at 07:21 AM.
Reply With Quote
  #2  
Unread 12-06-2006, 11:55 AM
thorvang thorvang is offline
A Rumbleroot Sapling
Interface Author - Click to view interfaces
 
Join Date: Nov 2004
Server: Antonia Bayle
Posts: 68
Default

i'm under the impression that autoscaled sizes aren't pushed to the client somehow. setting some widget to the size of X will force this widget to always return the value X for it's size, no matter what happened via autoscale. is that right?
Reply With Quote
  #3  
Unread 12-06-2006, 02:06 PM
Zonx's Avatar
Zonx Zonx is offline
A Green Troll
This person is a EQ2Map developer.
Featured
 
Join Date: Dec 2004
Server: Blackburrow
Posts: 2,221
Default

All addressable object properties are available at runtime, weather autoset or not.

Generally, any objects/properties you can see in the XML are addressable. Hard-codeding is generally a problem of not being able to address objects, code, or properties that aren't exposed in the XML.

The issue you described sounds like either a timing problem or a script ordering problem. Check the following potential problems...

1) Commands are executed right to left, then top to bottom.

Example:
Code:
OnShow="A=B B=C"
Result, A=C not the original value of B. Since the commands are on the same line, the right command is executed first, followed by the left command. In your case, if you wrote
Code:
window.size='100,100' a=window.child.size
You're actually asking for the size before its been changed.

To avoid execution order problems, I recomend always line breaking between commands.

Example:
Code:
OnShow="A=B
B=C"
result, A=B

2) Unoptimized graphical objects can result in rendering taking longer than the script that forced a redraw. Excessive image tiling in particular can cause this. Avoid using Rectangle styles that tile tiny image slices.

Example: You have a FrameStyle applied to a page that tiles a 1 pixel image to draw a border. The first line of your script resets the window's size. It takes 2 seconds to render the new size because all those tile positions have to be calculated. 1/2 sec after the first line of script fired, the script tries to get the size of a child object of that window, but it hasn't finished drawing so the child object hasn't changed.
Reply With Quote
  #4  
Unread 12-07-2006, 05:48 AM
thorvang thorvang is offline
A Rumbleroot Sapling
Interface Author - Click to view interfaces
 
Join Date: Nov 2004
Server: Antonia Bayle
Posts: 68
Default

thanks, wasn't aware of the right to left execution. but this hasn't been the problem here, used line breaks between the commands.

i'm not using "unoptimized" objects. at least i guess so. it's just a page object with no style attached. maybe the problem sits in the amount of resizing. i'm blowing it from sizes like 70 to 10k and back to 100 right in the next line.

this also explains another weird problem i encountered. guess i have to find some other way to do what i want
Reply With Quote
  #5  
Unread 12-07-2006, 10:28 AM
Zonx's Avatar
Zonx Zonx is offline
A Green Troll
This person is a EQ2Map developer.
Featured
 
Join Date: Dec 2004
Server: Blackburrow
Posts: 2,221
Default

Post your script. If there aren't any styles applied to the objects being resized, it should happen fairly quick, though 10k pixels is prety ginourmious.
Reply With Quote
  #6  
Unread 12-07-2006, 10:59 AM
thorvang thorvang is offline
A Rumbleroot Sapling
Interface Author - Click to view interfaces
 
Join Date: Nov 2004
Server: Antonia Bayle
Posts: 68
Default

what i want to do is using nested pages as calculator. in this case to calculate the player's current resist cap.

the testing xml:
Code:
<Page Name="Test" ScrollExtent="320,240" Size="320,240">
<Page BackgroundColor="#0F00F0" BackgroundOpacity="1.000" Name="Dummy" ScrollExtent="100,40" Size="100,40">
<Page BackgroundColor="#00FF00" BackgroundOpacity="1.000" Name="Inner" PackLocation="left" PackLocationProp="0000/0001,xxxx/xxxx" PackSize="proportional" PackSizeProp="0100/0100,xxxx/xxxx" ScrollExtent="100,40" Size="100,40"/>
</Page>
<Page BackgroundColor="#0F00F0" BackgroundOpacity="1.000" Location="0,45" Name="Container" ScrollExtent="100,40" Size="100,40">
<Page BackgroundColor="#00FF00" BackgroundOpacity="1.000" Name="Bar" PackLocation="left" PackLocationProp="0000/0001,xxxx/xxxx" PackSize="proportional" PackSizeProp="0100/0100,xxxx/xxxx" ScrollExtent="100,40" Size="100,40"/>
</Page>
<Text Font="normal" LocalText="35" Location="4,91" Name="Level" ScrollExtent="50,20" Size="50,20"></Text>
<Text Font="normal" LocalText="2700" Location="4,114" Name="Cold" ScrollExtent="50,20" Size="50,20"></Text>
<TextStyle Algorithm="simple" FontName="Arial" Language="english" Name="normal" PointSize="20" UseCachedFont="true"/>
<Button BackgroundColor="#0FFFF0" Location="86,134" Name="New Button" OnPress="parent.Dummy.Size=70,40
parent.Dummy.Inner.Size=parent.Level.LocalText ## , ## 40
parent.Dummy.Size=10500,40
parent.Container.Size=parent.Dummy.Inner.Size
parent.Container.Bar.Size=parent.Cold.LocalText ## , ## 40
parent.Container.Size=100,40" ScrollExtent="64,32" Size="64,32"></Button>
</Page>
commented script code:
Code:
parent.Dummy.Size=70,40 // set outer dummy to the level cap

parent.Dummy.Inner.Size=parent.Level.LocalText ## , ## 40 // set inner to the current level

parent.Dummy.Size=10500,40 // by resizing the outer dummy to the cap for level 70, the inner page gets resized to the cap for the current level

parent.Container.Size=parent.Dummy.Inner.Size // *** failure here *** set the container's size to the dummy's inner page. this remains at 35 for this example

parent.Container.Bar.Size=parent.Cold.LocalText ## , ## 40 // set the size of the container's inner page to the current resistance value

parent.Container.Size=100,40 // this should resize the inner page to the progress onto the current level's cap
i use this code as an underlay in the persona window to give a visual feedback on how much room is left to increase a stat. it's not a representation of the actual mitigation, it's just the progress towards the cap. currently it's towards the cap of a level 70 player cause i don't get the current cap calculation to work.

i also tried it with three nested pages, this would do away the dummy pages. but with three nested pages the innermost page gets (directly via textfield's localtext) resized before the second layer page is resized via it's proportional setting. this leads to the innermost page always getting set to the maximum size (outer size of 100 vs. inner size of 1000++)

Last edited by thorvang : 12-07-2006 at 11:04 AM.
Reply With Quote
  #7  
Unread 12-07-2006, 07:56 PM
Zonx's Avatar
Zonx Zonx is offline
A Green Troll
This person is a EQ2Map developer.
Featured
 
Join Date: Dec 2004
Server: Blackburrow
Posts: 2,221
Default

Ok played with this for a bit. There are a couple problems.

1) There is deffinetly a timming issue. With my other tweaks, I can see the results differ if each command is executed manually vs auto.

2) Although EQ2 script is prety good about processing unquoted strings, sometimes it has problems. Best to quote any comma separated values.

3) Not possitive, but it seamed in my tests that it was confused by the "Container" label, so I changed it.

In this sample code, I've split each command out to a separate button and dasy-chained them with scripted button presses. The problem occurs with the 4th button press. If its executed via script, the Inner size gets called before its been resized. If you press the button manually, it works as intended due to the delay between pressing the 1st and 4th buttons.
Code:
<Page Name="Test" ScrollExtent="320,240" Size="320,240">
<Page BackgroundColor="#0F00F0" BackgroundOpacity="1.000" Name="Dummy" ScrollExtent="100,40" Size="100,40">
<Page BackgroundColor="#00FF00" BackgroundOpacity="1.000" Name="Inner" PackLocation="left" PackLocationProp="0000/0001,xxxx/xxxx" PackSize="proportional" PackSizeProp="0100/0100,xxxx/xxxx" ScrollExtent="100,40" Size="100,40"/>
</Page>
<Page BackgroundColor="#0F00F0" BackgroundOpacity="1.000" Location="0,45" Name="Cont" ScrollExtent="100,40" Size="100,40">
<Page BackgroundColor="#00FF00" BackgroundOpacity="1.000" Name="Bar" PackLocation="left" PackLocationProp="0000/0001,xxxx/xxxx" PackSize="proportional" PackSizeProp="0100/0100,xxxx/xxxx" ScrollExtent="100,40" Size="100,40"/>
</Page>
<Text Font="normal" LocalText="35" Location="4,91" Name="Level" ScrollExtent="50,20" Size="50,20">35</Text>
<Text Font="normal" LocalText="2700" Location="4,114" Name="Cold" ScrollExtent="50,20" Size="50,20">2700</Text>
<TextStyle Algorithm="simple" FontName="Arial" Language="english" Name="normal" PointSize="20" UseCachedFont="true"/>
<Button BackgroundColor="#0FFFF0" Location="0,134" Name="Button1" OnPress="parent.Dummy.Size='70,40'
parent.Button2.Press='true'" ScrollExtent="50,32" Size="50,32"></Button>
<Button BackgroundColor="#0FFFF0" Location="54,134" Name="Button2" OnPress="parent.Dummy.Inner.Size=parent.Level.Text ## ',' ## '40'
parent.Button3.Press='true'" ScrollExtent="50,32" Size="50,32"></Button>
<Button BackgroundColor="#0FFFF0" Location="108,134" Name="Button3" OnPress="parent.Dummy.Size='10500,40'
" ScrollExtent="50,32" Size="50,32"></Button>
<Button BackgroundColor="#0FFFF0" Location="162,134" Name="Button4" OnPress="parent.Cont.Size=parent.Dummy.Inner.Size
parent.Button5.Press='true'" ScrollExtent="50,32" Size="50,32"></Button>
<Button BackgroundColor="#0FFFF0" Location="216,134" Name="Button5" OnPress="parent.Cont.Bar.Size=parent.Cold.Text ## ',' ## '40'
parent.Button6.Press='true'" ScrollExtent="50,32" Size="50,32"></Button>
<Button BackgroundColor="#0FFFF0" Location="270,134" Name="Button6" OnPress="parent.Cont.Size=100,40" ScrollExtent="50,32" Size="50,32"></Button>
</Page>
Note: You'd probably have better results just using math to calcualate the values. Math will produce decimals, but they get truncated when passed as a size value. Try this formula
Code:
resist/((level * 105)/70)
or
resist/(level * 1.5)
Reply With Quote
  #8  
Unread 12-08-2006, 03:45 AM
thorvang thorvang is offline
A Rumbleroot Sapling
Interface Author - Click to view interfaces
 
Join Date: Nov 2004
Server: Antonia Bayle
Posts: 68
Default

oh man... i must have been blindfolded. of course simple math fits my problem better. sorry for being dumb Oo

thanks for all the testing tho. at least now i'm certain there's issues with timing
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 09:46 PM.


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