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