mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 06:32:35 +02:00
Merge pull request #14638 from huffman/fix/entity-list-text-mb
Fix texture MB column not sorting correctly in entity list
This commit is contained in:
commit
f3d2d7c95b
1 changed files with 20 additions and 15 deletions
|
@ -24,6 +24,19 @@ const DELTA_X_MOVE_COLUMNS_THRESHOLD = 2;
|
|||
const DELTA_X_COLUMN_SWAP_POSITION = 5;
|
||||
const CERTIFIED_PLACEHOLDER = "** Certified **";
|
||||
|
||||
function decimalMegabytes(number) {
|
||||
return number ? (number / BYTES_PER_MEGABYTE).toFixed(1) : "";
|
||||
}
|
||||
|
||||
function displayIfNonZero(number) {
|
||||
return number ? number : "";
|
||||
}
|
||||
|
||||
function getFilename(url) {
|
||||
let urlParts = url.split('/');
|
||||
return urlParts[urlParts.length - 1];
|
||||
}
|
||||
|
||||
const COLUMNS = {
|
||||
type: {
|
||||
columnHeader: "Type",
|
||||
|
@ -79,6 +92,7 @@ const COLUMNS = {
|
|||
dropdownLabel: "Texture Size",
|
||||
propertyID: "texturesSize",
|
||||
initialWidth: 0.10,
|
||||
format: decimalMegabytes
|
||||
},
|
||||
hasTransparent: {
|
||||
columnHeader: "",
|
||||
|
@ -605,19 +619,6 @@ function loaded() {
|
|||
}));
|
||||
}
|
||||
|
||||
function decimalMegabytes(number) {
|
||||
return number ? (number / BYTES_PER_MEGABYTE).toFixed(1) : "";
|
||||
}
|
||||
|
||||
function displayIfNonZero(number) {
|
||||
return number ? number : "";
|
||||
}
|
||||
|
||||
function getFilename(url) {
|
||||
let urlParts = url.split('/');
|
||||
return urlParts[urlParts.length - 1];
|
||||
}
|
||||
|
||||
function updateEntityData(entityData) {
|
||||
entities = [];
|
||||
entitiesByID = {};
|
||||
|
@ -639,7 +640,7 @@ function loaded() {
|
|||
certificateID: entity.certificateID,
|
||||
verticesCount: displayIfNonZero(entity.verticesCount),
|
||||
texturesCount: displayIfNonZero(entity.texturesCount),
|
||||
texturesSize: decimalMegabytes(entity.texturesSize),
|
||||
texturesSize: entity.texturesSize,
|
||||
hasTransparent: entity.hasTransparent,
|
||||
isBaked: entity.isBaked,
|
||||
drawCalls: displayIfNonZero(entity.drawCalls),
|
||||
|
@ -874,7 +875,11 @@ function loaded() {
|
|||
if (column.data.glyph) {
|
||||
elCell.innerHTML = itemData[column.data.propertyID] ? column.data.columnHeader : null;
|
||||
} else {
|
||||
elCell.innerHTML = itemData[column.data.propertyID];
|
||||
let value = itemData[column.data.propertyID];
|
||||
if (column.data.format) {
|
||||
value = column.data.format(value);
|
||||
}
|
||||
elCell.innerHTML = value;
|
||||
}
|
||||
elCell.style = "min-width:" + column.widthPx + "px;" + "max-width:" + column.widthPx + "px;";
|
||||
elCell.className = createColumnClassName(column.columnID);
|
||||
|
|
Loading…
Reference in a new issue