Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-12-2010, 01:34 AM
Jimbo33 Jimbo33 is offline
****
Jimbo33's Avatar
Join Date: Jan 2008
Location: Canada
Posts: 74
Jimbo33 is on a distinguished road
Send a message via AIM to Jimbo33 Send a message via MSN to Jimbo33
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!
Reply With Quote
  #2  
Old 02-12-2010, 01:42 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
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;

Reply With Quote
  #3  
Old 02-12-2010, 01:51 AM
Jimbo33 Jimbo33 is offline
****
Jimbo33's Avatar
Join Date: Jan 2008
Location: Canada
Posts: 74
Jimbo33 is on a distinguished road
Send a message via AIM to Jimbo33 Send a message via MSN to Jimbo33
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!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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