Skip to content

Commit

Permalink
Force all icons back to 16x16
Browse files Browse the repository at this point in the history
  • Loading branch information
AlonTavor committed Jun 24, 2024
1 parent 9c33e59 commit 03f8660
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
14 changes: 12 additions & 2 deletions js/scoreboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,24 @@ function playerRow_Update(id)

row.cells[2].textContent = ""
if (p.kit != "")
row.cells[2].appendChild(p.ns_kitImage.cloneNode(false))
{
const imgNode = p.ns_kitImage.cloneNode(false);
imgNode.width = 16;imgNode.height = 16;
row.cells[2].appendChild(imgNode);
}


row.cells[3].textContent = ""
if (p.vehicleid >= 0 && (p.vehicleid in AllVehicles))
{
var vobj = AllVehicles[p.vehicleid]
if (vobj.ns_menuImage != null)
row.cells[3].appendChild(vobj.ns_menuImage.cloneNode(false))
{
const icon = vobj.ns_menuImage.cloneNode(false);
icon.width = 16; icon.height = 16;
row.cells[3].appendChild(icon)
}

}
}

Expand Down
4 changes: 3 additions & 1 deletion js/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ function selection_UpdateInformationBox()
div.innerHTML += " Leader"
}
div.innerHTML += "<br>" + escapeHtml(p.name)
div.appendChild(p.ns_kitImage.cloneNode(false))
const imgNode = p.ns_kitImage.cloneNode(false);
imgNode.width = 16;imgNode.height = 16;
div.appendChild(imgNode)
div.innerHTML += "<br>Height: " + p.Y
if (p.health > 0)
div.innerHTML += "<br>Health: " + p.health
Expand Down
7 changes: 6 additions & 1 deletion js/vehicletables.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ function vehicleTable_Create(id)
cell.innerHTML = ""

if (v.team != 0 && v.ns_mapImage != null)
cell.appendChild(v.ns_mapImage[v.team - 1].cloneNode(false))
{
const icon = v.ns_mapImage[v.team - 1].cloneNode(false);
icon.width = 16; icon.height = 16;
cell.appendChild(icon)
}


// Try to find vehicle name in dictionary
if (v.name in vehicleData)
Expand Down

0 comments on commit 03f8660

Please sign in to comment.