@@ -143,12 +143,9 @@ const isGameActionDisabled = computed(() => {
143143 return ! props .hasGameStarted || props .isGameOver || !! props .gameStatus
144144})
145145
146- // AI 对战时禁用"提议和棋",但"宣告和棋"仍可用
147146const isDrawOfferDisabled = computed (() => {
148147 if (isGameActionDisabled .value ) return true
149- // "宣告和棋"(满足条件时)总是可用
150148 if (isClaimableDraw .value ) return false
151- // "提议和棋"在 AI 模式下禁用
152149 if (props .gameMode === ' ai' ) return true
153150 return false
154151})
@@ -277,6 +274,14 @@ const INITIAL_PIECES: Record<PieceType, number> = {
277274 king: 1 ,
278275}
279276
277+ // 辅助函数:当棋子数量超过 10 个时截断并加上省略号
278+ const formatPieceIcons = (pieces : string [], limit = 10 ): string => {
279+ if (pieces .length <= limit ) {
280+ return pieces .join (' ' )
281+ }
282+ return pieces .slice (0 , limit ).join (' ' ) + ' …'
283+ }
284+
280285const materialDiffText = computed (() => {
281286 if (! props .board ) return ' '
282287
@@ -357,8 +362,8 @@ const materialDiffText = computed(() => {
357362 return ' '
358363 }
359364
360- // 根据玩家颜色决定显示顺序
361- const isWhitePlayer = props . playerColor === ' white '
365+ const useWhitePerspective = props . gameMode === ' human ' || props . playerColor === ' white '
366+ const isWhitePlayer = useWhitePerspective
362367 const myPieces = isWhitePlayer ? whiteDisplay : blackDisplay
363368 const opponentPieces = isWhitePlayer ? blackDisplay : whiteDisplay
364369
@@ -368,10 +373,10 @@ const materialDiffText = computed(() => {
368373
369374 const parts: string [] = []
370375 if (opponentPieces .length > 0 ) {
371- parts .push (opponentPieces . join ( ' ' ))
376+ parts .push (formatPieceIcons ( opponentPieces , 10 ))
372377 }
373378 if (myPieces .length > 0 ) {
374- parts .push (myPieces . join ( ' ' ))
379+ parts .push (formatPieceIcons ( myPieces , 10 ))
375380 }
376381 if (scoreStr ) {
377382 parts .push (scoreStr )
0 commit comments