Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Close All Open GUIs? (https://forums.graalonline.com/forums/showthread.php?t=134268300)

baseman101 06-05-2013 03:51 AM

Close All Open GUIs?
 
I work on a server, but there is a problem I have where I need to close all open GUIs. How would I go around doing so? Thanks. Example:

PHP Code:

//#CLIENTSIDE
Window1.destroy();
Window2.destroy();
Window3.destroy(); 

=>
PHP Code:

//#CLIENTSIDE
for(temp.windows allopenwindows) {
  
temp.windows.destroy();



fowlplay4 06-05-2013 04:35 AM

It's either GraalControl or GUIContainer (not sure...), but you can do it like this:

PHP Code:

for (temp.ctrlGUIContainer.controls) {
  if (
temp.ctrl.name.pos("Window") >= 0) {
    
temp.ctrl.hide();
  }



baseman101 06-05-2013 04:41 AM

Thank you, I will test it straight away.

cbk1994 06-05-2013 05:00 AM

Quote:

Originally Posted by fowlplay4 (Post 1718845)
It's either GraalControl or GUIContainer (not sure...)

GraalControl is a child of GUIContainer. GUIContainer is the entire window and contains stuff like the trial upgrade nag bar and the task bar. GraalControl contains just the game. In 99% of circumstances you will only need to deal with GraalControl. In this case he wants GraalControl (all windows are children of GraalControl by default).

Additionally, it might be more robust to check:

PHP Code:

if (temp.ctrl.objectType() == "GuiWindowCtrl") { 


BlueMelon 06-05-2013 08:53 PM

This tool might be of use to you or others in the future.

GUI Explorer - by fp4
http://forums.graalonline.com/forums...hp?t=134257984


All times are GMT +2. The time now is 08:56 PM.

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