Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Minimising a window ignores minsize (https://forums.graalonline.com/forums/showthread.php?t=75206)

JkWhoSaysNi 07-09-2007 06:59 PM

Minimising a window ignores minsize
 
2 Attachment(s)
I've created a gui window... (Attachment 1). It looks great in game... until you minimise it (attachment 2).

I have set the minsize attribute on the window so it cant be dragged smaller than it should be but minimising the window ignores this value (and the size of the graphics).

Anyone know how i can fix this?

I think the only way to fix it would be to set a different window graphic when it's minimised and then reset it when it's maximised but if anyone can think of a better solution I'd really like to hear it.

Admins 07-09-2007 09:41 PM

Currently the width of the minimized window is always 98 pixels (don't ask me why), and the height is title height + bottom height.

contiga 07-09-2007 11:48 PM

Euh.. that's not allright eah..

zokemon 07-10-2007 12:20 AM

Since you know the window will never be resized past your minsize, just add something like this (obviously replacing GuiWindowCtrl with the name of your window GUI):

NPC Code:
function GuiWindowCtrl.onResize(nw, nh) {
if (nw == 98) GuiWindowCtrl.width = GuiWindowCtrl.minsize[0];
}



Or to be more safe (in case this strange 98 number is changed):

NPC Code:
function GuiWindowCtrl.onResize(nw, nh) {
if (nw < GuiWindowCtrl.minsize[0]) GuiWindowCtrl.width = GuiWindowCtrl.minsize[0];
}



All times are GMT +2. The time now is 06:29 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.