EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Featured Projects > Fetish

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #22  
Unread 06-11-2013, 05:49 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

I had a lot of people coming to me with that same problem a while back, and it had happened to me enough times for me to be done with the problem.

So I coded this up. I put it in a button inside of the ExamineItem page called CheckLocation, and it gets activated OnShow. If you wanna put it directly in OnShow just remove a Parent. from each line. Feel free to use/mess with it:

Code:
gHeight=Parent.Parent.Height
gWidth=Parent.Parent.Width

iTop=Parent.Top
iBottom=(iTop + Parent.Height)
iLeft=Parent.Left
iRight=(iLeft + Parent.Width)

iNewTop=(gHeight - Parent.Height)
iNewTop=(iNewTop / 2)
iNewTop=int(iNewTop)
iNewTopPos=(iNewTop > 0)
iNewTop=(iNewTopPos ? iNewTop : 1)

bCheckTop=(iTop < 0)
bCheckBottom=(iBottom > gHeight)
bCheckVertical=(bCheckTop || bCheckBottom)
Parent.Top=(bCheckVertical ? iNewTop : iTop)

iNewLeft=(gWidth - Parent.Width)
iNewLeft=(iNewLeft / 2)
iNewLeft=int(iNewLeft)
iNewLeftPos=(iNewLeft > 0)
iNewLeft=(iNewLeftPos ? iNewLeft : 1)

bCheckLeft=(iLeft < 0)
bCheckRight=(iRight > gWidth)
bCheckHorizontal=(bCheckLeft || bCheckRight)
Parent.Left=(bCheckHorizontal ? iNewLeft : iLeft)
gHeight/gWidth gets the game window dimensions via the UI. It then basically checks if the any part of the examine window is off screen. if it is it will center it vertically/horizontally. It's worked really well!

Cheers.
__________________
"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 : 06-11-2013 at 05:52 PM.
Reply With Quote
 



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:51 AM.


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