EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   Align to another window (https://www.eq2interface.com/forums/showthread.php?t=15202)

Draven_Caine 12-12-2010 08:35 PM

Align to another window
 
Greetings,
Is there a way to have window B auto align to window A if window A is moved?

If window A is player window and window B is effects:

If i move the player window, to have the effects window always aligned to the player window right side?

Thanks,
Draven

gm9 12-12-2010 09:12 PM

Yes, via OnMove code in Window A that moves Window B. Basically OnMove="WindowB.Left = WindowA.Left+WindowA.Width+1 WindowB.Top=WindowA.Top ".

Draven_Caine 12-12-2010 10:06 PM

Greetings,
Thanks GM9, its a bit more complex than VG's UI but very understandable. I'll be able to work-in some of my ideas now ... at a later date :)

Thanks,
Draven

Draven_Caine 12-19-2010 09:27 PM

Greetings,
Ok i got the code working, not as dynamic as yours but my player window is a set size so it works.

Is there a way to set a window size to the number of icons in it. This is for the detrimental effects.

Like if there is one row of icons set the window width to 25 width, if there are 2 rows set the width to 50 width?

Thanks,
Draven

Drumstix42 12-20-2010 03:32 AM

Don't think there is a way. Better off just setting the sorting order with the available options.

Draven_Caine 01-01-2011 02:49 PM

Quote:

Originally Posted by gm9 (Post 94902)
Yes, via OnMove code in Window A that moves Window B. Basically OnMove="WindowB.Left = WindowA.Left+WindowA.Width+1 WindowB.Top=WindowA.Top ".

A few issues I ran into.
  • How do it get it to subtract?
  • It seems that if you add a variable of plus or minus to the code it doesn't behave in the UI builder, this might be just a UI builder issue though.

Thanks,
Draven

Drumstix42 01-01-2011 06:34 PM

UIBuilder doesn't like math calculations that result in numbers higher than... 10? I think....
Something like that. it returns the numbers with large 1e10 type values that break the code.

In-game will work fine though.

Draven_Caine 01-01-2011 07:00 PM

Ahh, that makes sense, thanks Drumstix.

Do you happen to know how to subtract with GM9's code from this thread, it doesn't seem to work for me, in or out of game.

Thanks,
Draven

Drumstix42 01-02-2011 01:15 AM

What do you mean? Post your code.

Subtraction is as easy as addition.. just replace + with -

Draven_Caine 01-03-2011 05:06 PM

Quote:

Originally Posted by Drumstix42 (Post 95123)
What do you mean? Post your code.

Subtraction is as easy as addition.. just replace + with -

The - doesn't seem to take affect but i just didn't auto-align the window since one of the users of the UI wanted to move them separately.

Thanks though,
Draven

Drumstix42 01-04-2011 10:02 AM

It's usually best to do one math thing at a time, the engine seems to read from right to left in calculations and such, might just be a parsing/spacing error. I've used both addition/subtraction a bit in the interface, so it definitely works.

Draven_Caine 04-17-2011 12:00 PM

Greetings,
I am reviving this old thread because:
  1. Its my thread :)
  2. It is also the same issue, just a diffrent window.

I have the window that "You have gained a skill" window auto-aligned to my effects window (bottom, center).

Now the issue is my effects window has a frame on it, this alignment works until the frame is turned on, or vise-versa. How do I tell it if the frame is used use the effects top alignment + 100, if the frame isnt used, align to the effects window +50 for example?

Thanks,
Draven

TalTal 04-17-2011 08:47 PM

Quote:

Originally Posted by Draven_Caine (Post 96789)
Greetings,
I am reviving this old thread because:
  1. Its my thread :)
  2. It is also the same issue, just a diffrent window.

I have the window that "You have gained a skill" window auto-aligned to my effects window (bottom, center).

Now the issue is my effects window has a frame on it, this alignment works until the frame is turned on, or vise-versa. How do I tell it if the frame is used use the effects top alignment + 100, if the frame isnt used, align to the effects window +50 for example?

Thanks,
Draven

