diff --git a/public/scripts/extensions/assets/character.html b/public/scripts/extensions/assets/character.html index 152aeb9c0..e59889161 100644 --- a/public/scripts/extensions/assets/character.html +++ b/public/scripts/extensions/assets/character.html @@ -1,7 +1,7 @@
{{name}}
{{name}} -
{{description}}
+
{{description}}
diff --git a/public/scripts/extensions/assets/index.js b/public/scripts/extensions/assets/index.js index 97377a0bd..50bad2479 100644 --- a/public/scripts/extensions/assets/index.js +++ b/public/scripts/extensions/assets/index.js @@ -340,10 +340,10 @@ async function openCharacterBrowser(forceDefault) { return; } - const listElement = $(document.createElement('div')); - listElement.addClass('characterAssetList'); + const template = $(await renderExtensionTemplateAsync(MODULE_NAME, 'market', {})); - for (const character of characters) { + for (const character of characters.sort((a, b) => a.name.localeCompare(b.name))) { + const listElement = template.find(character.highlight ? '.contestWinnersList' : '.featuredCharactersList'); const characterElement = $(await renderExtensionTemplateAsync(MODULE_NAME, 'character', character)); const downloadButton = characterElement.find('.characterAssetDownloadButton'); const checkMark = characterElement.find('.characterAssetCheckMark'); @@ -361,7 +361,7 @@ async function openCharacterBrowser(forceDefault) { listElement.append(characterElement); } - callGenericPopup(listElement, POPUP_TYPE.TEXT, '', { okButton: 'Close', wide: true, large: true, allowVerticalScrolling: true, allowHorizontalScrolling: false }); + callGenericPopup(template, POPUP_TYPE.TEXT, '', { okButton: 'Close', wide: true, large: true, allowVerticalScrolling: true, allowHorizontalScrolling: false }); } //#############################// @@ -397,6 +397,11 @@ jQuery(async () => { const assetsJsonUrl = windowHtml.find('#assets-json-url-field'); assetsJsonUrl.val(ASSETS_JSON_URL); + const charactersButton = windowHtml.find('#assets-characters-button'); + charactersButton.on('click', async function () { + openCharacterBrowser(false); + }); + const connectButton = windowHtml.find('#assets-connect-button'); connectButton.on('click', async function () { const url = String(assetsJsonUrl.val()); diff --git a/public/scripts/extensions/assets/market.html b/public/scripts/extensions/assets/market.html new file mode 100644 index 000000000..26422d758 --- /dev/null +++ b/public/scripts/extensions/assets/market.html @@ -0,0 +1,19 @@ +
+
+

+ Contest Winners + +

+
+
+
+
+
+

+ Featured Characters + +

+
+
+
+
diff --git a/public/scripts/extensions/assets/window.html b/public/scripts/extensions/assets/window.html index 2f1f9f280..cc01add17 100644 --- a/public/scripts/extensions/assets/window.html +++ b/public/scripts/extensions/assets/window.html @@ -14,6 +14,10 @@ +