@sjtdev/koishi-plugin-dota2tracker 1.2.0-hotfix → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +24 -5
- package/package.json +1 -1
- package/template/match/match_1.ejs +1 -1
package/lib/index.js
CHANGED
|
@@ -642,12 +642,31 @@ function getFormattedMatchData(match) {
|
|
|
642
642
|
break;
|
|
643
643
|
}
|
|
644
644
|
let items_timelist = {};
|
|
645
|
-
|
|
645
|
+
const supportItemIds = [30, 40, 42, 43, 188];
|
|
646
|
+
player.supportItemsCount = supportItemIds.reduce((obj, key) => {
|
|
647
|
+
obj[key] = 0;
|
|
648
|
+
return obj;
|
|
649
|
+
}, {});
|
|
646
650
|
if (player.playbackData) {
|
|
651
|
+
const getNextElement = /* @__PURE__ */ __name(function() {
|
|
652
|
+
let currentIndex = 0;
|
|
653
|
+
return function() {
|
|
654
|
+
if (currentIndex >= this.length) {
|
|
655
|
+
return null;
|
|
656
|
+
}
|
|
657
|
+
const element = this[currentIndex];
|
|
658
|
+
currentIndex++;
|
|
659
|
+
return element;
|
|
660
|
+
};
|
|
661
|
+
}, "getNextElement");
|
|
647
662
|
for (let item of player.playbackData.purchaseEvents) {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
663
|
+
if (!supportItemIds.includes(item.itemId)) {
|
|
664
|
+
if (!items_timelist[item.itemId]) {
|
|
665
|
+
items_timelist[item.itemId] = [];
|
|
666
|
+
items_timelist[item.itemId].getNextElement = getNextElement.call(items_timelist[item.itemId]);
|
|
667
|
+
}
|
|
668
|
+
items_timelist[item.itemId].push(item.time);
|
|
669
|
+
}
|
|
651
670
|
switch (item.itemId) {
|
|
652
671
|
case 30:
|
|
653
672
|
case 40:
|
|
@@ -674,7 +693,7 @@ function getFormattedMatchData(match) {
|
|
|
674
693
|
player.items.push({
|
|
675
694
|
id: itemId,
|
|
676
695
|
name: cleanName,
|
|
677
|
-
time: items_timelist[itemId],
|
|
696
|
+
time: items_timelist[itemId]?.getNextElement ? items_timelist[itemId].getNextElement() : void 0,
|
|
678
697
|
isRecipe
|
|
679
698
|
});
|
|
680
699
|
} else {
|
package/package.json
CHANGED
|
@@ -756,7 +756,7 @@
|
|
|
756
756
|
<div class="titles">
|
|
757
757
|
${player.titles.map((item) => `<span style="color: ${item.color};">${item.name}</span>`).join(" ")}
|
|
758
758
|
</div>
|
|
759
|
-
|
|
759
|
+
${player.hero.id != 80 ? `
|
|
760
760
|
<div class="items">
|
|
761
761
|
<div class="items_normal">
|
|
762
762
|
${player.items
|