@sjtdev/koishi-plugin-dota2tracker 2.0.2 → 2.0.3

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 CHANGED
@@ -2481,7 +2481,7 @@ var ImageRenderer = class extends import_koishi10.Service {
2481
2481
  $t: /* @__PURE__ */ __name((key, params) => this.ctx.dota2tracker.i18n.$t(languageTag, key, params), "$t"),
2482
2482
  languageTag,
2483
2483
  Random: import_koishi10.Random,
2484
- fontFamily: this.config.templateFonts,
2484
+ fontFamily: this.config.templateFonts.map((f) => `${f}`).join(", "),
2485
2485
  getImageUrl: this.getImageUrl.bind(this)
2486
2486
  };
2487
2487
  try {
@@ -2532,7 +2532,7 @@ var MessageBuilder = class extends import_koishi11.Service {
2532
2532
  }
2533
2533
  async buildHeroOfTheDayMessage(languageTag, heroRcmd, metaRcmd) {
2534
2534
  const $t = /* @__PURE__ */ __name((key, params) => this.ctx.dota2tracker.i18n.$t(languageTag, `commands.dota2tracker.hero-of-the-day.messages.${key}`, params), "$t");
2535
- let ejs2 = "<html><head><style>body{width:fit-content;height:fit-content;margin:0;padding:12px;}</style></head><body>";
2535
+ let ejs2 = "<html><head><style>body{width:fit-content;height:fit-content;margin:0;padding:12px;font-family:<%-fontFamily%>;}</style></head><body>";
2536
2536
  if (heroRcmd.recommendationType !== "LIFETIME_NO_RECORD") {
2537
2537
  ejs2 += `<h3>${$t("title_recommendation")}</h3>`;
2538
2538
  ejs2 += `<p>${$t("recommendation_intro")}</p>`;
@@ -2544,13 +2544,13 @@ var MessageBuilder = class extends import_koishi11.Service {
2544
2544
  ejs2 += `<p>${$t("details.table_intro")}</p>`;
2545
2545
  ejs2 += `<div style="display: grid;grid-template-columns: repeat(6, auto);gap: 10px;text-align: center;align-items: center;">`;
2546
2546
  ejs2 += `<div style="display: contents">
2547
- <div style="text-align:left">${$t("details.table_headers.hero")}</div>
2548
- <div>${$t("details.table_headers.recent_wins")}</div>
2549
- <div>${$t("details.table_headers.lifetime_wins")}</div>
2550
- <div>${$t("details.table_headers.imp_bonus")}</div>
2551
- <div>${$t("details.table_headers.is_hot_streak")}</div>
2552
- <div>${$t("details.table_headers.total_score")}</div>
2553
- </div>`;
2547
+ <div style="text-align:left">${$t("details.table_headers.hero")}</div>
2548
+ <div>${$t("details.table_headers.recent_wins")}</div>
2549
+ <div>${$t("details.table_headers.lifetime_wins")}</div>
2550
+ <div>${$t("details.table_headers.imp_bonus")}</div>
2551
+ <div>${$t("details.table_headers.is_hot_streak")}</div>
2552
+ <div>${$t("details.table_headers.total_score")}</div>
2553
+ </div>`;
2554
2554
  ejs2 += heroRcmd.recommendationPool.map(
2555
2555
  (hero) => `<div style="display: contents">
2556
2556
  <div style="text-align:left">${this.ctx.dota2tracker.i18n.getDisplayNameForHero(hero.heroId, languageTag, { forceOfficialName: true }) + (heroRcmd.recommendedHeroes.includes(hero.heroId) ? "*" : "")}</div>
@@ -2634,6 +2634,7 @@ var MessageBuilder = class extends import_koishi11.Service {
2634
2634
  padding: 16px;
2635
2635
  width: fit-content;
2636
2636
  background-color: #f7f7f7;
2637
+ font-family:<%-fontFamily%>;
2637
2638
  }
2638
2639
  table {
2639
2640
  border-collapse: collapse;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sjtdev/koishi-plugin-dota2tracker",
3
3
  "description": "koishi插件-追踪群友的DOTA2对局",
4
- "version": "2.0.2",
4
+ "version": "2.0.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -6,8 +6,8 @@
6
6
  <title>Document</title>
7
7
  <%- `<style>` %>
8
8
  <%- include(`./match_1/style.css`) %>
9
- <% if (fontFamily && fontFamily.length > 0) { %>
10
- <%- `body { font-family: ${fontFamily.map(f => `${f}`).join(", ")}; }` %>
9
+ <% if (fontFamily) { %>
10
+ <%- `body { font-family: ${fontFamily}; }` %>
11
11
  <% } %>
12
12
  <%- "</style>" %>
13
13
  <style>
@@ -8,8 +8,8 @@
8
8
  <%- "<style>" %>
9
9
  <%- include("./match_2/original.css") %>
10
10
  <%- include("./match_2+/extra.css") %>
11
- <% if (fontFamily && fontFamily.length > 0) { %>
12
- <%- `body { font-family: ${fontFamily.map(f => `${f}`).join(", ")}; }` %>
11
+ <% if (fontFamily) { %>
12
+ <%- `body { font-family: ${fontFamily}; }` %>
13
13
  <% } %>
14
14
  <%- "</style>" %>
15
15
  </head>
@@ -7,8 +7,8 @@
7
7
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" />
8
8
  <%- "<style>" %>
9
9
  <%- include("./match_2/original.css") %>
10
- <% if (fontFamily && fontFamily.length > 0) { %>
11
- <%- `body { font-family: ${fontFamily.map(f => `${f}`).join(", ")}; }` %>
10
+ <% if (fontFamily) { %>
11
+ <%- `body { font-family: ${fontFamily}; }` %>
12
12
  <% } %>
13
13
  <%- "</style>" %>
14
14
  </head>
@@ -346,9 +346,9 @@
346
346
  }
347
347
  </style>
348
348
 
349
- <% if (fontFamily && fontFamily.length > 0) { %>
349
+ <% if (fontFamily) { %>
350
350
  <%- "<style>" %>
351
- <%- `body { font-family: ${fontFamily.map(f => `${f}`).join(", ")}; }` %>
351
+ <%- `body { font-family: ${fontFamily}; }` %>
352
352
  <%- "</style>" %>
353
353
  <% } %>
354
354
  </head>
@@ -82,9 +82,9 @@
82
82
  }
83
83
  </style>
84
84
 
85
- <% if (fontFamily && fontFamily.length > 0) { %>
85
+ <% if (fontFamily) { %>
86
86
  <%- "<style>" %>
87
- <%- `body { font-family: ${fontFamily.map(f => `${f}`).join(", ")}; }` %>
87
+ <%- `body { font-family: ${fontFamily}; }` %>
88
88
  <%- "</style>" %>
89
89
  <% } %>
90
90
  </head>
@@ -135,9 +135,9 @@
135
135
  }
136
136
  </style>
137
137
 
138
- <% if (fontFamily && fontFamily.length > 0) { %>
138
+ <% if (fontFamily) { %>
139
139
  <%- "<style>" %>
140
- <%- `body { font-family: ${fontFamily.map(f => `${f}`).join(", ")}; }` %>
140
+ <%- `body { font-family: ${fontFamily}; }` %>
141
141
  <%- "</style>" %>
142
142
  <% } %>
143
143
  </head>