/usr/share/doc/sludge/ExampleProjects/VerbCoin/iface/stop_and_go.slu is in sludge-doc 2.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | var busy = TRUE;
sub go () {
onLeftMouse (leftClick);
onRightMouse (dropObj);
busy = FALSE;
onFocusChange (handleFocus);
# We haven't been updating, so let's do this ourselves
handleFocus (getOverObject ());
}
sub dropObj () {
currentInvItem = NULL;
handleFocus (getOverObject ());
}
sub stop () {
onFocusChange ();
statusText ("");
onLeftMouse ();
onRightMouse (skipper);
setCursor (anim ('iface/mouse.duc', 1));
busy = TRUE;
}
sub skipper () {
skipSpeech ();
}
sub handleFocus (o) {
if (o) {
if (! callEvent (oneCursor, o)) setCursor (anim ('iface/mouse.duc', 2));
} else {
setCursor (anim ('iface/mouse.duc', 0));
}
drawStatusLine (o);
}
sub drawStatusLine (overObject) {
if (! busy) {
if (currentInvItem) {
if (overObject && overObject != currentInvItem) {
statusText ("Use " + currentInvItem + " with " + overObject);
} else {
statusText ("Use " + currentInvItem + " with");
}
} else {
statusText ((overObject ? overObject : "") + (thisObject ? thisObject : ""));
}
}
}
var currentRoom = NULL;
var lastRoom = NULL;
sub gotoRoom (r) {
# Get rid of all the object types
removeAllCharacters ();
removeAllScreenRegions ();
# Get rid of the floor and z-buffer, in case the new room forgets to load any
setFloor (NULL);
setZBuffer (NULL);
# Finish any running timers we might have on the go
completeTimers ();
# Fix the variables lastRoom and currentRoom
# (We don't NEED them, but they are useful in scripts)
lastRoom = currentRoom;
currentRoom = r;
addCharacter (inventoryIcon, 20, 455, anim ('iface/mouse.duc', 5));
setCharacterExtra (inventoryIcon, ICON);
# Now, finally call the function to build the new room
r ();
}
|