#include "scripts\base.inc"
#include "scripts\keys.inc"
// store some of the game's attributes in global variables for convenience
// load the right-click menu
// load the "caption" window
// we need to store reference to window in global variable because we will use it in other script
// inventory dark window does exist, but it is not visible
InventoryWinDark.
SetImage("interface\inventory.png");
InventoryWinDark.
Y =
510;
global MenuObject = null;
// load our main actor
actor = molly;
// run the "game loop" script
// which scene to load?
////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
// what did we click?
if(ActObj!=null)
{
// clicking an inventory item
{
}
// using an inventory item on another object
{
else actor.
Talk("I can't use these things together.");
}
// just a simple click
}
// else propagate the LeftClick event to a scene
else
{
}
}
////////////////////////////////////////////////////////////////////////////////
on "RightClick"
{
// if inventory item selected? deselect it
return;
}
// is the righ-click menu visible? hide it
else if(ActObj!=null)
{
// if the clicked object can handle any of the "verbs", display the right-click menu
{
// store the clicked object in a global variable MenuObject
// adjust menu's position
if(WinMenu.
X <
0) WinMenu.
X =
0;
if(WinMenu.
Y<
0) WinMenu.
Y =
0;
// and show the right-click menu
// stop the actor from whatever he was going to do
}
// no verbs supported, no menu is needed; just send the RightClick event to the object
}
}
////////////////////////////////////////////////////////////////////////////////
on "Keypress"
{
// on Esc or F1 key
{
// load and display the main menu window
var WinMainMenu =
Game.
LoadWindow("interface\system\mainmenu.window");
}
}
////////////////////////////////////////////////////////////////////////////////
on "QuitGame"
{
// on Alt+F4 (window close)
// load and display the quit confirmation window
// and if the user selected Yes
if(WinQuit.xResult)
{
// quit the game
}
// otherwise just unload the quit window from memory
}