Vorple Notifications by Juhana Leinonen Search for other extensions by this author Approved for the Public Library

Versions

Download version 2/140430For Inform 7 6L38

Links

Description

Notifications and dialogs.

Tags interface vorple

Documentation

Chapter: Notifications Notifications are messages that show briefly on the screen and then fade away. A notification can be displayed simply with: show notification "Hello World!"; Chapter: Positioning There are 11 possibilities for positioning notifications: top banner, bottom banner, top left, top center, top right, center left, center, center right, bottom left, bottom center, and bottom right. The default position is bottom right. It can be changed individually: show notification "Up here!" in top banner; ...or globally: *: When play begins: set the default notification position to top banner. Chapter: Alerts An alert is a notification that comes with an "OK" button that must be clicked to dismiss the notification. It's always in the middle of the screen. When play begins: show alert "If you need assistance, type HELP at the prompt." Chapter: Clearing notifications Multiple notifications are shown on the screen at the same time; a new notification in the same position pushes the old notification down (or up) if it hasn't had time to clear away yet. Sometimes you might want to make sure that the old notifications are cleared before showing new ones. All notifications currently on the screen can be removed with: hide notifications; Chapter: Fallback If Vorple isn't available, the fallback is to display the notifications at the end of turn as plain text. The feature can be overridden by checking Vorple's availability: if Vorple is available: show notification "Click on your inventory items to examine them more closely"; otherwise: say "Type EXAMINE followed by an inventory item's name to examine them more closely."; if Vorple is available: show notification "Welcome to Vorple-enhanced [story title]!"; The default fallback can also be turned off completely: *: The print notifications fallback rule is not listed in any rulebook. Example: * How To I - Showing small tips to new players who might not be familiar with the standard IF conventions. *: "How To I" Include Vorple Notifications by Juhana Leinonen. Release along with the "Vorple" interpreter. Lab is a room. "You're in a fancy laboratory." Corridor is north of lab. A test tube is in the lab. A trolley is in the lab. It is pushable between rooms. When play begins: show notification "Type LOOK (or just L) to see the room description again". After taking something for the first time: show notification "Type INVENTORY (or just I) to see a list of what you're carrying"; continue the action. After examining the trolley for the first time: show notification "You can push the trolley between rooms by commanding PUSH TROLLEY followed by a compass direction". After reading a command when the player's command includes "examine": show notification "Tip: You can abbreviate EXAMINE to just X". Test me with "take test tube / examine test tube / x trolley". Example: ** Score Notifications - A visual notification when the player is awarded points. We'll create a rule that will show the score change as a Vorple notification, or use the original score notification rule if the game is being played in a non-Vorple interpreter. *: "Score Notifications" Include Vorple Notifications by Juhana Leinonen. Release along with the "Vorple" interpreter. Use scoring. The maximum score is 5. Chapter 1 - New score notifications To say score notification message: (- NotifyTheScore(); -). This is the enhanced notify score changes rule: if Vorple is supported: if the last notified score is not the score: show notification "[score notification message]" at top center; now the last notified score is the score; otherwise: follow the notify score changes rule. The enhanced notify score changes rule is listed instead of the notify score changes rule in the turn sequence rulebook. Chapter 2 - Treasure chamber Treasure Chamber is a room. "Wealth beyond your dreams is piled all over this room." A valuable is a kind of thing. The pearls, gold coins, diamonds, rubies and emeralds are plural-named valuables in the Treasure Chamber. Carry out taking a valuable when the noun is not handled (this is the award points for finding valuables rule): increase the score by one. Test me with "take coins / take diamonds and rubies / take all".