fix: 添加gradle-wrapper.jar到版本管理,修复gitignore的*.jar误伤

This commit is contained in:
flykhan 2026-04-26 23:32:02 +08:00
parent e763f0388c
commit f1578742c2
6 changed files with 34 additions and 5 deletions

3
.gitignore vendored
View File

@ -55,6 +55,9 @@ google-services.json
*.tar.gz *.tar.gz
*.rar *.rar
# Gradle wrapper jar (required for build)
!gradle/wrapper/gradle-wrapper.jar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid* hs_err_pid*
replay_pid* replay_pid*

View File

@ -409,9 +409,7 @@ fun UnoApp() {
botNames = botNames, botNames = botNames,
handOffset = handOffset, handOffset = handOffset,
onBackToMenu = { onBackToMenu = {
navController.navigate(Screen.MainMenu.route) { navController.popBackStack()
popUpTo(0) { inclusive = true }
}
} }
) )
} }

View File

@ -113,9 +113,9 @@ fun GameOverScreen(
contentColor = Color.Black contentColor = Color.Black
) )
) { ) {
Icon(Icons.Default.Home, null) Icon(Icons.Default.Refresh, null)
Spacer(modifier = Modifier.width(8.dp)) Spacer(modifier = Modifier.width(8.dp))
Text("返回主菜单", fontSize = 18.sp, fontWeight = FontWeight.Bold) Text("再来一局", fontSize = 18.sp, fontWeight = FontWeight.Bold)
} }
} }
} }

View File

@ -36,6 +36,7 @@ fun GameScreen(
onChallengeUno: (String) -> Unit = {}, onChallengeUno: (String) -> Unit = {},
onShowLog: () -> Unit = {}, onShowLog: () -> Unit = {},
onPlaySeven: (Int) -> Unit = {}, onPlaySeven: (Int) -> Unit = {},
onBack: () -> Unit = {},
isSevenZeroMode: Boolean = false, isSevenZeroMode: Boolean = false,
handOffset: Float = 0f, handOffset: Float = 0f,
errorMessage: String errorMessage: String
@ -128,6 +129,9 @@ fun GameScreen(
color = LocalTextOnTable.current.copy(alpha = 0.6f), color = LocalTextOnTable.current.copy(alpha = 0.6f),
fontSize = 14.sp fontSize = 14.sp
) )
IconButton(onClick = { onBack() }, modifier = Modifier.size(28.dp)) {
Icon(Icons.Default.Close, "退出", tint = LocalTextOnTable.current.copy(alpha = 0.5f), modifier = Modifier.size(18.dp))
}
} }
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))

View File

@ -1,6 +1,7 @@
package com.unogame.ui.screens package com.unogame.ui.screens
import android.content.Context import android.content.Context
import androidx.activity.compose.BackHandler
import androidx.compose.animation.core.animateFloatAsState import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.spring import androidx.compose.animation.core.spring
import androidx.compose.foundation.background import androidx.compose.foundation.background
@ -170,6 +171,7 @@ fun LocalGameScreen(
var showLogDialog by remember { mutableStateOf(false) } var showLogDialog by remember { mutableStateOf(false) }
var showSwapTargetPicker by remember { mutableStateOf(false) } var showSwapTargetPicker by remember { mutableStateOf(false) }
var pendingSwapState by remember { mutableStateOf<GameState?>(null) } var pendingSwapState by remember { mutableStateOf<GameState?>(null) }
var showExitConfirm by remember { mutableStateOf(false) }
val myPlayerId = "human" val myPlayerId = "human"
val currentPlayer = gameState.currentPlayer val currentPlayer = gameState.currentPlayer
@ -611,6 +613,27 @@ fun LocalGameScreen(
playerCount = totalPlayers playerCount = totalPlayers
) )
} else { } else {
// 退出确认弹窗
if (showExitConfirm) {
AlertDialog(
onDismissRequest = { showExitConfirm = false },
title = { Text("退出游戏", color = GoldAccent) },
text = { Text("确定要退出当前对局吗?", color = Color.White.copy(alpha = 0.8f)) },
confirmButton = {
TextButton(onClick = { showExitConfirm = false; onBackToMenu() }) {
Text("退出", color = UnoRed)
}
},
dismissButton = {
TextButton(onClick = { showExitConfirm = false }) {
Text("继续", color = GoldAccent)
}
},
containerColor = DarkSurface
)
}
// 拦截系统返回键
BackHandler { showExitConfirm = true }
GameScreen( GameScreen(
gameState = gameState, gameState = gameState,
myCards = displayCards, myCards = displayCards,
@ -624,6 +647,7 @@ fun LocalGameScreen(
onDrawCard = { executeDraw() }, onDrawCard = { executeDraw() },
onChooseColor = { selectedWildColor = it }, onChooseColor = { selectedWildColor = it },
onShowLog = { showLogDialog = true }, onShowLog = { showLogDialog = true },
onBack = { showExitConfirm = true },
onCallUno = { onCallUno = {
// Mark player as having called UNO // Mark player as having called UNO
val updated = gameState.players.map { val updated = gameState.players.map {

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.