… | |
… | |
1400 | # replace G<male|female> tags |
1400 | # replace G<male|female> tags |
1401 | || s{G<([^>|]*)\|([^>]*)>}{ |
1401 | || s{G<([^>|]*)\|([^>]*)>}{ |
1402 | $self->gender ? $2 : $1 |
1402 | $self->gender ? $2 : $1 |
1403 | }ge |
1403 | }ge |
1404 | # replace H<hint text> |
1404 | # replace H<hint text> |
1405 | || s/H<([^\>]*)>/<fg name="lightblue">[$1]<\/fg>/g; |
1405 | || s{H<([^\>]*)>} |
|
|
1406 | { |
|
|
1407 | ("<fg name=\"lightblue\">[$1 (Use hintmode to suppress hints)]</fg>", |
|
|
1408 | "<fg name=\"lightblue\">[Hint suppressed, see hintmode]</fg>", |
|
|
1409 | "") |
|
|
1410 | [$self->{hintmode}] |
|
|
1411 | }ge; |
1406 | |
1412 | |
1407 | # create single paragraphs (very hackish) |
1413 | # create single paragraphs (very hackish) |
1408 | s/(?<=\S)\n(?=\w)/ /g; |
1414 | s/(?<=\S)\n(?=\w)/ /g; |
1409 | |
1415 | |
|
|
1416 | # compress some whitespace |
|
|
1417 | 1 while s/\s*\n\s*\n\s*/\n/; |
|
|
1418 | |
1410 | $_ |
1419 | $_ |
|
|
1420 | } |
|
|
1421 | |
|
|
1422 | sub hintmode { |
|
|
1423 | warn "hm<$_[0] $_[1]>\n";#d# |
|
|
1424 | $_[0]{hintmode} = $_[1] if @_ > 1; |
|
|
1425 | $_[0]{hintmode} |
1411 | } |
1426 | } |
1412 | |
1427 | |
1413 | =item $player->ext_reply ($msgid, %msg) |
1428 | =item $player->ext_reply ($msgid, %msg) |
1414 | |
1429 | |
1415 | Sends an ext reply to the player. |
1430 | Sends an ext reply to the player. |