feat: 机器人专属色调,名字和边框使用各自颜色便于对局区分
This commit is contained in:
parent
c78a07363e
commit
167ebdff27
@ -27,15 +27,15 @@ fun PlayerAvatar(
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
val isBot = player.id.startsWith("bot_")
|
||||
val accentColor = if (player.isCurrentTurn) GoldAccent else Color.Gray
|
||||
val avatar = if (isBot) getBotAvatar(player.name) else null
|
||||
val bgColor = avatar?.color ?: accentColor
|
||||
val playerColor = avatar?.color ?: GoldAccent
|
||||
val borderColor = if (player.isCurrentTurn) GoldAccent else playerColor
|
||||
|
||||
Row(
|
||||
modifier = modifier
|
||||
.clip(RoundedCornerShape(12.dp))
|
||||
.background(if (isYou) DarkSurface.copy(alpha = 0.8f) else DarkCard)
|
||||
.border(2.dp, accentColor, RoundedCornerShape(12.dp))
|
||||
.border(2.dp, borderColor, RoundedCornerShape(12.dp))
|
||||
.padding(horizontal = 12.dp, vertical = 8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
@ -43,7 +43,7 @@ fun PlayerAvatar(
|
||||
modifier = Modifier
|
||||
.size(36.dp)
|
||||
.clip(CircleShape)
|
||||
.background(bgColor),
|
||||
.background(playerColor),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
if (avatar != null) {
|
||||
@ -67,7 +67,7 @@ fun PlayerAvatar(
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(
|
||||
text = player.name,
|
||||
color = Color.White,
|
||||
color = if (isBot) playerColor else Color.White,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 14.sp
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user