Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: henrikes on February 03, 2020, 01:03:22 AM

Title: How to detect the layout is presenting the display menu?
Post by: henrikes on February 03, 2020, 01:03:22 AM
Hi,

I guess the title says it all.... How can my layout detect that its presenting the display menu?

Thanks in advance.
Title: Re: How to detect the layout is presenting the display menu?
Post by: zpaolo11x on February 03, 2020, 02:17:42 AM
The way I do it is this: in a transition response routine you can add the following check:

Code: [Select]
if ((ttype == Transition.ShowOverlay) && (var == Overlay.Displays)) {
// DISPLAY MENU IS BEING TURNED ON
}

I think there's also an "is up" option but I didn't know much about that when coding my layout :D
Title: Re: How to detect the layout is presenting the display menu?
Post by: henrikes on February 10, 2020, 11:39:41 PM
The way I do it is this: in a transition response routine you can add the following check:

Code: [Select]
if ((ttype == Transition.ShowOverlay) && (var == Overlay.Displays)) {
// DISPLAY MENU IS BEING TURNED ON
}

I think there's also an "is up" option but I didn't know much about that when coding my layout :D

I try that, but i cant get it to work. I encapsulated that in a transition callback and all it did was depending on your IF statement it would chang the value of a boolean variable.....



Title: Re: How to detect the layout is presenting the display menu?
Post by: PocketChange on February 18, 2020, 11:30:27 AM
On the Displays Menu layout options you can set the prompt name of the display. For example mine is "Main Menu"

Code: [Select]
if (fe.list.name == "Main Menu") {
//See if this works
}