From 6633f0dad04fff807cea6c540e68907bc1042134 Mon Sep 17 00:00:00 2001 From: ipax77 Date: Sat, 30 Nov 2024 10:12:11 +0100 Subject: [PATCH] readme update --- README.md | 13 +++++- .../dsstats.maui8/wwwroot/index.html | 2 +- src/dsstats.razorlib/wwwroot/js/dsstats.js | 40 ++++++++++++------- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 8295f5be..03441b3d 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,18 @@ We really like people helping us with the project. Nevertheless, take your time ## ChangeLog -
v2.0.5 +
v2.0.6 ->- s2protocol v5.0.13.92440.0 (s2protocol.NET v0.8.3) +>- s2protocol 5.0.14.93272.0 (s2protocol.NET v0.8.3) +>- dotnet v8.0.11 (8.0.404) +>- Maui Session Progress reload button +>- Replay Leaver duration indication + +
+ +
v2.0.5 + +>- s2protocol v5.0.13.92440.0 (s2protocol.NET v0.8.2) >- dotnet v8.0.7 (8.0.303) >- Maui builds fixed >- Maui hanging loading indicator fixed diff --git a/src/dsstats.maui/dsstats.maui8/wwwroot/index.html b/src/dsstats.maui/dsstats.maui8/wwwroot/index.html index 4970290c..c15cce67 100644 --- a/src/dsstats.maui/dsstats.maui8/wwwroot/index.html +++ b/src/dsstats.maui/dsstats.maui8/wwwroot/index.html @@ -26,7 +26,7 @@ - + diff --git a/src/dsstats.razorlib/wwwroot/js/dsstats.js b/src/dsstats.razorlib/wwwroot/js/dsstats.js index c7b65520..5c332e42 100644 --- a/src/dsstats.razorlib/wwwroot/js/dsstats.js +++ b/src/dsstats.razorlib/wwwroot/js/dsstats.js @@ -1,4 +1,4 @@ -//v1.12 +//v1.13 const cmdrIconsMap = new Map(); let dsmodal = null; @@ -30,25 +30,37 @@ function hideTooltip(id) { tooltip[0].parentNode.removeChild(tooltip[0]); } - function registerImagePlugin(xWidth, yWidth) { - const barIcons = barIconsPlugin(); - Chart.register(barIcons); - preloadChartIcons(xWidth, yWidth); + preloadChartIcons(xWidth, yWidth).then(() => { + const barIcons = barIconsPlugin(); + Chart.register(barIcons); + }); } function preloadChartIcons(xWidth, yWidth) { if (cmdrIconsMap.size > 0) { - return; - } - const cmdrs = ["terran", "protoss", "zerg", "abathur", "alarak", "artanis", "dehaka", "fenix", "horner", "karax", "kerrigan", "mengsk", "nova", "raynor", "stetmann", "stukov", "swann", "tychus", "vorazun", "zagara", "zeratul"]; - for (let i = 0; i < cmdrs.length; i++) { - const img = new Image(xWidth, yWidth); - img.onload = () => { - cmdrIconsMap.set(cmdrs[i], img); - }; - img.src = "_content/dsstats.razorlib/images/" + cmdrs[i] + "-min.png"; + return Promise.resolve(); } + + const cmdrs = [ + "terran", "protoss", "zerg", "abathur", "alarak", "artanis", "dehaka", + "fenix", "horner", "karax", "kerrigan", "mengsk", "nova", "raynor", + "stetmann", "stukov", "swann", "tychus", "vorazun", "zagara", "zeratul" + ]; + + const loadPromises = cmdrs.map(cmdr => { + return new Promise((resolve, reject) => { + const img = new Image(xWidth, yWidth); + img.onload = () => { + cmdrIconsMap.set(cmdr, img); + resolve(); + }; + img.onerror = reject; + img.src = `_content/dsstats.razorlib/images/${cmdr}-min.png`; + }); + }); + + return Promise.all(loadPromises); } function increaseChartHeight(chartId, height) {