Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change monster form image order #326

Merged
merged 1 commit into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading