Game-HexDescribe
view release on metacpan or search on metacpan
lib/Game/HexDescribe.pm view on Meta::CPAN
my ($key) = $result =~ /^;(.*)/m;
$url = $c->url_for('nomap')->query(input => "[$key]\n" x 10,
load => 'none',
table=> html_unescape($result));
}
return Mojo::ByteStream->new(qq(<pre>$result</pre><p><a href='$url'>Try it</a>.</p>));
};
=back
=head2 Finally
Start the app at the very end. The rest is templates for the various web pages.
=cut
app->start || 1;
__DATA__
@@ edit.html.ep
% layout 'default';
% title 'Hex Describe';
<h1>Hex Describe</h1>
<p>This tool generates mini-setting books: a hundred pages or more of
descriptions for a map based on random tables. The following links automatically
load a map and pick a matching table: <%= link_to 'Smale mini-setting' =>
'describerandomsmale' %>; <%= link_to 'Alpine mini-setting' =>
'describerandomalpine' %>; <%= link_to 'Apocalypse mini-setting' =>
'describerandomjohnston' %>; <%= link_to 'Traveller subsector' =>
'describerandomtraveller' %>.
<p>You can write the hex map descriptions yourself, but it's often quicker to
generate one using <a href="https://campaignwiki.org/text-mapper/">Text
Mapper</a> and modify it until you're happy, then copy and paste the map into
the text area below, pick an appropriate random table and submit it. For a quick
demonstration, the following links will load map data from Text Mapper into the
text area below: <%= link_to 'random Smale data' => 'loadrandomsmale' %>; <%=
link_to 'random Alpine data' => 'loadrandomalpine' %>; <%= link_to 'random
Apocalypse data' => 'loadrandomapocalypse' %>; <%= link_to 'random Traveller
data' => 'loadrandomtraveller' %>.
<p>Finally, you can also explore the <%= link_to 'rules' => 'rules' %> of the
various tables interactively, and use the tables with <%= link_to 'no map' =>
'nomap' %>.
%= form_for describe => (method => 'POST') => begin
%= text_area map => (cols => 60, rows => 15) => begin
<%= $map =%>
% end
<p>
If you need the <%= link_to 'default map' => 'defaultmap' %>
for anything, feel free to use it. It was generated using
the <a href="https://campaignwiki.org/text-mapper/alpine">Alpine</a>
generator.
<p>
<label>
%= check_box 'labels'
Include labels. This will create a very busy map.
</label><br>
<label>
%= check_box 'markdown'
Create Markdown instead of HTML output.
</label><br>
<label>
%= check_box 'faces' => 1, checked => 1
Include images (faces, dungeon maps) in the HTML output (slow)
</label><br>
<label>
%= check_box 'show' => 1, checked => 1
Include map in the HTML output (slow)
</label>
<p>
What random tables should be used to generate the descriptions?
<p>
% param load => 'schroeder' unless param 'load';
<%= radio_button load => 'schroeder' %>
<%= link_to 'Alex Schroeder' => 'schroedertable' %>
(best for Alpine maps)<br>
<%= radio_button load => 'seckler' %>
<%= link_to 'Peter Seckler' => 'secklertable' %>
(best for Smale maps)<br>
<%= radio_button load => 'strom' %>
<%= link_to 'Matt Strom' => 'stromtable' %>
(best for Smale maps)<br>
<%= radio_button load => 'johnston' %>
<%= link_to 'Josh Johnston' => 'johnstontable' %>
(best for Apocalypse maps)<br>
<%= radio_button load => 'traveller' %>
<%= link_to 'Traveller' => 'travellertable' %>
(best for Traveller maps)<br>
<%= radio_button load => 'rorschachhamster' %>
<%= link_to 'Rorschachhamster' => 'rorschachhamstertable' %>
(testing)<br>
<%= radio_button load => 'none' %>
none (only use the data provided below)
<p>
If you have your own tables somewhere public (a pastebin, github raw text, a public file at a
file hosting service), you can provide the URL to your tables right here:
<p>
Table URL:
%= text_field url => $url, size => 40
<p>
Alternatively, just paste your tables here:
%= text_area table => (cols => 60, rows => 15) => begin
<%= $table =%>
% end
<p>
%= submit_button 'Submit', name => 'submit'
%= end
@@ description.html.ep
( run in 2.596 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )