Feat: 优化自动存点通知样式,系统消息不显示头像,改为绿色左边框简洁条形
This commit is contained in:
@@ -189,21 +189,21 @@ class AutoSaveExp extends Command
|
||||
if ($actualJjbGain > 0) {
|
||||
$gainParts[] = "金币+{$actualJjbGain}";
|
||||
}
|
||||
$gainStr = ! empty($gainParts) ? '(' . implode(',', $gainParts) . ')' : '';
|
||||
$jjbDisplay = $user->jjb ?? 0;
|
||||
$gainStr = ! empty($gainParts) ? ' 本次获得:' . implode(',', $gainParts) : '';
|
||||
|
||||
$levelInfo = $user->user_level >= $superLevel
|
||||
? "级别({$user->user_level});经验({$user->exp_num});金币({$jjbDisplay}枚);已满级。"
|
||||
: "级别({$user->user_level});经验({$user->exp_num});金币({$jjbDisplay}枚)。";
|
||||
// 格式:⏰ 自动存点 · LV.100 · 经验 10,468 · 金币 8,345 · 已满级 · 本次获得:经验+1,金币+3
|
||||
$statusTag = $user->user_level >= $superLevel ? ' · 已满级 ✓' : '';
|
||||
$content = "⏰ 自动存点 · LV.{$user->user_level} · 经验 {$user->exp_num} · 金币 {$jjbDisplay}{$statusTag}{$gainStr}";
|
||||
|
||||
$noticeMsg = [
|
||||
'id' => $this->chatState->nextMessageId($roomId),
|
||||
'room_id' => $roomId,
|
||||
'from_user' => '系统',
|
||||
'to_user' => $username, // 定向推送给本人
|
||||
'content' => "【系统为你自动存点】{$levelInfo} {$gainStr}",
|
||||
'is_secret' => true, // 私信模式,只有本人能看到
|
||||
'font_color' => '#16a34a', // 草绿色
|
||||
'to_user' => $username, // 定向推送给本人
|
||||
'content' => $content,
|
||||
'is_secret' => false, // 由 to_user + from_user='系统' 控制显示位置
|
||||
'font_color' => '#16a34a', // 草绿色
|
||||
'action' => '',
|
||||
'sent_at' => now()->toDateTimeString(),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user