mirror of
https://github.com/scummvm/scummvm-tutorial.git
synced 2026-05-21 05:40:52 +00:00
104 lines
3.0 KiB
Plaintext
104 lines
3.0 KiB
Plaintext
// main global script file
|
|
|
|
#sectionstart game_start // DO NOT EDIT OR REMOVE THIS LINE
|
|
function game_start() // called when the game starts, before the first room is loaded
|
|
{
|
|
mouse.Mode = 1;
|
|
}
|
|
#sectionend game_start // DO NOT EDIT OR REMOVE THIS LINE
|
|
|
|
|
|
#sectionstart repeatedly_execute // DO NOT EDIT OR REMOVE THIS LINE
|
|
function repeatedly_execute()
|
|
{
|
|
// put anything you want to happen every game cycle here
|
|
}
|
|
#sectionend repeatedly_execute // DO NOT EDIT OR REMOVE THIS LINE
|
|
|
|
|
|
#sectionstart on_key_press // DO NOT EDIT OR REMOVE THIS LINE
|
|
function on_key_press(int keycode) // called when a key is pressed. keycode holds the key's ASCII code
|
|
{
|
|
if (IsGamePaused()==1) keycode=0; // game paused, so don't react to keypresses
|
|
if (keycode==17) QuitGame(1); // Ctrl-Q
|
|
if (keycode==363) SaveGameDialog(); // F5
|
|
if (keycode==365) RestoreGameDialog(); // F7
|
|
if (keycode==367) RestartGame(); // F9
|
|
if (keycode==434) SaveScreenShot("scrnshot.pcx"); // F12
|
|
if (keycode==19) Debug(0,0); // Ctrl-S, give all inventory
|
|
if (keycode==22) Debug(1,0); // Ctrl-V, version
|
|
if (keycode==1) Debug(2,0); // Ctrl-A, show walkable areas
|
|
if (keycode==24) Debug(3,0); // Ctrl-X, teleport to room
|
|
}
|
|
#sectionend on_key_press // DO NOT EDIT OR REMOVE THIS LINE
|
|
|
|
|
|
#sectionstart on_mouse_click // DO NOT EDIT OR REMOVE THIS LINE
|
|
function on_mouse_click(MouseButton button) // called when a mouse button is clicked. button is either LEFT or RIGHT
|
|
{
|
|
if (IsGamePaused() == 1) // Game is paused, so do nothing (ie. don't allow mouse click)
|
|
{
|
|
}
|
|
else if (button == eMouseLeft)
|
|
{
|
|
ProcessClick(mouse.x,mouse.y, mouse.Mode);
|
|
}
|
|
else // right-click, so cycle cursor
|
|
{
|
|
mouse.Mode = 1;
|
|
}
|
|
}
|
|
#sectionend on_mouse_click // DO NOT EDIT OR REMOVE THIS LINE
|
|
|
|
|
|
#sectionstart interface_click // DO NOT EDIT OR REMOVE THIS LINE
|
|
function interface_click(int interface, int button)
|
|
{
|
|
// OBSOLETE, NOT USED IN AGS 2.7 AND LATER VERSIONS
|
|
}
|
|
#sectionend interface_click // DO NOT EDIT OR REMOVE THIS LINE
|
|
|
|
function dialog_request(int param) {
|
|
}
|
|
|
|
function btn_addgame_cancel_OnClick(GUIControl *control, MouseButton button)
|
|
{
|
|
g_addGame.Visible = false;
|
|
g_main.Visible = true;
|
|
}
|
|
|
|
function btn_main_addGame_OnClick(GUIControl *control, MouseButton button)
|
|
{
|
|
g_addGame.Visible = true;
|
|
g_msgBox_SAF.Visible = true;
|
|
|
|
g_main.Visible = false;
|
|
}
|
|
function btn_changeLanguage_OnClick(GUIControl *control, MouseButton button)
|
|
{
|
|
|
|
switch (Game.TranslationFilename) {
|
|
case "":
|
|
Game.ChangeTranslation("French");
|
|
break;
|
|
case "French":
|
|
Game.ChangeTranslation("German");
|
|
break;
|
|
case "German":
|
|
Game.ChangeTranslation("");
|
|
break;
|
|
}
|
|
|
|
label_lang_file.Text = String.Format("<%s>", Game.TranslationFilename);
|
|
label_lang_font.Text = String.Format("Font %i", Game.NormalFont);
|
|
}
|
|
|
|
function g_msgBox_SAF_alt_OnClick(GUIControl *control, MouseButton button)
|
|
{
|
|
//g_msgBox_SAF.Visible = false;
|
|
}
|
|
function btn_msgbox_SAF_OnClick(GUIControl *control, MouseButton button)
|
|
{
|
|
g_msgBox_SAF.Visible = false;
|
|
}
|