Game authors and players, please read this thread!

Author Topic: Iterating through GUIs to set them not visible.  (Read 179 times)  Share 

I'm wondering if there's an easy way of iterating through GUIs and setting them all to be not visible (otherwise I can theoretically have save and load dialogues be enabled at the same time, for example).
Stuart "Sslaxx" Moore.

barefoot

  • Guitar Man
    • I can help with web design
    •  
Re: Iterating through GUIs to set them not visible.
« Reply #1 on: 10 Nov 2010, 14:35 »
Hi

do you mean something like this? The folllowing is something i have:

[code]
gSymbols.Visible = false;
gNotes.Visible = false;
gClose.Visible = false;
gRun.Visible = false;
gWalk.Visible = false;
gInv.Visible = false;
gsave.Visible = false;
gGui4.Visible = true;
gload.Visible = true;
gIconbar2.Visible = false;
[/code]

barefoot
I May Not Be Perfect but I Have A Big Heart ..

Calin Leafshade

  • AGS Project Admins
  • Long live King Cat!
    • I can help with AGS tutoring
    •  
    • I can help with voice acting
    •  
  • Calin Leafshade worked on a game that was nominated for an AGS Award!Calin Leafshade worked on a game that won an AGS Award!
Re: Iterating through GUIs to set them not visible.
« Reply #2 on: 10 Nov 2010, 14:37 »
i think there is a Gui array somewhere.

something like Game.Guis[]

EDIT: No wait its a global array.

so you can just do

[code]
int i = 0;
while (i < Game.GuiCount){

gui.Visibile = false
}
[/code]
« Last Edit: 10 Nov 2010, 14:39 by Calin Leafshade »

Leon: You need the sword first before you can get the monkey.

Re: Iterating through GUIs to set them not visible.
« Reply #3 on: 10 Nov 2010, 14:46 »
Ah, case sensitivity strikes again (was using GUI instead, doh). Cheers, Calin!
Stuart "Sslaxx" Moore.

monkey_05_06

  • AGS Project Admins
  • Has left the building.
Re: Iterating through GUIs to set them not visible.
« Reply #4 on: 11 Nov 2010, 03:41 »
Just to be completely clear, GUI (all caps) refers to the type whereas gui (all lower-case) refers to the global array of instances of the GUI type.
Let's be honest. Most people suck at coding. I suck at coding, but at least my code is readable. To Hell with anyone too lazy to maintain consistent formatting in their code. I could deal with bad interfaces and structure if I could even read your horrible code. And that's putting it nicely. -monkey