mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-17 05:37:46 +00:00
perf: 优化逻辑
This commit is contained in:
parent
1a3d7787cb
commit
5a6024b1f5
1 changed files with 7 additions and 5 deletions
|
|
@ -255,16 +255,17 @@ export class Remind extends ZZZPlugin {
|
||||||
return messages;
|
return messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const defaultConfig = settings.getConfig('remind');
|
||||||
// 检查式舆防卫战
|
// 检查式舆防卫战
|
||||||
try {
|
try {
|
||||||
const abyssRawData = await api.getFinalData('zzzChallenge', { deviceFp });
|
const abyssRawData = await api.getFinalData('zzzChallenge', { deviceFp });
|
||||||
if (!abyssRawData || !abyssRawData.has_data) {
|
if (!abyssRawData || !abyssRawData.has_data) {
|
||||||
messages.push('式舆防卫战S评级: 0/7');
|
messages.push('式舆防卫战S评级: 0/7');
|
||||||
} else {
|
} else {
|
||||||
const userThreshold = userConfig.abyssCheckLevel || 7;
|
const abyssCheckLevel = userConfig.abyssCheckLevel ?? defaultConfig.abyssCheckLevel;
|
||||||
const sCount = getSRankCountUpTo(abyssRawData.all_floor_detail, 7);
|
const sCount = getSRankCountUpTo(abyssRawData.all_floor_detail, 7);
|
||||||
const status = sCount >= userThreshold ? ' ✓' : '';
|
const status = sCount >= abyssCheckLevel ? ' ✓' : '';
|
||||||
if (showAll || sCount < userThreshold) {
|
if (showAll || sCount < abyssCheckLevel) {
|
||||||
messages.push(`式舆防卫战S评级: ${sCount}/7${status}`);
|
messages.push(`式舆防卫战S评级: ${sCount}/7${status}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -279,9 +280,10 @@ export class Remind extends ZZZPlugin {
|
||||||
if (!deadlyRawData || !deadlyRawData.has_data) {
|
if (!deadlyRawData || !deadlyRawData.has_data) {
|
||||||
messages.push('危局强袭战星星: 0/9');
|
messages.push('危局强袭战星星: 0/9');
|
||||||
} else {
|
} else {
|
||||||
|
const deadlyStars = userConfig.deadlyStars ?? defaultConfig.deadlyStars;
|
||||||
const totalStar = deadlyRawData.total_star || 0;
|
const totalStar = deadlyRawData.total_star || 0;
|
||||||
if (showAll || totalStar < userConfig.deadlyStars) {
|
const status = totalStar >= deadlyStars ? ' ✓' : '';
|
||||||
const status = totalStar >= userConfig.deadlyStars ? ' ✓' : '';
|
if (showAll || totalStar < deadlyStars) {
|
||||||
messages.push(`危局强袭战星星: ${totalStar}/9${status}`);
|
messages.push(`危局强袭战星星: ${totalStar}/9${status}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue