mirror of
https://github.com/nacabaro/vbhelper.git
synced 2026-06-05 22:02:54 +00:00
Re-added missing UI pieces (HP bar, HP numbers, & exit button).
This commit is contained in:
parent
31fab9dba4
commit
9d0e68fb8a
@ -206,32 +206,59 @@ fun PlayerBattleView(
|
|||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.fillMaxSize()
|
modifier = Modifier.fillMaxSize()
|
||||||
|
) {
|
||||||
|
// Top section: Exit button, HP bar, and HP numbers
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(16.dp)
|
||||||
) {
|
) {
|
||||||
// Exit button at the top-right
|
// Exit button at the top-right
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.fillMaxWidth()
|
||||||
|
) {
|
||||||
Button(
|
Button(
|
||||||
onClick = { /* TODO: Add exit functionality */ },
|
onClick = { /* TODO: Add exit functionality */ },
|
||||||
modifier = Modifier
|
modifier = Modifier.align(Alignment.TopEnd),
|
||||||
.align(Alignment.TopEnd)
|
|
||||||
.padding(16.dp),
|
|
||||||
colors = ButtonDefaults.buttonColors(containerColor = Color.Red)
|
colors = ButtonDefaults.buttonColors(containerColor = Color.Red)
|
||||||
) {
|
) {
|
||||||
Text("Exit", color = Color.White, fontSize = 14.sp)
|
Text("Exit", color = Color.White, fontSize = 14.sp)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Main content
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
Column(
|
|
||||||
|
// Health bar
|
||||||
|
LinearProgressIndicator(
|
||||||
|
progress = battleSystem.playerHP / (activeCharacter?.baseHp?.toFloat() ?: 100f),
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.height(10.dp),
|
||||||
|
color = Color.Green,
|
||||||
|
trackColor = Color.Gray
|
||||||
|
)
|
||||||
|
|
||||||
|
// Health display numbers
|
||||||
|
Text(
|
||||||
|
text = "HP: ${battleSystem.playerHP.toInt()}/${activeCharacter?.baseHp ?: 100}",
|
||||||
|
fontSize = 14.sp,
|
||||||
|
color = Color.Black
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Middle section: Player Digimon only
|
||||||
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.padding(16.dp),
|
.padding(16.dp),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
contentAlignment = Alignment.Center
|
||||||
verticalArrangement = Arrangement.SpaceBetween
|
|
||||||
) {
|
) {
|
||||||
// Player Digimon
|
// Player Digimon (center)
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.size(80.dp),
|
.size(80.dp),
|
||||||
contentAlignment = Alignment.CenterStart
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
SpriteImage(
|
SpriteImage(
|
||||||
spriteName = activeCharacter?.charaId ?: "dim011_mon01",
|
spriteName = activeCharacter?.charaId ?: "dim011_mon01",
|
||||||
@ -274,7 +301,16 @@ fun PlayerBattleView(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bottom section: Critical bar and Attack button
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(16.dp)
|
||||||
|
.align(Alignment.BottomCenter),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
|
) {
|
||||||
// Critical bar
|
// Critical bar
|
||||||
LinearProgressIndicator(
|
LinearProgressIndicator(
|
||||||
progress = battleSystem.critBarProgress / 100f,
|
progress = battleSystem.critBarProgress / 100f,
|
||||||
@ -287,25 +323,6 @@ fun PlayerBattleView(
|
|||||||
|
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
// Health bar
|
|
||||||
LinearProgressIndicator(
|
|
||||||
progress = battleSystem.playerHP / (activeCharacter?.baseHp?.toFloat() ?: 100f),
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.height(10.dp),
|
|
||||||
color = Color.Green,
|
|
||||||
trackColor = Color.Gray
|
|
||||||
)
|
|
||||||
|
|
||||||
// Health display numbers
|
|
||||||
Text(
|
|
||||||
text = "HP: ${battleSystem.playerHP.toInt()}/${activeCharacter?.baseHp ?: 100}",
|
|
||||||
fontSize = 14.sp,
|
|
||||||
color = Color.Black
|
|
||||||
)
|
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
|
||||||
|
|
||||||
// Attack button
|
// Attack button
|
||||||
Button(
|
Button(
|
||||||
onClick = {
|
onClick = {
|
||||||
@ -396,8 +413,6 @@ fun PlayerBattleView(
|
|||||||
) {
|
) {
|
||||||
Text("Attack", color = Color.White, fontSize = 18.sp)
|
Text("Attack", color = Color.White, fontSize = 18.sp)
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user