summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-06-21 08:43:38 +0000
committeryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-06-21 08:43:38 +0000
commit9b1639745da4bc94948a5f0ce0dc867ad5767ac2 (patch)
treefb484cde4883a2cdbd81c64b8520b12c401eb1f4
parentd600e72db73cc46f9fc647f99c1eb4b833a821e0 (diff)
Added protagonist categories. Still not sure what to do with the time and place, though :(
git-svn-id: svn://vndb.org/vndb@30 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
-rw-r--r--data/docs/112
-rw-r--r--data/tpl/vnbrowse6
-rw-r--r--data/tpl/vnedit6
-rw-r--r--data/tpl/vnpage4
-rw-r--r--lib/ChangeLog2
-rw-r--r--lib/global.pl10
-rw-r--r--static/files/dyna.js2
7 files changed, 29 insertions, 13 deletions
diff --git a/data/docs/1 b/data/docs/1
index 7d32fb8f..bdf9ae20 100644
--- a/data/docs/1
+++ b/data/docs/1
@@ -132,6 +132,18 @@
</dl>
+:SUB:Protagonist
+<p>
+ Indicates some information about the character the player takes control of.
+<dl>
+ <dt>Male</dt><dd>
+ The protagonist is male.
+ </dd><dt>Female</dt><dd>
+ The protagonist is female.
+ </dd>
+</dl>
+
+
:SUB:Sexual content
<p>
Indicates the types of sexual content that the game contains.
diff --git a/data/tpl/vnbrowse b/data/tpl/vnbrowse
index 9adaa113..fd071c49 100644
--- a/data/tpl/vnbrowse
+++ b/data/tpl/vnbrowse
@@ -14,14 +14,14 @@
<div id="adsearch" [[= !$p{searchquery} ? '' : ' style="display: none"' ]]>
<b>Categories</b> (boolean and, selecting more gives less results)
<ul id="cat">
- [[ for my $c (qw| e g p t l s |) { ]]-
- -[[= $c ne 'l' && $c ne 'p' ? '<li>' : '<br />' ]][[: $VNDB::CAT->{$c}[0] ]]-
+ [[ for my $c (qw| e g t p h l s |) { ]]-
+ -[[= $c !~ /[thl]/ ? '<li>' : '<br />' ]][[: $VNDB::CAT->{$c}[0] ]]-
<ul>
[[ for (sort keys %{$VNDB::CAT->{$c}[1]}) { my $ca = $c.$_; ]]-
<li id="cat_[[= $ca ]]">
[[: $VNDB::CAT->{$c}[1]{$_} ]]- ([[= $d{cat}{$ca} || 0 ]])</li>
[[ } ]]
- </ul>[[= $c ne 't' && $c ne 'g' ? '</li>' : '' ]]-
+ </ul>[[= $c !~ /[gph]/ ? '</li>' : '' ]]-
[[ } ]]-
</ul>
<br style="clear: both" />
diff --git a/data/tpl/vnedit b/data/tpl/vnedit
index d99a915b..f7122149 100644
--- a/data/tpl/vnedit
+++ b/data/tpl/vnedit
@@ -60,13 +60,13 @@
{ type => 'hidden', short => 'categories' },
{ type => 'static', raw => 1, text => eval {
my $r = '<ul id="cat">';
- for my $c (qw| e g p t l s |) {
- $r .= ($c ne 'l' && $c ne 'p' ? '<li>' : '<br />').$VNDB::CAT->{$c}[0].'<ul>';
+ for my $c (qw| e g t p h l s |) {
+ $r .= ($c !~ /[thl]/ ? '<li>' : '<br />').$VNDB::CAT->{$c}[0].'<ul>';
for (sort keys %{$VNDB::CAT->{$c}[1]}) {
$r .= sprintf '<li><a href="#" id="cat_%1$s"><b id="b_%1$s">-</b> %2$s</a></li>',
$c.$_, $VNDB::CAT->{$c}[1]{$_};
}
- $r .= '</ul>'.($c ne 't' && $c ne 'g' ? '</li>' : '');
+ $r .= '</ul>'.($c !~ /[gph]/ ? '</li>' : '');
}
$r.'</ul>';
} },
diff --git a/data/tpl/vnpage b/data/tpl/vnpage
index 9418afc2..f6f12225 100644
--- a/data/tpl/vnpage
+++ b/data/tpl/vnpage
@@ -22,7 +22,7 @@
[ l_renai => 'Renai.us link', sub { $_[0] ? '<a href="http://renai.us/game/'._huri($_[0]).'.shtml">'.$_[0].'</a>' : 'No link' } ],
[ l_vnn => 'V-N.net link', sub { $_[0] ? '<a href="http://visual-novels.net/vn/index.php?option=com_content&amp;task=view&amp;id='.$_[0].'">'.$_[0].'</a>' : 'No link' } ],
[ anime => 'Related anime', sub { join(' ', map qq|<a href="http://anidb.net/a$$_{id}">$$_{id}</a>|, sort { $a->{id} <=> $b->{id} } @{$_[0]}) } ],
- [ categories => 'Categories', sub { join(' ', map { $VNDB::CAT->{substr($_->[0],0,1)}[1]{substr($_->[0],1,2)}.'('.$_->[1].')' } sort { $a->[0] cmp $b->[0] } @{$_[0]}) || 'No categories selected' }, 1 ],
+ [ categories => 'Categories', sub { join(' ', map { my $l=$VNDB::CAT->{substr($_->[0],0,1)}[1]{substr($_->[0],1,2)}; $l?$l.'('.$_->[1].')':() } sort { $a->[0] cmp $b->[0] } @{$_[0]}) || 'No categories selected' }, 1 ],
[ relations => 'Relations', sub { join("<br />\n", map { $VNDB::VREL->[$_->{relation}].': '._hchar($_->{title}) } sort { $a->{id} <=> $b->{id} } @{$_[0]}) } ],
[ image => 'Image', sub { $_[0] > 0 ? sprintf '<img src="%s/cv/%02d/%d.jpg" />', $p{st}, $_[0]%100, $_[0] : $_[0] < 0 ? '[processing]' : 'No image'; } ],
[ img_nsfw => 'NSFW', sub { $_[0] ? 'Not safe' : 'Safe' } ]
@@ -100,7 +100,7 @@ if($d{vn}{length} || $d{vn}{alias} || @links || $prod) { ]]
</dl>
[[ } ]]-
- [[ if(@{$d{vn}{categories}}) { my %nolvl = (pli=>1,pbr=>1,gaa=>1,gab=>1); ]]-
+ [[ if(@{$d{vn}{categories}}) { my %nolvl = (map {$_=>1} qw| pli pbr gaa gab hfa hfe |); ]]-
<h3>Categories</h3>
<dl>
[[ for (sort keys %$VNDB::CAT) {
diff --git a/lib/ChangeLog b/lib/ChangeLog
index ce648155..62785e5c 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -17,7 +17,7 @@ TODO:
- Removed all passwords from the main code, and created a seperate config
file to override all options - not available on SVN
- Dynamic loading, several bugfixes, and code cleanup for Multi
- - Added 'School Life' category
+ - Added 'School Life' and 'Protagonist' categories
- Added GTIN field to releases
- Added links to encubed and renai.us
diff --git a/lib/global.pl b/lib/global.pl
index 07f1afae..1fc3db1e 100644
--- a/lib/global.pl
+++ b/lib/global.pl
@@ -101,9 +101,9 @@ our $CAT = {
st => 'Strategy',
si => 'Simulation',
} ],
- p => [ 'Plot', {
- li => 'Linear', # 0..1
- br => 'Branching', # 0..1
+ p => [ 'Plot', { # 0..1
+ li => 'Linear',
+ br => 'Branching',
} ],
e => [ 'Elements', {
ac => 'Action',
@@ -128,6 +128,10 @@ our $CAT = {
fa => "Fant\x{200B}asy world",
sp => 'Space',
} ],
+ h => [ 'Protagonist', { # 0..1
+ fa => 'Male',
+ fe => "Fem\x{200B}ale",
+ } ],
s => [ 'Sexual content', {
aa => 'Sexual content',
be => 'Bestiality',
diff --git a/static/files/dyna.js b/static/files/dyna.js
index b4d64203..655269af 100644
--- a/static/files/dyna.js
+++ b/static/files/dyna.js
@@ -545,7 +545,7 @@ function catLoad() {
l[i].onclick = function() {
var c = this.id.substr(4);
if(!cats[c]) cats[c] = 0;
- if(c.substr(0,1) == 'p' || c == 'gaa' || c == 'gab') {
+ if(c.substr(0,1) == 'p' || c == 'gaa' || c == 'gab' || c.substr(0,1) == 'h') {
if(cats[c]++)
cats[c] = 0;
} else if(++cats[c] == 4)