diff --git a/services/m=hiscore/helpers.js b/services/m=hiscore/helpers.js
index 63b63531f..5428fadde 100644
--- a/services/m=hiscore/helpers.js
+++ b/services/m=hiscore/helpers.js
@@ -96,8 +96,12 @@ hiscores.formatName = (name, aposS = false) => {
return name;
}
-hiscores.setHeadSkillIcon = (skillName) => {
- document.getElementById("scores_head_icon").src = `../../site/img/hiscores/skill_icon_${skillName.toLowerCase()}1eccb.gif`;
+hiscores.setHeadSkillIcon = (icon) => {
+ if (icon.includes(".")) {
+ document.getElementById("scores_head_icon").src = icon;
+ } else {
+ document.getElementById("scores_head_icon").src = `../../site/img/hiscores/skill_icon_${icon.toLowerCase()}1eccb.gif`;
+ }
}
hiscores.setHeadSkillText = (text) => {
diff --git a/services/m=hiscore/hiscores.js b/services/m=hiscore/hiscores.js
index 5b5f55a39..6c3cd38d1 100644
--- a/services/m=hiscore/hiscores.js
+++ b/services/m=hiscore/hiscores.js
@@ -1,4 +1,5 @@
var hiscores = hiscores || {};
+const ironmanIcon = `
`
hiscores.loadDefaultHSTable = () => {
fetch(`${hiscores.apiURL}/highscores/playersByTotal`)
@@ -22,7 +23,7 @@ hiscores.populateDefaultHSTable = () => {
row.childNodes[3].replaceWith(document.createElement("td"));
row.childNodes[3].className = "alL";
- row.childNodes[3].innerHTML = `${playerData ? hiscores.formatName(playerData.username) : ""}`;
+ row.childNodes[3].innerHTML = `${playerData && playerData.iron_mode === "1" ? ironmanIcon : ""}${playerData ? hiscores.formatName(playerData.username) : ""}`;
row.childNodes[3].addEventListener("click", function (e) {
e.preventDefault();
hiscores.loadUserTable(playerData.username);
@@ -44,6 +45,7 @@ hiscores.loadUserTable = (username) => {
.then(result => {
document.getElementById('search_name').style.color = 'black';
hiscores.tableData = result.skills;
+ hiscores.tableInfo = result.info;
hiscores.populatePlayerHSTable();
hiscores.setHeadSkillText(hiscores.formatName(username, true));
})
@@ -54,7 +56,7 @@ hiscores.loadUserTable = (username) => {
}
hiscores.populatePlayerHSTable = () => {
- hiscores.setHeadSkillIcon("Constitution");
+ hiscores.setHeadSkillIcon(hiscores.tableInfo.iron_mode === "0" ? "Constitution" : "../../site/img/osrsimg/ironman.png");
for (let i = 1; i <= 24; i++) {
row = document.getElementsByClassName(`row row${i}`)[0];
@@ -105,7 +107,7 @@ hiscores.populateSkillHSTable = () => {
row.childNodes[3].replaceWith(document.createElement("td"));
row.childNodes[3].className = "alL";
- row.childNodes[3].innerHTML = `${playerData ? hiscores.formatName(playerData.username) : ""}`;
+ row.childNodes[3].innerHTML = `${playerData && playerData.iron_mode === "1" ? ironmanIcon : ""}${playerData ? hiscores.formatName(playerData.username) : ""}`;
row.childNodes[3].addEventListener("click", function (e) {
e.preventDefault();
hiscores.loadUserTable(playerData.username);
diff --git a/site/img/osrsimg/ironman.png b/site/img/osrsimg/ironman.png
new file mode 100644
index 000000000..e138d48ad
Binary files /dev/null and b/site/img/osrsimg/ironman.png differ