Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: SOLO on June 22, 2012, 03:46:42 PM

Title: Menu not closing
Post by: SOLO on June 22, 2012, 03:46:42 PM
Hi,
 I hav created an options menu and all is working apart from when I press ESC to close the window or click on RETURN (which is named close in the window structure) the options menu(window) closes then opens up again, if I click on close or ESC again it closes and stays closed.

I am using the -

 
on "close"
{
Game.PlaySound("sounds\menuclose.ogg"); 
self.Close();
}

Method to close the window.


Any ideas?

Thanks

Solo
Title: Re: Menu not closing
Post by: eborr on June 23, 2012, 01:08:40 PM
try

this.Close();
Title: Re: Menu not closing
Post by: Mnemonic on June 23, 2012, 01:14:11 PM
You can use either "this" or "self", they are equivalent.
SOLO's script is okay; if the window reopens, the problem is elsewhere, namely in the script that loads the window.
Title: Re: Menu not closing
Post by: SOLO on June 25, 2012, 04:23:54 PM
Ah found the issue, I had a duplicate menu script which was in the main path that caused the problem, removing that and all menus working fine now.

Thanks for the pointer.  :)

Regards

SOLO