Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Savename window  (Read 5169 times)

0 Members and 1 Guest are viewing this topic.

kelmer

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 20
    • View Profile
Savename window
« on: July 28, 2005, 11:54:56 AM »

Hi all!

Got a new question: Is it neccesary to have an extra savename window? Can I just "convert" the slot button in an editor button so that the player can write it's savegames names right in the save window? (I could use, I guess, an editor button in the first place, but it does not have a IMAGE_HOVER attribute, which I would like to use).

Also, is it possible to change the "typing cursor" (the flickering one)?

Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Savename window
« Reply #1 on: July 28, 2005, 02:06:07 PM »

Is it neccesary to have an extra savename window?
No, it's not necessary at all, you can use any window layout you want.

Can I just "convert" the slot button in an editor button so that the player can write it's savegames names right in the save window? (I could use, I guess, an editor button in the first place, but it does not have a IMAGE_HOVER attribute, which I would like to use).
You could simply hide the button when it's clicked and display an editor in its place.


Also, is it possible to change the "typing cursor" (the flickering one)?
Editor controls provide a CursorChar property allowing you to use any character to represent the cursor. If you want to use some special graphics, you'd have to include it in your font.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

kelmer

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 20
    • View Profile
Re: Savename window
« Reply #2 on: July 28, 2005, 02:26:49 PM »


You could simply hide the button when it's clicked and display an editor in its place.

Within the "on "save"" event on save.script I can set self.Visible to false to hide the button, but how can I load the editor instead? Should I use another window with just the editor line to put it before the (hidden) button?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Savename window
« Reply #3 on: July 29, 2005, 11:20:56 AM »

Within the "on "save"" event on save.script I can set self.Visible to false to hide the button, but how can I load the editor instead? Should I use another window with just the editor line to put it before the (hidden) button?
There are several ways and it's up to you which one you'll prefer. You can 1) open another window 2) have the editor as a hidden control and only show/position it when it's needed 3) dynamically create and editor when it's needed ...
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

kelmer

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 20
    • View Profile
Re: Savename window
« Reply #4 on: July 30, 2005, 02:53:49 PM »

Alright, I'm trying to create the editor dinamically when pressing the button "save". This is what I tried first:

Code: [Select]
on "save"
{
  if(SelectedSlot >= 0)
  {
   
    var slot=self.GetWidget(SelectedSlot);
    slot.Visible=false; //Set the current slot button to not visible in order to put the editor before
    var Editor=self.CreateEditor("desc"); //creation of the editor
    Editor.X=slot.X;  //with the same position and size as the original slot button.
    Editor.Y=slot.Y;
    Editor.Width=slot.Width;
    Editor.Height=slot.Height;

    if(Game.IsSaveSlotUsed(SelectedSlot)) //if the slot was already used, we copy the description
    {
    Editor.Text = Game.GetSaveSlotDescription(SelectedSlot);
    }
    SetState();
    on "Keypress"
{
  if(Keyboard.KeyCode==VK_ESCAPE){
                       self.Close();
    }
    else if(Keyboard.KeyCode==VK_RETURN){
  Game.SaveGame(SelectedSlot,Editor.Text);
    }
}
  }
}

But then I realised that you cannot use an event handler within another event handler, so how can I do to make the program save the game when pressing "RETURN"? (also, any other errors you detect on the code, please feel free to correct them :))
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Savename window
« Reply #5 on: July 31, 2005, 08:21:57 AM »

But then I realised that you cannot use an event handler within another event handler, so how can I do to make the program save the game when pressing "RETURN"?
You'll have to use a variable. Set it to true when the editor is created and later in the Keypress handler check the variable and if it's true, save the game.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

kelmer

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 20
    • View Profile
Re: Savename window
« Reply #6 on: August 02, 2005, 10:02:43 AM »

I know it's been asked before, but maybe new versions have changed it: can I add a small clock animation when loading or saving?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Savename window
« Reply #7 on: August 02, 2005, 10:13:52 AM »

Not animation, only static images + the progress bar. They can be set in ProjectMan (save/load screen).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.044 seconds with 24 queries.