Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Open window menu  (Read 9216 times)

0 Members and 1 Guest are viewing this topic.

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Open window menu
« on: June 16, 2007, 04:36:58 PM »

Hi, I have a abutton in the screen interface. Well, I want when the button is pressed a window appear. When I press the button nothing happens. Help me please.

I type this code in the menu.script:

Quote
on "btnOpciones"
{
    var WinMainMenu = Game.LoadWindow("interface\SCUP\opciones.window");
    WinMainMenu.Center();
    WinMainMenu.GoSystemExclusive();
    Game.UnloadObject(WinMainMenu);

}

This is the definition of button on opciones.button:
Quote
BUTTON
{
  IMAGE = "interface\SCUP\sprites\BOTON1-1.png"
  IMAGE_HOVER = "interface\SCUP\sprites\BOTON1-1.png"
  IMAGE_PRESS = "interface\SCUP\sprites\BOTON1-2.png"
  PARENT_NOTIFY = TRUE
  WIDTH = 121
  HEIGHT = 30
  NAME = "btnOpciones"
}

What is the problem? No errors appear.
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Open window menu
« Reply #1 on: June 16, 2007, 07:02:16 PM »

oops. misread

Anything in wme.log? Are you sure the menu.script file is attached to your window?
« Last Edit: June 16, 2007, 07:03:48 PM by metamorphium »
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Re: Open window menu
« Reply #2 on: June 16, 2007, 08:52:02 PM »

Nothing in wme.log. In the menu.window I have this code:

Quote
WINDOW
{
  IMAGE = "interface\SCUP\sprites\barraadalt.png"
  SCRIPT = "interface\SCUP\menu.script"
  MENU = FALSE
  X = 0
  Y = 0
 
  BUTTON
   {
   IMAGE = "interface\SCUP\sprites\BOTON1-1.png"
   IMAGE_HOVER = "interface\SCUP\sprites\BOTON1-1.png"
   IMAGE_PRESS = "interface\SCUP\sprites\BOTON1-2.png"
   WIDTH = 121
   HEIGHT = 30
   X = 757
        Y = 1
   NAME = "btnOpciones"
   TEXT=OPCIONES
   }

And the image when I press the button is Ok, I don't know the problem
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Open window menu
« Reply #3 on: June 16, 2007, 09:37:23 PM »

try putting

Game.Msg("Pressed!");

in your btnOpciones event to see if it gets called.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Open window menu
« Reply #4 on: June 16, 2007, 09:41:26 PM »

I don't see the "PARENT_NOTIFY = TRUE" line in the window definition...? (even though it's present in your original post). Also, there's one closing } missing, I suppose you just didn't paste everything.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Open window menu
« Reply #5 on: June 16, 2007, 09:42:58 PM »

just a minute! in your last paste there's

PARENT_NOTIFY = TRUE

missing in button definition
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Re: Open window menu
« Reply #6 on: June 17, 2007, 09:45:45 AM »

I put the Game.Msg("Pressed!");  sentence but nothing happens. This is my actual code:

Menu.window:
Quote
WINDOW
{
  IMAGE = "interface\SCUP\sprites\barraadalt.png"
  SCRIPT = "interface\SCUP\menu.script"
  MENU = FALSE
  X = 0
  Y = 0
 
  BUTTON
   {
   IMAGE = "interface\SCUP\sprites\BOTON1-1.png"
   IMAGE_HOVER = "interface\SCUP\sprites\BOTON1-1.png"
   IMAGE_PRESS = "interface\SCUP\sprites\BOTON1-2.png"
   WIDTH = 121
   HEIGHT = 30
   X = 757
        Y = 1
   NAME = "btnOpciones"
   TEXT=OPCIONES
   }
}

menu.script:
Quote
on "btnOpciones"
{
    Game.Msg("Pressed!");
    var WinMainMenu = Game.LoadWindow("interface\SCUP\opciones.window");
    WinMainMenu.Center();
    WinMainMenu.Visible=true;
    WinMainMenu.GoSystemExclusive();
    Game.UnloadObject(WinMainMenu);

}

Nothing in wme.log
Logged

Nihil

  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re: Open window menu
« Reply #7 on: June 17, 2007, 10:09:49 AM »

Did you try to put PARENT_NOTIFY = TRUE in the button-definition?

edit: Sorry, typo ;-)
« Last Edit: June 17, 2007, 04:48:08 PM by Nihil »
Logged

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Re: Open window menu
« Reply #8 on: June 17, 2007, 11:43:12 AM »

If I put ARENT_NOTIFIY = TRUE an error appears. My button definition is inside the menu.window file:

Quote
WINDOW
{
  IMAGE = "interface\SCUP\sprites\barraadalt.png"
  SCRIPT = "interface\SCUP\menu.script"
  MENU = FALSE
  X = 0
  Y = 0
 
  BUTTON
   {
   IMAGE = "interface\SCUP\sprites\BOTON1-1.png"
   IMAGE_HOVER = "interface\SCUP\sprites\BOTON1-1.png"
   IMAGE_PRESS = "interface\SCUP\sprites\BOTON1-2.png"
   WIDTH = 121
   HEIGHT = 30
   X = 757
        Y = 1
   NAME = "btnOpciones"
   TEXT=OPCIONES
   }
}
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Open window menu
« Reply #9 on: June 17, 2007, 11:50:41 AM »

Because you misspelled it. It's: PARENT_NOTIFY = TRUE as mentioned several times in this thread.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Re: Open window menu
« Reply #10 on: June 18, 2007, 08:41:37 AM »

If I insert PARENT_NOTIFY = TRUE in my window and buttons definition:

Quote
WINDOW
{
  IMAGE = "interface\SCUP\sprites\barraadalt.png"
  SCRIPT = "interface\SCUP\menu.script"
  MENU = FALSE
  X = 0
  Y = 0
 
  BUTTON
   {
   IMAGE = "interface\SCUP\sprites\BOTON1-1.png"
   IMAGE_HOVER = "interface\SCUP\sprites\BOTON1-1.png"
   IMAGE_PRESS = "interface\SCUP\sprites\BOTON1-2.png"
   PARENT_NOTIFY = TRUE
   WIDTH = 121
   HEIGHT = 30
   X = 757
   Y = 1
   NAME = "btnOpciones"
   TEXT=OPCIONES
   }

The wme says that there's an error in menu.window. Now I'm not using a .BUTTON script, as you can see in the code I define my button inside my window definition. If this is the problem, how can I resolve it, can anyone show me an example to open a window when a button is pressed?
Logged

Nihil

  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re: Open window menu
« Reply #11 on: June 18, 2007, 10:15:49 AM »

The last bracket is missing, maybe that causes the error?

If not, can you perhaps upload the project somewhere so that we can have a look at the code?

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Re: Open window menu
« Reply #12 on: June 18, 2007, 07:50:42 PM »

Here you can download my project. The button is on the up-right.

www.lacosaweb.com/WME/Scup1.rar

I hope you can help me. Thanks.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Open window menu
« Reply #13 on: June 18, 2007, 08:16:18 PM »

So... if I add the PARENT_NOTIFY line to menudalt.window, the button works ok (the second window pops up).
The error in the log says: Error opening file 'interface\SCUP\SCUP.script', which is true, because there's no such file in your project.

So I STILL fail to see what your problem actually is...
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Re: Open window menu
« Reply #14 on: June 18, 2007, 09:33:53 PM »

Oh, true I do it now and this works. Sorry I don't know what happened but thanks a lot for your help and your time.

Thanks.
Logged
 

Page created in 0.038 seconds with 22 queries.