Commit b2a967ce authored by nanahira's avatar nanahira

identify branches

parent 7bf49f4b
...@@ -50,12 +50,19 @@ for (var category_raw of category_array) { ...@@ -50,12 +50,19 @@ for (var category_raw of category_array) {
ura: null, ura: null,
}, },
song_id: song_id, song_id: song_id,
category: category category: category,
branch: {
easy: false,
normal: false,
hard: false,
oni: false,
ura: false,
}
} }
var courseName = "oni"; var courseName = "oni";
for (var line of tja_lines) { for (var line of tja_lines) {
if (line.indexOf(":") > 0) {
const line_ = line.trim(); const line_ = line.trim();
if (line_.indexOf(":") > 0) {
//const line__ = convert(line_, "UTF-8", "SHIFT-JIS").toString('utf8'); //const line__ = convert(line_, "UTF-8", "SHIFT-JIS").toString('utf8');
const temp = line_.split(":"); const temp = line_.split(":");
const key = temp[0].toLowerCase(); const key = temp[0].toLowerCase();
...@@ -77,9 +84,21 @@ for (var category_raw of category_array) { ...@@ -77,9 +84,21 @@ for (var category_raw of category_array) {
} }
break; break;
case "level": case "level":
res.difficulty[courseName] = "'"+value+"'"; res.difficulty[courseName] = value;
break; break;
} }
} else if (line_.startsWith("#BRANCHSTART")) {
console.log("branch", res.title, courseName);
res.branch[courseName] = true;
}
}
for (var diff of ["easy", "normal", "hard", "oni", "ura"]) {
if (res.difficulty[diff]) {
if (res.branch[diff]) {
res.difficulty[diff] = "'" + res.difficulty[diff] + " B'";
} else {
res.difficulty[diff] = "'" + res.difficulty[diff] + "'";
}
} }
} }
all_songs.push(res); all_songs.push(res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment