mirror of
https://github.com/jie65535/mirai-console-jhr-plugin.git
synced 2025-07-28 18:59:14 +08:00
调整 榜单不再at 且仅列出本群排名
修复 上次提交改出的渲染问题
This commit is contained in:
parent
1e9b96a43b
commit
8c448602e1
@ -19,7 +19,7 @@ import net.mamoe.mirai.utils.info
|
|||||||
import top.jie65535.jhr.game.Bet
|
import top.jie65535.jhr.game.Bet
|
||||||
import top.jie65535.jhr.game.Horse
|
import top.jie65535.jhr.game.Horse
|
||||||
import top.jie65535.jhr.game.PlayerStatistics
|
import top.jie65535.jhr.game.PlayerStatistics
|
||||||
import java.lang.Integer.max
|
import java.lang.Integer.min
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.random.Random
|
import kotlin.random.Random
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ object JHorseRacing : KotlinPlugin(
|
|||||||
for (j in horse.position until lapLength)
|
for (j in horse.position until lapLength)
|
||||||
sb.append("Ξ")
|
sb.append("Ξ")
|
||||||
sb.append(horseTypes[horse.type])
|
sb.append(horseTypes[horse.type])
|
||||||
for (j in 0 until max(lapLength, horse.position))
|
for (j in 0 until min(lapLength, horse.position))
|
||||||
sb.append("Ξ")
|
sb.append("Ξ")
|
||||||
sb.appendLine()
|
sb.appendLine()
|
||||||
}
|
}
|
||||||
@ -435,10 +435,11 @@ object JHorseRacing : KotlinPlugin(
|
|||||||
msg == "排名" || msg == "积分榜" -> {
|
msg == "排名" || msg == "积分榜" -> {
|
||||||
val msgB = MessageChainBuilder(11)
|
val msgB = MessageChainBuilder(11)
|
||||||
msgB.append("积分榜\n")
|
msgB.append("积分榜\n")
|
||||||
JHRPluginData.Scores.entries.sortedByDescending { it.value }
|
JHRPluginData.Scores.entries.filter { subject.contains(it.key) }
|
||||||
|
.sortedByDescending { it.value }
|
||||||
.take(10)
|
.take(10)
|
||||||
.onEach {
|
.onEach {
|
||||||
msgB.append(At(it.key)).append(" ${it.value}\n")
|
msgB.append("${subject[it.key]!!.nameCard} | ${it.value} |\n")
|
||||||
}
|
}
|
||||||
subject.sendMessage(msgB.asMessageChain())
|
subject.sendMessage(msgB.asMessageChain())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user