Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Hiding all gui controls (https://forums.graalonline.com/forums/showthread.php?t=78862)

vigilant_death2 02-27-2008 04:38 AM

Hiding all gui controls
 
Is there a way to hide every gui control at once?
I am making a replica of the offline tile editor and want it to go into a similar mode when the player presses F4 so i will need to hide all of them o_O

cbk1994 02-27-2008 04:39 AM

something like
PHP Code:

for ( temp.GraalControl.controls )
{
  
temp.n.hide();


may work.

vigilant_death2 02-27-2008 04:44 AM

Lol I guess I can do GraalControl.hide() but was hoping for a better method ^_^

cbk1994 02-27-2008 04:54 AM

Quote:

Originally Posted by vigilant_death2 (Post 1376741)
Lol I guess I can do GraalControl.hide() but was hoping for a better method ^_^

Like I said, go through all of GraalControl's controls, and hide them individually.

vigilant_death2 02-27-2008 05:13 AM

Ah yes I see what you meant now makes more sense :P ty

Inverness 02-27-2008 11:22 AM

Just so you know, GUIContainer is the top-level control, not GraalControl. You probably don't want to hide stuff outside of GraalControl though.

zokemon 02-27-2008 12:32 PM

GraalControl.hide() would be more efficient and most likely better.

cbk1994 02-27-2008 11:26 PM

Quote:

Originally Posted by zokemon (Post 1376778)
GraalControl.hide() would be more efficient and most likely better.

I would tend to agree ... wasn't sure if it was locked or anything so I didn't suggest it.

Problem would be if you go back to show everything, then things which where hidden appear. I guess you could have an array ... but ehh ... easier to use GraalControl.hide();

Tolnaftate2004 02-28-2008 02:45 AM

Quote:

Originally Posted by cbkbud (Post 1376814)
Problem would be if you go back to show everything, then things which where hidden appear. I guess you could have an array ... but ehh ... easier to use GraalControl.hide();

I don't think this is an issue seeing all controls inherit their own 'visible' property.

cbk1994 02-28-2008 03:36 AM

Quote:

Originally Posted by Tolnaftate2004 (Post 1376836)
I don't think this is an issue seeing all controls inherit their own 'visible' property.

Yes, I'm saying that if you hid each individually, you may have problems when it comes to reshowing them :)

zokemon 02-28-2008 07:59 PM

Quote:

Originally Posted by cbkbud (Post 1376846)
Yes, I'm saying that if you hid each individually, you may have problems when it comes to reshowing them :)

Which is exactly why you use GraalControl.hide();
I've made many GUIs outside of GraalControl for editors and such and I know that GraalControl.hide() is most likely your best bet.

Crow 02-28-2008 08:47 PM

Quote:

Originally Posted by zokemon (Post 1376920)
Which is exactly why you use GraalControl.hide();
I've made many GUIs outside of GraalControl for editors and such and I know that GraalControl.hide() is most likely your best bet.

How would you create a new GUI Control outside of GraalControl though?

xAndrewx 02-28-2008 08:53 PM

PHP Code:

object.isexternal boolean

Not yet implemented.

cbk1994 02-29-2008 04:21 AM

Quote:

Originally Posted by xAndrewx (Post 1376930)
PHP Code:

object.isexternal boolean

Not yet implemented.

Ehh ... isn't that players[i].external ... meaning if they are IRC or on another server?

You can just do something like this:

PHP Code:

with GUIContainer )
{
  new 
GuiWindowCtrl() // etc


or I believe
PHP Code:

new GuiWindowCtrl"s" )
{
  
}
GUIContainer.addControl); 


zokemon 02-29-2008 05:23 AM

Quote:

Originally Posted by cbkbud (Post 1377017)
Ehh ... isn't that players[i].external ... meaning if they are IRC or on another server?

You can just do something like this:

PHP Code:

with GUIContainer )
{
  new 
GuiWindowCtrl() // etc


or I believe
PHP Code:

new GuiWindowCtrl"s" )
{
  
}
GUIContainer.addControl); 


Exactly. I often do:
PHP Code:

new GuiWindowCtrl("foo") {
  
GUIContainer.addControl(this);



Crow 02-29-2008 02:58 PM

Thanks you two.


All times are GMT +2. The time now is 10:23 AM.

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