Something like

COND = Window.Frame.Visible
TOPA = Window.Top + 100
TOPB = Window.Top + 50
NEWTOP = COND ? TOPA : TOPB

Windowb.Top = NEWTOP

and of course this would be in a button or directly in the onshow of windowb, so it would trigger onshow of windowb.

Silat

Draven_Caine 04-21-2011 09:11 AM

OK I got it working last night since I had a break from work.

The only issue I ran into was I am using this code for 2 windows to align them to Window A (effects window)

To align the OnscreenMessage to the effects window:
  • OnTextChanged="Parent.Parent.OnscreenMessage.Top=Parent.Parent.Effects.Top+89 Parent.Parent.OnscreenMessage.Left=Parent.Parent.Effects.Left+90"
Now to align the AchievementCompleted to the effects window:
  • OnTextChanged="Parent.Parent.AchievementCompleted.Top=/MainHUD.Effects.Top+89
    Parent.Parent.AchievementCompleted.Left=/MainHUD.Effects.Left+90"
should have the same code but it doesnt work. Now I think this has something to do with having to do up to the "Root" when coming back to the /MainHUD.

Any help would be appreciated.
Draven

Landiin 04-21-2011 10:05 AM

Quote:

OnTextChanged="Parent.Parent.AchievementCompleted.Top=/MainHUD.Effects.Top+89
Parent.Parent.AchievementCompleted.Left=/MainHUD.Effects.Left+90"
Unless something has change you can't address object the way you are trying to in the bolded code.

Once a window is created in display memory it becomes a child of _HUD. You do not need to worry about nodes like MainHud unless you are working with windows that are not in the display memory.

Basically the way the tree looks for windows that are in display memory is:

_HUD
|- Experience
|- Map

Hope this helps.

Draven_Caine 04-21-2011 11:19 AM

Quote:

Originally Posted by Landiin (Post 96813)
Unless something has change you can't address object the way you are trying to in the bolded code.

Once a window is created in display memory it becomes a child of _HUD. You do not need to worry about nodes like MainHud unless you are working with windows that are not in the display memory.

Basically the way the tree looks for windows that are in display memory is:

_HUD
|- Experience
|- Map

Hope this helps.

Ok but how do i go from the Journal tree to the MainHUD tree?

This doesnt work either.
OnTextChanged="Parent.Parent.AchievementCompleted.Top=Parent.Parent.Parent.MainH UD.Effects.Top+89
Parent.Parent.AchievementCompleted.Left=Parent.Parent.Parent.MainHUD.Effects.Lef t+90"

I need to go from the text field in the Journals/AchievementCompleted/TextField --> MainHUD.Effects. Now the problem I see is I cant use "Root" as a parent the same way i have been in other windows.

Basiclly I am telling the AchievementCompleted window when the text field changes set the top to what the effects window top is plus 89.

Thanks,
Draven

gm9 04-21-2011 12:48 PM

Quote:

Originally Posted by Draven_Caine (Post 96815)
Ok but how do i go from the Journal tree to the MainHUD tree?

Read what Landiin wrote, for your purposes there is no MainHUD tree, it's all in the same tree.

Draven_Caine 04-21-2011 01:35 PM

Still doesnt make sense for what I am trying to do.

After the UI is loaded, all windows are:
_hud
--Map
--AcheievementCompleted
--Effects
--Maintained

Is this correct, or no?

If this is the case I see how to do it if this is incorrect, I am still at square one.

Thanks,
Draven

Drumstix42 04-21-2011 06:04 PM

Example:

Inventory
|- Broker

MainHUD
|- Persona

When loaded into game Broker and Persona are both located under the same Parent page, instead of different ones. So you don't have to navigate up the tree as far. Only one parent level past a window's main page.

Draven_Caine 04-21-2011 08:45 PM

Oh awsome,
Thanks Druxskix that is much clearer.

I got it working so its like effects, OnscreenMessege and Acheievement are all under MainHUD (behaviour like).

Thanks again everyone,
Draven


All times are GMT -5. The time now is 10:24 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI