refactor: 自动截取整页

This commit is contained in:
lixiangwuxian
2024-10-13 16:04:05 +08:00
parent 2290146862
commit 9f5106663f
4 changed files with 19 additions and 7 deletions

View File

@@ -16,10 +16,10 @@ func (c Command) ToString() string {
if c.CommandName != "score" {
return ""
}
strWithRank := "玩家 %s 使用 %s 在 %s 的 %s 难度(星级为%.1f)中获得了 %d 分,排名第 %dpp 为 %.2f。"
strWithRank := "玩家 %s 使用 %s 在 %s 的 %s 难度(%.1f🌟)中获得了 %d 分,排名第 %dpp 为 %.2f。"
strWithoutRank := "玩家 %s 使用 %s 在 %s 的 %s 难度中获得了 %d 分,排名第 %d。"
strWithOutDevice := "玩家 %s 在 %s 的 %s 难度(星级为%.1f)中获得了 %d 分,排名第 %dpp 为 %.2f。"
strWithOutDeviceAndRank := "玩家 %s 在 %s 的 %s 难度(星级为%.1f)中获得了 %d 分。"
strWithOutDevice := "玩家 %s 在 %s 的 %s 难度(%.1f🌟)中获得了 %d 分,排名第 %dpp 为 %.2f。"
strWithOutDeviceAndRank := "玩家 %s 在 %s 的 %s 难度(%.1f🌟)中获得了 %d 分。"
hardStr := strings.Split(c.CommandData.Leaderboard.Difficulty.DifficultyRaw, "_")[1]
if c.CommandData.Leaderboard.Ranked && c.CommandData.Score.DeviceHmd != nil {
return fmt.Sprintf(strWithRank, c.CommandData.Score.LeaderboardPlayerInfo.Name, *c.CommandData.Score.DeviceHmd, c.CommandData.Leaderboard.SongName, hardStr, c.CommandData.Leaderboard.Stars, c.CommandData.Score.ModifiedScore, c.CommandData.Score.Rank, c.CommandData.Score.Pp)
@@ -138,9 +138,9 @@ type RecordDataLite struct {
}
func (r RecordDataLite) ToString() string {
formatedStrRanked := "%s%s 使用 %s 在 %s 的 %s 难度(%.1f星级)中获得了 %d 分pp 为 %.2f,准度为 %s。"
formatedStrRanked := "%s%s 使用 %s 在 %s 的 %s 难度(%.1f🌟)中获得了 %d 分pp 为 %.2f,准度为 %s。"
formatedStrUnranked := "%s, %s 使用 %s 在 %s 的 %s 难度中获得了 %d 分,准度为 %s。"
formatedStrWithoutDevice := "%s, %s 在 %s 的 %s 难度(%.1f星级)中获得了 %d 分pp 为 %.2f,准度为 %s。"
formatedStrWithoutDevice := "%s, %s 在 %s 的 %s 难度(%.1f🌟)中获得了 %d 分pp 为 %.2f,准度为 %s。"
formatedStrWithoutDeviceAndRank := "%s, %s 在 %s 的 %s 难度中获得了 %d 分,准度为 %s。"
hardStr := strings.Split(r.DifficultyRaw, "_")[1]
layout := "2006-01-02 15:04:05.999999999-07:00"