Skip to content

Commit

Permalink
feat(deck): draw list 文案支持自定义
Browse files Browse the repository at this point in the history
  • Loading branch information
MX-fox committed Oct 25, 2024
1 parent 62b30f0 commit 5274b6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions dice/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,9 @@ func setupBaseTextTemplate(d *Dice) {
"鸽子理由": guguReason,
},
"其它": {
"抽牌_牌堆列表": {
{"载入并开启的牌堆:\n{$t牌堆列表}", 1},
},
"抽牌_列表": {
{"{$t原始列表}", 1},
},
Expand Down Expand Up @@ -1724,6 +1727,9 @@ func setupBaseTextTemplate(d *Dice) {
},
},
"其它": {
"抽牌_牌堆列表": {
SubType: ".draw list",
},
"抽牌_列表": {
SubType: ".draw keys",
},
Expand Down
5 changes: 3 additions & 2 deletions dice/ext_deck.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ func RegisterBuiltinExtDeck(d *Dice) {
}

if strings.EqualFold(deckName, "list") { //nolint:nestif
text := "载入并开启的牌堆:\n"
text := ""
for _, i := range ctx.Dice.DeckList {
if i.Enable {
author := fmt.Sprintf(" 作者:%s", i.Author)
Expand All @@ -640,7 +640,8 @@ func RegisterBuiltinExtDeck(d *Dice) {
text += fmt.Sprintf("- %s 格式: %s%s%s 牌组数量: %d\n", i.Name, i.Format, author, version, count)
}
}
ReplyToSender(ctx, msg, text)
VarSetValueStr(ctx, "$t牌堆列表", text)
ReplyToSender(ctx, msg, DiceFormatTmpl(ctx, "其它:抽牌_牌堆列表"))
} else if strings.EqualFold(deckName, "desc") {
// 查看详情
text := cmdArgs.GetArgN(2)
Expand Down

0 comments on commit 5274b6a

Please sign in to comment.