Remove translation from the alteration class.
This commit is contained in:
parent
8a212ce69d
commit
073b8ac61d
3 changed files with 17 additions and 17 deletions
|
|
@ -31,7 +31,6 @@ class SpellBookParser @Inject constructor() {
|
|||
row is List<*> -> {
|
||||
val name = row.parse(NAME)
|
||||
val level = row.parse(LEVEL)?.toIntOrNull()
|
||||
val originalName = row.parse(T_NAME)
|
||||
val school = parseSchool(row.parse(SCHOOL))
|
||||
val castingTime = row.parse(CASTING_TIME)
|
||||
val range = row.parse(RANGE)
|
||||
|
|
@ -40,7 +39,6 @@ class SpellBookParser @Inject constructor() {
|
|||
val ritual = row.parse(RITUAL)?.toBoolean() ?: false
|
||||
if (name != null
|
||||
&& level != null
|
||||
&& originalName != null
|
||||
&& school != null
|
||||
&& castingTime != null
|
||||
&& range != null
|
||||
|
|
@ -49,7 +47,6 @@ class SpellBookParser @Inject constructor() {
|
|||
) {
|
||||
Spell(
|
||||
name = name,
|
||||
originalName = originalName,
|
||||
level = level,
|
||||
school = school,
|
||||
castingTime = castingTime,
|
||||
|
|
@ -77,7 +74,6 @@ class SpellBookParser @Inject constructor() {
|
|||
|
||||
companion object {
|
||||
private const val NAME = "Nom"
|
||||
private const val T_NAME = "Traduction"
|
||||
private const val SCHOOL = "École"
|
||||
private const val LEVEL = "Niveau"
|
||||
private const val CASTING_TIME = "Temps d'incantation"
|
||||
|
|
@ -89,7 +85,6 @@ class SpellBookParser @Inject constructor() {
|
|||
private val COLUMNS
|
||||
get() = listOf(
|
||||
NAME,
|
||||
T_NAME,
|
||||
LEVEL,
|
||||
SCHOOL,
|
||||
CASTING_TIME,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ import com.pixelized.rplexicon.utilitary.extentions.local.icon
|
|||
data class SpellUio(
|
||||
@DrawableRes val icon: Int,
|
||||
val name: String,
|
||||
val translated: String,
|
||||
val translated: String?,
|
||||
val castingTime: String,
|
||||
val range: String,
|
||||
val duration: String,
|
||||
|
|
@ -95,6 +95,7 @@ fun Spell(
|
|||
maxLines = 1,
|
||||
text = spell.name,
|
||||
)
|
||||
spell.translated?.let {
|
||||
Text(
|
||||
modifier = Modifier.alignByBaseline(),
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
|
|
@ -102,9 +103,10 @@ fun Spell(
|
|||
fontStyle = FontStyle.Italic,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
maxLines = 1,
|
||||
text = spell.translated,
|
||||
text = it,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(space = 4.dp),
|
||||
|
|
|
|||
|
|
@ -3,13 +3,16 @@ package com.pixelized.rplexicon.ui.screens.character.factory
|
|||
import com.pixelized.rplexicon.model.AssignedSpell
|
||||
import com.pixelized.rplexicon.model.CharacterSheet
|
||||
import com.pixelized.rplexicon.model.Property
|
||||
import com.pixelized.rplexicon.repository.data.DescriptionRepository
|
||||
import com.pixelized.rplexicon.ui.screens.character.composable.actions.SpellUio
|
||||
import com.pixelized.rplexicon.utilitary.extentions.icon
|
||||
import com.pixelized.rplexicon.utilitary.extentions.local.icon
|
||||
import com.pixelized.rplexicon.utilitary.extentions.modifier
|
||||
import javax.inject.Inject
|
||||
|
||||
class SpellUioFactory @Inject constructor() {
|
||||
class SpellUioFactory @Inject constructor(
|
||||
private val descriptionRepository: DescriptionRepository,
|
||||
) {
|
||||
|
||||
fun toUio(assignedSpell: AssignedSpell, characterSheet: CharacterSheet): SpellUio {
|
||||
val hit = assignedSpell.hit?.let { dice ->
|
||||
|
|
@ -48,7 +51,7 @@ class SpellUioFactory @Inject constructor() {
|
|||
return SpellUio(
|
||||
icon = assignedSpell.spell.school.icon,
|
||||
name = assignedSpell.spell.name,
|
||||
translated = assignedSpell.spell.originalName,
|
||||
translated = descriptionRepository.find(name = assignedSpell.spell.name)?.original,
|
||||
castingTime = assignedSpell.spell.castingTime,
|
||||
range = assignedSpell.spell.range,
|
||||
duration = assignedSpell.spell.duration,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue