common: captioned alert messages
[sheet.git] / nethack.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'nethack cheat sheet',
5         version => '1.1',
6         description => [
7                 "Keyboard overview sheet for the Nethack console RPG game,",
8                 "describing the default controls.",
9         ],
10         keywords => [qw'
11                 nethack rogue game control controls sheet reference overview keyboard
12         '],
13         stylesheet => [qw'light dark circus mono red terse'],
14         keys => 1,
15 });
16
17 :>
18 <h1>NetHack cheat sheet</h1>
19
20 <h2>normal gameplay</h2>
21
22 <:
23 use Shiar_Sheet::Keyboard 2;
24 my $info = do 'nethack.eng.inc.pl' or die $@;
25 $info->{def} = do 'nethack.inc.pl';
26 my $keys = Shiar_Sheet::Keyboard->new($info);
27 $_->{"\e"} = ['me mode'] for values %{ $info->{def} };
28         # static reset button, even though it's not (officially) in the game
29 $keys->map($get{map}) or undef $get{map};
30 $keys->print_rows($get{rows} || '4321-421', [3,2,1,0]);
31 :>
32
33 <hr>
34
35 <div class="help">
36         <div class="left">
37 <: $keys->print_legend('legend-types', ['g2' .. 'g4', 'g6' .. 'g8']) :>
38         </div>
39
40         <div class="right">
41 <: $keys->print_legend('legend-options', [qw( arg argi argm )]) :>
42
43                 <ul class="legend legend-set">
44                 <li>keyboard <strong>map</strong> is
45                         <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
46                 <li><strong>keys</strong> are
47                         <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
48                                 !exists $get{keys} && ' by default' :>
49                 <li>default <strong>style</strong> is
50                         <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
51                 </ul>
52         </div>
53 </div>
54