add horn notes and melodies

This commit is contained in:
Bryce Allen
2015-08-05 22:39:20 -05:00
parent feb419c98a
commit ba4c0da67b
8 changed files with 80 additions and 8 deletions

View File

@@ -220,3 +220,18 @@ function set_sharpness_titles(weapon_data) {
weapon_data["sharpness_all_title"] = "";
}
}
function set_horn_melodies_title(weapon_data) {
if (! weapon_data["horn_notes"]) {
weapon_data["horn_melodies_title"] = ""
return;
}
var lines = [];
$.each(weapon_data["horn_melodies"], function(i, melody) {
var space = Array(6 - melody["song"].length).join(" ");
lines.push(melody["song"] + space + melody["effect1"]);
});
weapon_data["horn_melodies_title"] = lines.join("
");
}

View File

@@ -1,4 +1,4 @@
<tr>
<tr title="id: <%= id %>">
<td><% if (final == 1) { %>
<strong>*</strong>
<% } else { %>
@@ -57,4 +57,6 @@
<td><%= defense ? "+" + defense + " Def" : "" %></td>
<td style="text-align:right"><%= phial %></td>
<td style="text-align:right"><%= shelling_type %></td>
<td title="<%= horn_melodies_title %>"
style="text-align:right"><%= horn_notes %></td>
</tr>

View File

@@ -1,9 +1,15 @@
<table>
<tr>
<tr title="<%= id %>">
<td><%= name %></td>
<td>(<%= wtype %>)</td>
<td><% if (phial) { %>&lt;<%= phial %> Phial&gt;<% } %></td>
<td><% if (shelling_type) { %>&lt;<%= shelling_type %>&gt;<% } %></td>
<td><% if (phial) {
%>&lt;<%= phial %> Phial&gt;<%
} else if (shelling_type) {
%>&lt;<%= shelling_type %>&gt;<%
} else if (horn_notes) {
%><span title="<%= horn_melodies_title %>"
>[<%= horn_notes %>]<%
} %></td>
<td><%= Array(num_slots + 1).join("o")
%><%= Array(3 - num_slots + 1).join("-") %></td>
</tr>

View File

@@ -232,6 +232,7 @@
return;
}
set_sharpness_titles(data);
set_horn_melodies_title(data);
data["wtype_short"] =
WEAPON_TYPE_ABBR[data["wtype"]];
data["ELEMENT_ABBR"] = ELEMENT_ABBR;

View File

@@ -179,6 +179,7 @@
$.getJSON(DATA_PATH + "weapon/" + weapon_id + ".json",
function(data) {
set_sharpness_titles(data);
set_horn_melodies_title(data);
var html = template_stats.render(data);
$("#weapon_stats").html(html);
});