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.
- package/lib/index.js +3 -12
- 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(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|