EQ2Interface.com
Search Downloads


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

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 01-16-2010, 02:45 PM
Jamesc146's Avatar
Jamesc146 Jamesc146 is offline
A Griffon
 
Join Date: Nov 2008
Server: Butcherblock
Posts: 101
Default Tradeskill window

<Button IsDefaultButton="true" Location="312,520" MinimumSize="10,10" Name="Repeat" PackLocation="right,bottom" ScrollExtent="42,42" Size="42,42" Style="Styles.Repeat.style" Visible="false" />
<Button IsCancelButton="true" Location="312,520" MinimumSize="10,10" Name="Stop" PackLocation="right,bottom" ScrollExtent="42,42" Size="42,42" Style="Styles.Stop.style" />

Would changing the red above to be the following move the repeat button to the center instead of being right over the stop button?:
<Button IsDefaultButton="true" Location="???,520" MinimumSize="10,10" Name="Repeat" PackLocation="center,bottom" ScrollExtent="42,42" Size="42,42" Style="Styles.Repeat.style" Visible="false" />
Reply With Quote
  #2  
Unread 01-18-2010, 05:40 PM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

Pack locations refer to how an control will move its own location in relation to it's parent's bounds. Though I cannot say that I understand what "right,bottom" would mean because that doesn't follow the format the UI builder documentation specifies. It leaves out information and uses different keywords.

If you wanted a button to remain centered near the bottom within a resizable window, you could use "CPC,FFF". I think. This is sort of going off of memory of how it works.

It stands for this:
  • C - Center horizontal point of the child control
  • P - Proportionally (like a percentage) relocated
  • C - Based on the Center of the parent control
  • F - The Far vertical edge of the child control
  • F - Using a Fixed (number of pixels) relationship to the parent control's edge
  • F - Using the Far edge of the parent control
Regardless of the above, you still must set the location of the control in pixels to be positioned in the center of the parent control. (Still based on the upper-left corner of the child control) You cannot give locations as a wildcard.

Last edited by EQAditu : 01-18-2010 at 05:45 PM.
Reply With Quote
  #3  
Unread 01-18-2010, 06:03 PM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

Quote:
Originally Posted by EQAditu View Post
Though I cannot say that I understand what "right,bottom" would mean because that doesn't follow the format the UI builder documentation specifies.
The UIbuilder doc is outdated and incomplete, right, left and center as well as top, center, bottom are valid keywords for PackLocation.
__________________
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
  #4  
Unread 01-18-2010, 08:28 PM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

Well, I'll just then say that I don't like the new available keywords because it doesn't give you the ability to specify all of the options. So my advice stands.

What would "right,bottom" even mean? Is it "FFF,FFF" or is it "NFF,NFF"? If the PackSize is "F,F", it doesn't matter. But if you use any combination of A or P instead of F, it will change the behavior.

I simply don't like shortcut keywords(that aren't even shorter) that create ambiguity. But whatever... to some people that don't want to learn what the shorthand letters mean, I guess learning the full words may be okay.

Last edited by EQAditu : 01-18-2010 at 08:31 PM.
Reply With Quote
  #5  
Unread 01-19-2010, 06:07 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

right, bottom is FFF,FFF if I remember correctly. I have used both in my code in the past, even in combination (e.g. cfc,bottom is valid).

Having options for convenience is never bad. While I can code assembler I prefer to use high level programming languages for the same reason.
__________________
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
  #6  
Unread 01-19-2010, 08:46 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

Quote:
Originally Posted by gm9 View Post
{...}
While I can code assembler I prefer to use high level programming languages for the same reason.
Sure, but if you want to use such broad analogies, I can do that too.

I used to like foreach in programming because it allowed me to skip specifying the conditions of exiting and incrementing a number in a for loop. Then I found out that in most of the cases that I used it, it caused my program to be slower. So I stopped using it completely because it would never be faster and usually slower if I was careful as to how I coded the rest of the loop. So to sum up this analogy, easier is not always better.

PS, I wonder what the OP thinks of how this conversation is turning out.
PPS, I wish that .NET Forms programming actually had this level of detail. Specifically proportional resizing and relocation. Using table containers are just cumbersome.

Last edited by EQAditu : 01-19-2010 at 08:50 AM.
Reply With Quote
  #7  
Unread 01-19-2010, 09:46 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

