From 5d2d3877be48357ac8d4b554de4b9cab7dfe3ad2 Mon Sep 17 00:00:00 2001 From: lieren2023 <131325076+lieren2023@users.noreply.github.com> Date: Mon, 30 Oct 2023 22:33:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DupdatePlayerPositions?= =?UTF-8?q?=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/game/game.js b/game/game.js index aaa37fdd5..d4cc2125a 100644 --- a/game/game.js +++ b/game/game.js @@ -58146,13 +58146,13 @@ */ updatePlayerPositions:numberOfPlayers=>{ if(typeof numberOfPlayers!='number') numberOfPlayers=ui.arena.dataset.number; - //当人数小于8时,还是用以前的布局。 - if(!numberOfPlayers||numberOfPlayers<9) return; + //当人数不超过8人时,还是用以前的布局 + if(!numberOfPlayers||numberOfPlayers<=8) return; const playerPositions=ui.playerPositions; while(playerPositions.length){ playerPositions.pop().remove(); } - //单个人物的宽度。这里要设置玩家的实际的宽度 + //单个人物的宽度,这里要设置玩家的实际的宽度 const temporaryPlayer=ui.create.div('.player',ui.arena).hide(); const computedStyle=getComputedStyle(temporaryPlayer); const scale=6/numberOfPlayers; @@ -58163,10 +58163,10 @@ //列数,即假如8人场,除去自己后,上面7个人占7列 const columnCount=numberOfPlayers-1; const percentage=90/(columnCount-1); - //仅当游戏人数大于8人,且玩家的座位号大于0时,设置玩家的位置。因为0号位是game.me在最下方,无需设置。 + //仅当游戏人数大于8人,且玩家的座位号大于0时,设置玩家的位置;因为0号位是game.me在最下方,无需设置 for(let ordinal=1;ordinal.player[data-position='${ordinal}']{`,