add horn notes and melodies
This commit is contained in:
@@ -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(" ");
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
<table>
|
||||
<tr>
|
||||
<tr title="<%= id %>">
|
||||
<td><%= name %></td>
|
||||
<td>(<%= wtype %>)</td>
|
||||
<td><% if (phial) { %><<%= phial %> Phial><% } %></td>
|
||||
<td><% if (shelling_type) { %><<%= shelling_type %>><% } %></td>
|
||||
<td><% if (phial) {
|
||||
%><<%= phial %> Phial><%
|
||||
} else if (shelling_type) {
|
||||
%><<%= shelling_type %>><%
|
||||
} 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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user