summaryrefslogtreecommitdiff
path: root/util/jsgen.pl
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-09-11 15:34:44 +0200
committerYorhel <git@yorhel.nl>2019-09-11 15:40:08 +0200
commit8c1faad14d4e4be29c464a3dcf3e2f340c6f8242 (patch)
tree0b366f98bf2328bae9e1e1ce5ae4404cdfc049d2 /util/jsgen.pl
parenteab9409133bab856d04ba78e172535ba8099e7f7 (diff)
VNDB::Types: Convert staff_roles into %CREDIT_TYPE
Part one in converting data/global.pl lists into a separate VNDB::Types module. This is basically what I had started with VN3::Types, but it looks like a gradual rewrite/cleanup may be more successful. At least it'll be more useful on the short term.
Diffstat (limited to 'util/jsgen.pl')
-rwxr-xr-xutil/jsgen.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/jsgen.pl b/util/jsgen.pl
index 0cc895ae..6829f719 100755
--- a/util/jsgen.pl
+++ b/util/jsgen.pl
@@ -12,6 +12,9 @@ our($ROOT, %S, %O);
BEGIN { ($ROOT = abs_path $0) =~ s{/util/jsgen\.pl$}{}; }
require $ROOT.'/data/global.pl';
+use lib "$ROOT/lib";
+use VNDB::Types;
+
# screen resolution information, suitable for usage in filFSelect()
sub resolutions {
@@ -46,7 +49,7 @@ sub vars {
vn_lengths => [ map [ $_, $S{vn_lengths}[$_][0] ], 0..$#{$S{vn_lengths}} ],
blood_types => [ map [ $_, $S{blood_types}{$_} ], keys %{$S{blood_types}} ],
genders => [ map [ $_, $S{genders}{$_} ], keys %{$S{genders}} ],
- staff_roles => [ map [ $_, $S{staff_roles}{$_} ], keys %{$S{staff_roles}} ],
+ credit_type => [ map [ $_, $CREDIT_TYPE{$_} ], keys %CREDIT_TYPE ],
resolutions => scalar resolutions(),
);
JSON::XS->new->encode(\%vars);