Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Another GUI question (https://forums.graalonline.com/forums/showthread.php?t=134257985)

Jimbo33 02-12-2010 01:34 AM

Another GUI question
 
I'm using a GUI that's opening when 'w' is pressed,
I want it to close when 'w' is pressed again, so players don't
have to move their mouse up to the little red x button.

Here's what I used:

PHP Code:

//#CLIENTSIDE
function onKeyPressed(codekey){
 if (
key == "w") {
 
onOpenStats();
 }
}

function 
onOpenStats() {
  new 
GuiWindowCtrl("Stats_Window1") {
 and 
blabla all the gui scripts... 

Please help, thanks! :)

DustyPorViva 02-12-2010 01:42 AM

Like I explained in this thread: http://forums.graalonline.com/forums...hp?t=134257982

You should be hiding/showing these GUI's instead of destroying them.

In that case:

PHP Code:

function onKeyPressed(codekey){
 if (
key == "w"Stats_Window1.visible = !Stats_Window1.visible;



Jimbo33 02-12-2010 01:51 AM

I tried what you did:

it hides the GUI, but when I press w again I can't reopen it..


EDIT: nevermind! I had destroyonhide set to true x)

Thanks a lot! :)


All times are GMT +2. The time now is 11:31 AM.

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