Skip to content

Commit

Permalink
Change monster form image order (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandregpereira authored Aug 18, 2024
1 parent b82d77e commit c0ece81
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ private fun MonsterRegistrationForm(
bottom = contentPadding.calculateBottomPadding() + 16.dp,
),
) {
MonsterHeaderForm(
MonsterImageForm(
keys = monster.keys,
infoState = monster.info,
onMonsterChanged = { intent.onMonsterChanged(monster.copy(info = it)) },
)
MonsterImageForm(
MonsterHeaderForm(
keys = monster.keys,
infoState = monster.info,
onMonsterChanged = { intent.onMonsterChanged(monster.copy(info = it)) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal fun LazyListScope.MonsterHeaderForm(
) {
FormLazy(
titleKey = keys.next(),
title = { strings.edit }
title = { strings.header }
) {
formItem(key = keys.next()) {
AppTextField(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ data class SpellPreviewState(
)

internal enum class SectionTitle {
Header,
Image,
Header,
Stats,
Speed,
AbilityScores,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ interface MonsterRegistrationStrings {
val damageType: String
val damageDice: String
val conditionType: String
val edit: String
val header: String
val group: String
val imageUrl: String
val type: String
Expand Down Expand Up @@ -174,7 +174,7 @@ internal data class MonsterRegistrationEnStrings(
override val damageType: String = "Damage Type",
override val damageDice: String = "Damage Dice",
override val conditionType: String = "Condition Type",
override val edit: String = "Edit",
override val header: String = "Header",
override val group: String = "Group",
override val imageUrl: String = "Image Url",
override val type: String = "Type",
Expand Down Expand Up @@ -288,7 +288,7 @@ internal data class MonsterRegistrationPtStrings(
override val damageType: String = "Tipo de Dano",
override val damageDice: String = "Dados de Dano",
override val conditionType: String = "Tipo de Condição",
override val edit: String = "Editar",
override val header: String = "Cabeçalho",
override val group: String = "Grupo",
override val imageUrl: String = "Url da Imagem",
override val type: String = "Tipo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ internal fun Monster.editBy(
return monster.copy(
name = state.info.name,
subtitle = state.info.subtitle,
group = state.info.group,
group = state.info.group.takeUnless { it.isBlank() },
challengeRatingData = monster.challengeRatingData.copy(
valueInString = state.info.challengeRating,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private fun SpellcastingType.name(strings: MonsterRegistrationStrings): String {

internal fun SectionTitle.name(strings: MonsterRegistrationStrings): String {
return when (this) {
SectionTitle.Header -> strings.edit
SectionTitle.Header -> strings.header
SectionTitle.Image -> strings.imageFormTitle
SectionTitle.Stats -> strings.stats
SectionTitle.Speed -> strings.speed
Expand All @@ -344,17 +344,17 @@ internal fun SectionTitle.name(strings: MonsterRegistrationStrings): String {
private fun MonsterState.createKeys(): List<String> {
val monster = this
return buildList {
add(SectionTitle.Image.name)
add("monsterHeader-image")
add("monsterHeader-image-url")
add("monsterHeader-image-color-light")
add("monsterHeader-image-color-dark")
add(SectionTitle.Header.name)
add("monsterHeader-name")
add("monsterHeader-subtitle")
add("monsterHeader-group")
add("monsterHeader-challengeRating")
add("monsterHeader-type")
add(SectionTitle.Image.name)
add("monsterHeader-image")
add("monsterHeader-image-url")
add("monsterHeader-image-color-light")
add("monsterHeader-image-color-dark")
add(SectionTitle.Stats.name)
add("stats-armorClass")
add("stats-hitPoints")
Expand Down

0 comments on commit c0ece81

Please sign in to comment.