generic menu-based terminal #174

Parent #5Owner #29Flags read, fertileSource hellcore/hellcore.db

Aliases: generic menu-based terminal, menu-based terminal, terminal

3 verbs · 36 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
usethis none nonerxd#1744
display_menuthis none thisrxd#17428
outputthis none thisrxd#1745

Properties

PropertyDefinerFlagsOwnerValue
pretext#174rc#29{}
options#174rc#29{}
posttext#174rc#29{}
prefix#174rc#29""
exitmenu_msg#174rc#29""
help_msg#174rc#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#5rc#29<clear>
wield_msg#5rc#29<clear>
unwield_msg#5rc#29<clear>
size#5rc#29<clear>
look_place_msg#5rc#29"A %t sits in the corner, humming quietly."
value#5rc#29<clear>
get_msg#5rc#29<clear>
drop_msg#5rc#29<clear>
get_fail_msg#5rc#29<clear>
junk_ok#5rc#290
floats#5rc#29<clear>
long_name_msg#5rc#29<clear>
article#5rc#290
setup_list#5rc#29<clear>
health#5rc#29<clear>
health_max#5rc#29<clear>
min_skill#5rc#29<clear>
skill#5rc#29<clear>
recipe_for#5rc#29<clear>
carried_msg#5rc#29<clear>
aliases#1rc#29{"generic menu-based terminal", "menu-based terminal", "terminal"}
description#1rc#29<clear>
object_size#1r#29{3357, 1298433871}
hidden_verbs#1rc#29<clear>
phelp_msg#1rc#29<clear>
weight#1rc#29-1
owner_verbs#1rc#29<clear>
plural_name#1rc#29<clear>
client_image#1rc#29<clear>
listening#1rc#29<clear>

Ancestry

Ancestors (nearest first): #5 generic thing#1 root

Children: none

Call graph

calls n174_0 #174:use n174_1 #174:display_menu n174_0->n174_1 n174_1->n174_1 n48_2 #48:read n174_1->n48_2

Source

use

Spec this none noneFlags rxdOwner #29Definer #174

Referenced by

none

Source

1if (player.location != this.location)
2return 0;
3endif
4this:display_menu(player);

display_menu

Spec this none thisFlags rxdOwner #29Definer #174

Referenced by

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

Spec this none thisFlags rxdOwner #29Definer #174

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);