koishi-plugin-ll-mc 3.0.7 → 3.0.8

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.
Files changed (2) hide show
  1. package/lib/index.js +3 -12
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -174,7 +174,7 @@ var Config = import_koishi.Schema.intersect([
174
174
  import_koishi.Schema.object({
175
175
  defaultMaxDisplayCount: import_koishi.Schema.number().min(0).default(20).description("排行榜默认显示的人数。设置为 0 则显示所有。"),
176
176
  isTimeInfoSupplementEnabled: import_koishi.Schema.boolean().default(true).description("是否在排行榜标题中显示生成时间。"),
177
- isUserMessagePercentageVisible: import_koishi.Schema.boolean().default(true).description("是否在排行榜中显示用户的消息数占比。"),
177
+ isUserMessagePercentageVisible: import_koishi.Schema.boolean().default(false).description("是否在排行榜中显示用户的消息数占比。"),
178
178
  hiddenUserIdsInLeaderboard: import_koishi.Schema.array(String).role("table").description("全局隐藏的用户 ID 列表,在所有用户排行榜中生效。"),
179
179
  hiddenChannelIdsInLeaderboard: import_koishi.Schema.array(String).role("table").description("全局隐藏的频道 ID 列表,在群排行榜中生效。")
180
180
  }).description("排行榜设置"),
@@ -1866,11 +1866,7 @@ ${targetUserRecord[0].username}
1866
1866
  // 找到拥有最大发言数的条目,因为它的文本通常最长
1867
1867
  const maxCountData = rankingData.find(d => d.count === maxCount) || rankingData[0] || { count: 1, percentage: 0 };
1868
1868
  let maxCountText = maxCount.toString();
1869
- if (config.isUserMessagePercentageVisible && maxCountData) {
1870
- const percentage = maxCountData.percentage;
1871
- let percentageStr = percentage < 0.01 && percentage > 0 ? '<0.01' : percentage.toFixed(percentage < 1 ? 2 : 0);
1872
- maxCountText += \` ( \${percentageStr}%)\`;
1873
- }
1869
+ // 原版 message-counter 渲染:不显示百分比(数字保持纯数字,避免混合字符导致字体回退错位)
1874
1870
  const maxCountTextWidth = context.measureText(maxCountText).width;
1875
1871
 
1876
1872
  // 最长进度条的宽度是固定的
@@ -1956,12 +1952,7 @@ ${targetUserRecord[0].username}
1956
1952
 
1957
1953
  // 绘制发言次数和百分比
1958
1954
  let countText = data.count.toString();
1959
- if (config.isUserMessagePercentageVisible) {
1960
- const percentage = data.percentage;
1961
- let percentageStr = percentage < 0.01 && percentage > 0 ? '<0.01' : percentage.toFixed(percentage < 1 ? 2 : 0);
1962
- countText += \` ( \${percentageStr}%)\`;
1963
- }
1964
-
1955
+ // 原版 message-counter 渲染:不显示百分比(数字保持纯数字,避免混合字符回退错位)
1965
1956
  const countTextWidth = context.measureText(countText).width;
1966
1957
  const countTextX = barX + barWidth + 10;
1967
1958
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ll-mc",
3
3
  "description": "消息数量统计插件(基于 koishi-plugin-message-counter 重做,官方QQ机器人兼容)",
4
- "version": "3.0.7",
4
+ "version": "3.0.8",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [