Files
scummvm-tutorial/script.slu
T
2023-02-22 10:01:48 -05:00

136 lines
3.3 KiB
Plaintext

var selection = NULL;
var gameScreen = "screen_main";
var gameMode = "mode_basic";
var button_questionMarkAnim = anim('questionmark.duc', wait(4, 0), wait(4, 1), wait(4, 2), wait(4, 3));
var button_rectangleHighlightAnim = anim('rectanglehighlight.duc', 0);
var cursor_scummvmAnim = anim('democursor.duc', 0);
var cursor_questionMarkAnim = anim('questionmark_small.duc', 0);
sub init () {
alignStatus (0);
setStatusColour(100, 100, 100);
setFont ('demofont_small.duc', "ÉABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"'/?!.,;:()*%& -~`@", 12);
#no perspective scale
setScale (0, 0);
onFocusChange (focusChange);
onLeftMouse (leftMouse);
onRightMouse (rightMouse);
callEvent (init_reset, basicEvents);
}
sub focusChange(whichChange) {
selection = whichChange;
}
sub rightMouse() {
callEvent (init_reset, basicEvents);
if (gameMode == "mode_tutorial") {
gameMode = "mode_basic";
removeAllCharacters();
enableTutorialButton();
setCursor (cursor_scummvmAnim);
}
}
sub leftMouse() {
#User is in the tutorial game mode
if (selection) {
if (gameMode == "mode_tutorial") {
if (! callEvent (selection, tutorialEvents)) ;
}
#User is not in the tutorial mode
if (gameMode == "mode_basic") {
if (! callEvent (selection, basicEvents)) ;
}
}
}
objectType info("") {
}
objectType init_reset("") {
}
objectType hotspot_tutorialMode("Tutorial Mode") {
event info {
statusText ("Switch to get detailed information");
}
}
objectType hotspot_start("Button Start") {
event info {
statusText ("Start selected game");
}
}
objectType hotspot_load("Button Load") {
event info {
statusText ("Load saved game for selected game");
}
}
objectType hotspot_addGame("Button Add Game") {
event info {
statusText ("add games to the list");
}
}
sub enableTutorialButton() {
addCharacter (hotspot_tutorialMode, 50, 65, button_questionMarkAnim);
}
sub showHighlights() {
if (gameScreen == "screen_main") {
addCharacter (visual_mark, 509, 188, button_rectangleHighlightAnim);
addCharacter (visual_mark, 509, 113, button_rectangleHighlightAnim);
addCharacter (visual_mark, 509, 141, button_rectangleHighlightAnim);
}
if (gameScreen == "screen_addgame") {
addCharacter (visual_mark, 31, 394, button_rectangleHighlightAnim);
addCharacter (visual_mark, 379, 394, button_rectangleHighlightAnim);
addCharacter (visual_mark, 267, 394, button_rectangleHighlightAnim);
}
}
objectType basicEvents("") {
event hotspot_addGame {
gameScreen = "screen_addgame";
cleanScreen();
addOverlay('images/addgame.png',0,0);
#Back to main menu
addScreenRegion (init_reset, 266, 394, 376, 418, 0, 0, NORTH);
enableTutorialButton();
}
event init_reset {
gameScreen = "screen_main";
cleanScreen ();
addOverlay ('images/main.png', 0, 0);
setCursor (cursor_scummvmAnim);
addScreenRegion (hotspot_addGame, 508, 191, 618, 213, 0, 0, NORTH);
addScreenRegion (hotspot_start, 508, 113, 618, 135, 0, 0, NORTH);
addScreenRegion (hotspot_load, 508, 141, 618, 163, 0, 0, NORTH);
enableTutorialButton();
}
event hotspot_tutorialMode {
gameMode = "mode_tutorial";
setCursor (cursor_questionMarkAnim);
removeCharacter (hotspot_tutorialMode);
showHighlights();
}
}
objectType tutorialEvents("") {
}
objectType visual_mark("") {
}
sub cleanScreen() {
blankScreen();
removeAllCharacters();
removeAllScreenRegions();
}