You could have made the same argument my assembler analogy already and I actually expected you to do so. And depending on the type of array you are looping through foreach can actually be faster.

And to actually say something relevant to the OP: If you use UIbuilder there are buttons on the preview panel to align UI elements. Although I always did it mathematically by hand. And maybe to clarify what Aditu has explained: PackLocation is only relevant when you resize the window in game to a different size than what it says in the XML. It is used to adjust the location of elements with respect to other elements. The complementary attribute is PackSize which does the same for the size.
Reply With Quote
  #8  
Unread 01-20-2010, 08:59 AM
Jamesc146's Avatar
Jamesc146 Jamesc146 is offline
A Griffon
 
Join Date: Nov 2008
Server: Butcherblock
Posts: 101
Default lol

you guys lost me at pack locations lol I think I get it though... I think? Basically this code is out dated and should be cpc instead of right,bottom? right?

I'm a serious noob but I'm tryin to learn.

Thanks for the replies,

James
Reply With Quote
  #9  
Unread 01-20-2010, 10:16 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

It's not outdated, the other one is just more precise. The important part was however that you need to change "Location".
__________________
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
  #10  
Unread 01-20-2010, 10:50 AM
Jamesc146's Avatar
Jamesc146 Jamesc146 is offline
A Griffon
 
Join Date: Nov 2008
Server: Butcherblock
Posts: 101
Default is this right?

what would I change location to? would it be half of 312? Meaning
Location="156,520"?
Reply With Quote
  #11  
Unread 01-20-2010, 11:05 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

I can't tell just like that since I got no reference to calculate the center of your window from. Just try it and see how it looks.
__________________
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
  #12  
Unread 01-20-2010, 09:04 PM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

Quote:
Originally Posted by Jamesc146 View Post
what would I change location to? would it be half of 312? Meaning
Location="156,520"?
Normally I would say no, since it seemed too easy a calculation. For the button to be fully visible, its parent window would need to be at least (312+42)=354px wide. Then you didn't really account for the center of the child control you're moving either.

Essentially what you want to center something is:
(ParentWidth / 2) - (ChildWidth / 2)
(354 / 2) - (42 / 2)
(177) - (21)
156

Oddly the result is the same as you guessed at. Though I have a feeling your button isn't pressed all the way against the edge of the window. So you'll need to plug in the real numbers.
Reply With Quote
  #13  
Unread 01-20-2010, 10:06 PM
Jamesc146's Avatar
Jamesc146 Jamesc146 is offline
A Griffon
 
Join Date: Nov 2008
Server: Butcherblock
Posts: 101
Talking

LMAO

Dumb luck perhaps but I do understand what you are saying here to get the true center. thank you for the responses.

A word on the UI Builder, I would like to learn how to use that thing but I just don't get it. and understand the controls or how to make the preview look like it will in game or how to add anything to it. I suppose I could read the faq on it or the instructions and perhaps the comic while I'm at it.

At least with my notepad full of code I am able to pick it apart and at least find what it is I am looking for. Now if I could only learn what to to with it once I find it I might make an ok modder.
Reply With Quote
  #14  
Unread 01-21-2010, 09:48 AM
lordebon lordebon is offline
Fetish Core author
This person is a EQ2Map developer.
Featured
 
Join Date: Jun 2005
Server: Crushbone
Posts: 2,667
Default

Quote:
Originally Posted by Jamesc146 View Post
LMAO

Dumb luck perhaps but I do understand what you are saying here to get the true center. thank you for the responses.

A word on the UI Builder, I would like to learn how to use that thing but I just don't get it. and understand the controls or how to make the preview look like it will in game or how to add anything to it. I suppose I could read the faq on it or the instructions and perhaps the comic while I'm at it.

At least with my notepad full of code I am able to pick it apart and at least find what it is I am looking for. Now if I could only learn what to to with it once I find it I might make an ok modder.
The very basic thing of UI builder is this: Never open any file except eq2ui.xml with it. Open that, then find the file you actually want in the tree view on the left. Then use the tabs on the right pane to select the appropriate area (ie if you're looking for eq2ui_MainHUD_Persona.xml, select the MainHUD tab). Drag other stuff out of the way if necessary.

All the parts of the window are child objects of the window object (use the little + to expand). The box at the bottom of the left window is all the properties of that object -- be it a window, a piece of text, etc.
__________________
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 03:30 PM.


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