Skip to content

Commit

Permalink
Merge pull request #525 from ipax77/dev
Browse files Browse the repository at this point in the history
readme update
  • Loading branch information
ipax77 authored Nov 30, 2024
2 parents b27de97 + 6633f0d commit c97226c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 17 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,18 @@ We really like people helping us with the project. Nevertheless, take your time

## ChangeLog

<details open="open"><summary>v2.0.5</summary>
<details open="open"><summary>v2.0.6</summary>

>- 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
</details>

<details><summary>v2.0.5</summary>

>- 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
Expand Down
2 changes: 1 addition & 1 deletion src/dsstats.maui/dsstats.maui8/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<script src="_framework/blazor.webview.js" autostart="false"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="_content/dsstats.razorlib/js/dsstats.js?v=1.10"></script>
<script src="_content/dsstats.razorlib/js/dsstats.js?v=1.13"></script>
</body>

</html>
40 changes: 26 additions & 14 deletions src/dsstats.razorlib/wwwroot/js/dsstats.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//v1.12
//v1.13

const cmdrIconsMap = new Map();
let dsmodal = null;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c97226c

Please sign in to comment.