Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: PlushDez on September 10, 2007, 03:25:00 PM

Title: Question about LeftRelease event
Post by: PlushDez on September 10, 2007, 03:25:00 PM
Is it normal for WME to handle "LeftRelease" event on window only when window in SystemExclusive mode? If my window not in SystemExclusive mode "LeftRelease" event doesn't work  :( ???
Title: Re: Question about LeftRelease event
Post by: Mnemonic on September 10, 2007, 03:46:35 PM
No, it's not normal. Can you post your script and/or more info?
Title: Re: Question about LeftRelease event
Post by: PlushDez on September 10, 2007, 03:59:06 PM
It's not my script :) it's WME_Demo (1.7.003)

I only add this small code to game.script

Code: WME Script
  1. on "LeftRelease"
  2. {
  3. Game.Msg("LF RELEASE ON GAME!");
  4. }
  5.  

and this one to mainmenu.script

Code: WME Script
  1. on "LeftRelease"
  2. {
  3.  Game.Msg("LF RELEASE ON WINDOW!");
  4. }
  5.  

Now I get "LF RELEASE ON WINDOW" message only when this window in SystemExclusive, when not I get "LF RELEASE ON GAME!"
Title: Re: Question about LeftRelease event
Post by: Mnemonic on September 10, 2007, 09:03:03 PM
Yup, because if a window runs in system exclusive mode, the game.script it suspended, so the window gets the event.
If you want the window to always receive the event, simply reroute it from game.script by adding something like this (to game.script):

Code: WME Script
  1. on "LeftRelease"
  2. {
  3.   var ActObj = Game.ActiveObject;
  4.   if(ActObj != null) ActObj.ApplyEvent("LeftRelease");
  5. }
  6.  
Title: Re: Question about LeftRelease event
Post by: PlushDez on September 11, 2007, 12:10:29 AM
 ;)Thanx