generic menu-based terminal #174
Aliases: generic menu-based terminal, menu-based terminal, terminal
3 verbs · 36 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
use | this none none | rxd | #174 | 4 |
display_menu | this none this | rxd | #174 | 28 |
output | this none this | rxd | #174 | 5 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
pretext | #174 | rc | #29 | {} |
options | #174 | rc | #29 | {} |
posttext | #174 | rc | #29 | {} |
prefix | #174 | rc | #29 | "" |
exitmenu_msg | #174 | rc | #29 | "" |
help_msg | #174 | rc | #29 | list of 17{"Basic terminal, can be set up to perform any number of specific commands", "upon being used by a player. To use it:", "", " use <terminal>", "", "PROPERTIES", "$menu_term.prefix => STR prefix", " - This is displayed before each line of menu text.", "", "$menu_term.pretext => {STR line1, STR line2, ...}", " - This text is displayed before the options.", "", "$menu_term.options => {{STR text, STR verb, ARGS}, ...}", " - Displays 'text' and executes this:verb(player, ARGS) if selected.", "", "$menu_term.posttext => {STR line1, STR line2, ...}", " - This text is displayed after the options."} |
handed | #5 | rc | #29 | <clear> |
wield_msg | #5 | rc | #29 | <clear> |
unwield_msg | #5 | rc | #29 | <clear> |
size | #5 | rc | #29 | <clear> |
look_place_msg | #5 | rc | #29 | "A %t sits in the corner, humming quietly." |
value | #5 | rc | #29 | <clear> |
get_msg | #5 | rc | #29 | <clear> |
drop_msg | #5 | rc | #29 | <clear> |
get_fail_msg | #5 | rc | #29 | <clear> |
junk_ok | #5 | rc | #29 | 0 |
floats | #5 | rc | #29 | <clear> |
long_name_msg | #5 | rc | #29 | <clear> |
article | #5 | rc | #29 | 0 |
setup_list | #5 | rc | #29 | <clear> |
health | #5 | rc | #29 | <clear> |
health_max | #5 | rc | #29 | <clear> |
min_skill | #5 | rc | #29 | <clear> |
skill | #5 | rc | #29 | <clear> |
recipe_for | #5 | rc | #29 | <clear> |
carried_msg | #5 | rc | #29 | <clear> |
aliases | #1 | rc | #29 | {"generic menu-based terminal", "menu-based terminal", "terminal"} |
description | #1 | rc | #29 | <clear> |
object_size | #1 | r | #29 | {3357, 1298433871} |
hidden_verbs | #1 | rc | #29 | <clear> |
phelp_msg | #1 | rc | #29 | <clear> |
weight | #1 | rc | #29 | -1 |
owner_verbs | #1 | rc | #29 | <clear> |
plural_name | #1 | rc | #29 | <clear> |
client_image | #1 | rc | #29 | <clear> |
listening | #1 | rc | #29 | <clear> |
Ancestry
Ancestors (nearest first): #5 generic thing → #1 root
Children: none
Call graph
Source
use
Referenced by
none
Source
1if (player.location != this.location) 2return 0; 3endif 4this:display_menu(player);
display_menu
Referenced by
- #174:use line 4:
this:display_menu - #174:display_menu line 27:
this:display_menu
Source
1":display_menu(OBJ who)"; 2"...Displays the terminal's menu to 'who'..."; 3who = args[1]; 4vargs = {}; 5for x in [1..length(this.pretext)] 6who:tell(this.prefix + this.pretext[x]); 7endfor 8for x in [1..length(this.options)] 9who:tell(((this.prefix + tostr(x)) + ": ") + this.options[x][1]); 10endfor 11for x in [1..length(this.posttext)] 12who:tell(this.prefix + this.posttext[x]); 13endfor 14sel = tonum($cu:read("[enter the # of your selection]")); 15if ((sel < 1) || (sel > length(this.options))) 16who:tell(this.prefix + this.exitmenu_msg); 17return 1; 18endif 19if (length(this.options[sel]) == 2) 20this:(this.options[sel][2])(who); 21else 22for x in [3..length(this.options[sel])] 23vargs = {@vargs, this.options[sel][x]}; 24endfor 25this:(this.options[sel][2])(who, @vargs); 26endif 27this:display_menu(who); 28return 1;
output
Referenced by
none
Source
1":output(OBJ who, STR text)"; 2"...Outputs a string from the terminal to the character, with the proper prefix..."; 3who = args[1]; 4text = args[2]; 5who:tell(this.prefix + text);