29
« on: 20 Jan 2011, 15:50 »
Didn't see the last comments until now...
@Khris: Well, this is for the same interface you already helped me so much with, so the game is keyboard controlled. And at least to begin with I'll keep it like that...
What I want is just a simple popup GUI in top of screen (like the one in the default game, except this one should become visible at key press and not mouse move to top of screen).
Then I suppose it should be made with buttons containing normal graphics and mouse-over graphics.
A default button is highlighted (that is set to mouse-over graphic) when the GUI becomes visible, and then by pressing left- or right-key player can switch between the buttons.
The buttons should probably just be "save", "load" and "quit" I think.
Save and load both opens a new GUI, controlled in the same way - except switching up and down instead of left and right, and then player just custom name the savegames like standard (this is basically a standard adventure game story-wise, so it makes more sense to name the savegames instead of automatically naming them time and date).
Quit just opens a "yes" or "no" GUI.
And that's it.
BTW I want my Inventory window to be the same way, just in the bottom of the screen...
----------
EDIT:
I came up with this code trying to make at least the switches available (the mouse.SetBounds values are the button areas - perhaps the method is a little (or very) clumsy, but it was the best I could come up with at the moment)... I put it in the function on_key_press(eKeyCode keycode) section of the globalscript.
[code]
bool SaveGameButtonActive = false;
bool LoadGameButtonActive = false;
bool QuitGameButtonActive = false;
if (keycode == eKeyEscape){
if (gIconbar.Visible == false){
gIconbar.Visible = true;
PauseGame();
mouse.SetBounds(200, 10, 210, 20);
SaveGameButtonActive = true;
}
else if (gIconbar.Visible == true){
gIconbar.Visible = false;
UnPauseGame();
}
}
if (keycode == eKeyLeftArrow){
if (SaveGameButtonActive == true){
mouse.SetBounds(260, 10, 270, 20);
SaveGameButtonActive = false;
QuitGameButtonActive = true;
}
else if (LoadGameButtonActive == true){
mouse.SetBounds(200, 10, 210, 20);
LoadGameButtonActive = false;
SaveGameButtonActive = true;
}
else if (QuitGameButtonActive == true){
mouse.SetBounds(230, 10, 250, 20);
QuitGameButtonActive = false;
LoadGameButtonActive = true;
}
else {}
}
if (keycode == eKeyRightArrow){
if (SaveGameButtonActive == true){
mouse.SetBounds(230, 10, 250, 20);
SaveGameButtonActive = false;
LoadGameButtonActive = true;
}
else if (LoadGameButtonActive == true){
mouse.SetBounds(260, 10, 270, 20);
LoadGameButtonActive = false;
QuitGameButtonActive = true;
}
else if (QuitGameButtonActive == true){
mouse.SetBounds(200, 10, 210, 20);
QuitGameButtonActive = false;
SaveGameButtonActive = true;
}
else {}
}
[/code]
It doesn't work however. I can't figure out why...
It doesn't respond to arrow key press at all. I don't know if I'm using the bools correctly?