change the hitpoint cell in the summary to a maxLabel.
This commit is contained in:
		
							parent
							
								
									1a07f5287f
								
							
						
					
					
						commit
						41a094009d
					
				
					 2 changed files with 41 additions and 13 deletions
				
			
		| 
						 | 
				
			
			@ -184,13 +184,14 @@ class SummaryFactory @Inject constructor(
 | 
			
		|||
 | 
			
		||||
                        val dexterity = sheet.dexterity + status[Property.DEXTERITY].sum
 | 
			
		||||
 | 
			
		||||
                        val hitPoint = label(
 | 
			
		||||
                        val hitPoint = maxLabel(
 | 
			
		||||
                            label = fire?.hitPoint?.let {
 | 
			
		||||
                                when (it.additional) {
 | 
			
		||||
                                    null, 0 -> "${it.value}"
 | 
			
		||||
                                    else -> "${it.value}+${it.additional}"
 | 
			
		||||
                                }
 | 
			
		||||
                            } ?: "?",
 | 
			
		||||
                            max = "${sheet.hitPoint}",
 | 
			
		||||
                        )
 | 
			
		||||
                        val armorClass = label(
 | 
			
		||||
                            label = "${sheet.armorClass + status[Property.ARMOR_CLASS].sum}",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,6 +2,7 @@ package com.pixelized.rplexicon.ui.screens.summary.composable.common
 | 
			
		|||
 | 
			
		||||
import androidx.annotation.StringRes
 | 
			
		||||
import androidx.compose.foundation.layout.Arrangement
 | 
			
		||||
import androidx.compose.foundation.layout.Column
 | 
			
		||||
import androidx.compose.foundation.layout.IntrinsicSize
 | 
			
		||||
import androidx.compose.foundation.layout.Row
 | 
			
		||||
import androidx.compose.foundation.layout.fillMaxWidth
 | 
			
		||||
| 
						 | 
				
			
			@ -108,6 +109,19 @@ fun SummaryRow(
 | 
			
		|||
private fun SummaryRowPreview() {
 | 
			
		||||
    LexiconTheme {
 | 
			
		||||
        Surface {
 | 
			
		||||
            Column {
 | 
			
		||||
                SummaryRow(
 | 
			
		||||
                    row = remember {
 | 
			
		||||
                        SummaryRowUio(
 | 
			
		||||
                            label = R.string.character_sheet_stat_strength,
 | 
			
		||||
                            c1 = mutableStateOf(label("16")),
 | 
			
		||||
                            c2 = mutableStateOf(label("14")),
 | 
			
		||||
                            c3 = mutableStateOf(label("14")),
 | 
			
		||||
                            c4 = mutableStateOf(label("8")),
 | 
			
		||||
                            c5 = mutableStateOf(label("8")),
 | 
			
		||||
                        )
 | 
			
		||||
                    }
 | 
			
		||||
                )
 | 
			
		||||
                SummaryRow(
 | 
			
		||||
                    row = remember {
 | 
			
		||||
                        SummaryRowUio(
 | 
			
		||||
| 
						 | 
				
			
			@ -120,6 +134,19 @@ private fun SummaryRowPreview() {
 | 
			
		|||
                        )
 | 
			
		||||
                    }
 | 
			
		||||
                )
 | 
			
		||||
                SummaryRow(
 | 
			
		||||
                    row = remember {
 | 
			
		||||
                        SummaryRowUio(
 | 
			
		||||
                            label = R.string.character_sheet_title_spell_slot_1,
 | 
			
		||||
                            c1 = mutableStateOf(none()),
 | 
			
		||||
                            c2 = mutableStateOf(maxLabel("4", "4")),
 | 
			
		||||
                            c3 = mutableStateOf(maxLabel("3", "3")),
 | 
			
		||||
                            c4 = mutableStateOf(none()),
 | 
			
		||||
                            c5 = mutableStateOf(maxLabel("4", "4")),
 | 
			
		||||
                        )
 | 
			
		||||
                    }
 | 
			
		||||
                )
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue