feat: add reputation scores display panel (Closes #12)
Add ReputationPanel showing Street Cred, Notoriety, and Public Awareness from CharacterData. Displayed in Overview tab below derived attributes, with centered value/label layout. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,7 @@ object TestTags {
|
||||
const val PANEL_RESOURCES = "panel_resources"
|
||||
const val PANEL_DERIVED_ATTRIBUTES = "panel_derived_attributes"
|
||||
const val PANEL_DAMAGE_MONITOR = "panel_damage_monitor"
|
||||
const val PANEL_REPUTATION = "panel_reputation"
|
||||
|
||||
// --- Navigation items ---
|
||||
const val NAV_CHARACTER_SHEET = "nav_character_sheet"
|
||||
|
||||
@@ -180,6 +180,7 @@ private fun OverviewContent(
|
||||
CharacterHeader(character.characterData, onEdit = onEditCharacterData)
|
||||
ResourcePanel(character.characterData, character.attributes.edge)
|
||||
DerivedAttributesPanel(character.attributes)
|
||||
ReputationPanel(character.characterData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,6 +209,7 @@ private fun ExpandedOverviewContent(
|
||||
DerivedAttributesPanel(character.attributes)
|
||||
}
|
||||
}
|
||||
ReputationPanel(character.characterData)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package org.shahondin1624.lib.components.charactermodel
|
||||
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import org.shahondin1624.lib.components.TestTags
|
||||
import org.shahondin1624.lib.components.UiConstants
|
||||
import org.shahondin1624.model.characterdata.CharacterData
|
||||
import org.shahondin1624.theme.LocalWindowSizeClass
|
||||
|
||||
/**
|
||||
* Compact reputation panel showing Street Cred, Notoriety, and Public Awareness.
|
||||
*/
|
||||
@Composable
|
||||
fun ReputationPanel(characterData: CharacterData) {
|
||||
val windowSizeClass = LocalWindowSizeClass.current
|
||||
val padding = UiConstants.Spacing.medium(windowSizeClass)
|
||||
val spacing = UiConstants.Spacing.small(windowSizeClass)
|
||||
|
||||
Card(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.testTag(TestTags.PANEL_REPUTATION)
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(padding)
|
||||
) {
|
||||
Text(
|
||||
text = "Reputation",
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
fontWeight = FontWeight.Bold,
|
||||
modifier = Modifier.padding(bottom = spacing)
|
||||
)
|
||||
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceEvenly
|
||||
) {
|
||||
ReputationItem("Street Cred", characterData.streetCred)
|
||||
ReputationItem("Notoriety", characterData.notoriety)
|
||||
ReputationItem("Public Awareness", characterData.publicAwareness)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ReputationItem(label: String, value: Int) {
|
||||
Column(
|
||||
horizontalAlignment = androidx.compose.ui.Alignment.CenterHorizontally
|
||||
) {
|
||||
Text(
|
||||
text = value.toString(),
|
||||
style = MaterialTheme.typography.headlineSmall,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
Text(
|
||||
text = label,
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user