It seems that MouseEntry, on its own loads the window and that's the end of it. But introduce a MouseLeave event to the same script, and the MouseLeave code runs, while the mouse is still over the entity... huh? The MouseEntry then runs again, and round and round we go, "Loading window, Closing window". I thought the mouse had to leave for MouseLeave to run? Here's the whole script. Grateful for your spotting any errors. Cheers.
if(Translate.Loaded == null)
{
Translate.Loaded = false;
}
on "MouseEntry"
{
this.Interactive = false;
if(Translate.Loaded != true)
{
if(Game.Language != "English")
{
Translate.Message = "FRIDAY";
Game.Msg("loading window");
Translate.Window = Game.LoadWindow("interface\Localization\Translator.window");
Translate.Loaded = true;
Sleep(200);
}
}
this.Interactive = true;
}
on "MouseLeave"
{
this.Interactive = false;
if(Translate.Loaded == true)
{
Game.Msg("closing window");
Translate.Loaded = false;
var win = Translate.Window;
win.Close();
Sleep(200);
}
this.Interactive = true;
}