From cc077732c4ac1dc4278238bbdc696fdbc5d6e911 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Mon, 13 May 2024 16:29:34 +0300 Subject: [PATCH] Sort assets alphabetically, highlight in the list --- public/scripts/extensions/assets/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/scripts/extensions/assets/index.js b/public/scripts/extensions/assets/index.js index 50bad2479..2d96fa875 100644 --- a/public/scripts/extensions/assets/index.js +++ b/public/scripts/extensions/assets/index.js @@ -109,7 +109,7 @@ function downloadAssetsList(url) { `); } - for (const i in availableAssets[assetType]) { + for (const i in availableAssets[assetType].sort((a, b) => a?.name && b?.name && a['name'].localeCompare(b['name']))) { const asset = availableAssets[assetType][i]; const elemId = `assets_install_${assetType}_${i}`; let element = $('
', { id: elemId, class: 'asset-download-button right_menu_button' }); @@ -200,6 +200,9 @@ function downloadAssetsList(url) {
`); if (assetType === 'character') { + if (asset.highlight) { + assetBlock.find('.asset-name').append(''); + } assetBlock.find('.asset-name').prepend(`
${displayName}
`); }