Add alteration to the summary page.
This commit is contained in:
parent
a9d17c8910
commit
c8e7fee2c2
26 changed files with 596 additions and 24 deletions
|
|
@ -58,6 +58,16 @@ class AlterationRepository @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get a list of Active [Alteration] for a character
|
||||
* @return a list of alterations.
|
||||
*/
|
||||
fun getActiveAlterations(character: String): List<Alteration> {
|
||||
return _assignedAlterations.value[character]?.filter { alteration ->
|
||||
fireRepository.status.value[character + alteration.name] == true
|
||||
} ?: emptyList()
|
||||
}
|
||||
|
||||
/**
|
||||
* get a map of [Property] and [Alteration.Status] for a given player if the alteration is active.
|
||||
* @param character the character name
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.pixelized.rplexicon.ui.screens.character.composable.alteration
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.State
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import com.pixelized.rplexicon.ui.screens.character.pages.alteration.AlterationDetail
|
||||
import com.pixelized.rplexicon.ui.screens.character.pages.alteration.AlterationDetailUio
|
||||
|
||||
@Composable
|
||||
fun AlterationDetailHandler(
|
||||
detail: State<AlterationDetailUio?>,
|
||||
onDismissRequest: () -> Unit,
|
||||
) {
|
||||
detail.value?.let {
|
||||
Dialog(
|
||||
properties = remember { DialogProperties(usePlatformDefaultWidth = false) },
|
||||
onDismissRequest = onDismissRequest,
|
||||
) {
|
||||
AlterationDetail(
|
||||
detail = it,
|
||||
onClose = onDismissRequest,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
package com.pixelized.rplexicon.ui.screens.character.pages.alteration
|
||||
|
||||
import android.content.res.Configuration.UI_MODE_NIGHT_NO
|
||||
|
|
@ -23,6 +24,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
|
|||
import com.pixelized.rplexicon.ui.composable.CategoryHeader
|
||||
import com.pixelized.rplexicon.ui.screens.character.composable.actions.AlterationItem
|
||||
import com.pixelized.rplexicon.ui.screens.character.composable.actions.AlterationItemUio
|
||||
import com.pixelized.rplexicon.ui.screens.character.composable.alteration.AlterationDetailHandler
|
||||
import com.pixelized.rplexicon.ui.screens.rolls.preview.rememberRollAlterations
|
||||
import com.pixelized.rplexicon.ui.theme.LexiconTheme
|
||||
import kotlinx.coroutines.launch
|
||||
|
|
@ -91,24 +93,6 @@ fun AlterationPageContent(
|
|||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun AlterationDetailHandler(
|
||||
detail: State<AlterationDetailUio?>,
|
||||
onDismissRequest: () -> Unit,
|
||||
) {
|
||||
detail.value?.let {
|
||||
Dialog(
|
||||
properties = remember { DialogProperties(usePlatformDefaultWidth = false) },
|
||||
onDismissRequest = onDismissRequest,
|
||||
) {
|
||||
AlterationDetail(
|
||||
detail = it,
|
||||
onClose = onDismissRequest,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
@Preview(uiMode = UI_MODE_NIGHT_NO)
|
||||
@Preview(uiMode = UI_MODE_NIGHT_YES)
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ import com.pixelized.rplexicon.R
|
|||
import com.pixelized.rplexicon.ui.composable.KeepOnScreen
|
||||
import com.pixelized.rplexicon.ui.navigation.LocalScreenNavHost
|
||||
import com.pixelized.rplexicon.ui.navigation.screens.navigateToCharacterSheet
|
||||
import com.pixelized.rplexicon.ui.screens.character.composable.alteration.AlterationDetailHandler
|
||||
import com.pixelized.rplexicon.ui.screens.rolls.composable.ThrowsCard
|
||||
import com.pixelized.rplexicon.ui.screens.rolls.composable.ThrowsCardUio
|
||||
import com.pixelized.rplexicon.ui.screens.summary.pages.statistic.StatisticSummary
|
||||
|
|
@ -66,6 +67,7 @@ fun SummaryScreen(
|
|||
val extendProficiencies = rememberSaveable { mutableStateOf(true) }
|
||||
val extendPassives = rememberSaveable { mutableStateOf(true) }
|
||||
val extendSpells = rememberSaveable { mutableStateOf(true) }
|
||||
val extendStatus = rememberSaveable { mutableStateOf(true) }
|
||||
|
||||
Surface(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
|
|
@ -88,6 +90,7 @@ fun SummaryScreen(
|
|||
extendProficiencies = extendProficiencies,
|
||||
extendPassives = extendPassives,
|
||||
extendSpells = extendSpells,
|
||||
extendStatus = extendStatus,
|
||||
onClass = { screen.navigateToCharacterSheet(name = it.label) },
|
||||
onDice = { statisticsViewModel.showDetail(dice = it) },
|
||||
onAttribute = { extendAttribute.value = it },
|
||||
|
|
@ -96,6 +99,13 @@ fun SummaryScreen(
|
|||
onProficiencies = { extendProficiencies.value = it },
|
||||
onPassives = { extendPassives.value = it },
|
||||
onSpells = { extendSpells.value = it },
|
||||
onStatus = { extendStatus.value = it },
|
||||
onAlteration = {
|
||||
statisticsViewModel.showAlterationDetail(
|
||||
name = it.id,
|
||||
character = it.character,
|
||||
)
|
||||
}
|
||||
)
|
||||
},
|
||||
)
|
||||
|
|
@ -108,6 +118,11 @@ fun SummaryScreen(
|
|||
detail = statisticsViewModel.detail,
|
||||
onDetail = { statisticsViewModel.hideDetail() },
|
||||
)
|
||||
|
||||
AlterationDetailHandler(
|
||||
detail = statisticsViewModel.alterationDetail,
|
||||
onDismissRequest = { statisticsViewModel.hideAlterationDetail() },
|
||||
)
|
||||
}
|
||||
|
||||
KeepOnScreen()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,217 @@
|
|||
package com.pixelized.rplexicon.ui.screens.summary.composable
|
||||
|
||||
import android.content.res.Configuration
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.animation.animateContentSize
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.IntrinsicSize
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.CutCornerShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.minimumInteractiveComponentSize
|
||||
import androidx.compose.material3.Divider
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.MutableState
|
||||
import androidx.compose.runtime.Stable
|
||||
import androidx.compose.runtime.State
|
||||
import androidx.compose.runtime.derivedStateOf
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.pixelized.rplexicon.R
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.preview.statistic.rememberStatusSummary
|
||||
import com.pixelized.rplexicon.ui.theme.LexiconTheme
|
||||
import com.pixelized.rplexicon.utilitary.extentions.ddBorder
|
||||
import com.pixelized.rplexicon.utilitary.extentions.lexicon
|
||||
import com.pixelized.rplexicon.utilitary.extentions.verticalDivider
|
||||
|
||||
@Stable
|
||||
data class StatusSummaryUio(
|
||||
val max: MutableState<Int>,
|
||||
val c1: MutableState<List<Status>>,
|
||||
val c2: MutableState<List<Status>>,
|
||||
val c3: MutableState<List<Status>>,
|
||||
val c4: MutableState<List<Status>>,
|
||||
val c5: MutableState<List<Status>>,
|
||||
) {
|
||||
operator fun get(index: Int): MutableState<List<Status>>? {
|
||||
return when (index) {
|
||||
0 -> c1
|
||||
1 -> c2
|
||||
2 -> c3
|
||||
3 -> c4
|
||||
4 -> c5
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
@Stable
|
||||
data class Status(
|
||||
val character: String,
|
||||
val id: String,
|
||||
@DrawableRes val icon: Int,
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun StatusSummary(
|
||||
modifier: Modifier = Modifier,
|
||||
status: StatusSummaryUio,
|
||||
extended: State<Boolean>,
|
||||
onStatus: (StatusSummaryUio.Status) -> Unit,
|
||||
onClick: () -> Unit,
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.ddBorder(
|
||||
inner = remember { RoundedCornerShape(size = 8.dp) },
|
||||
outline = remember { CutCornerShape(size = 16.dp) },
|
||||
)
|
||||
.clickable(onClick = onClick)
|
||||
.padding(start = 8.dp, top = 4.dp, bottom = 4.dp)
|
||||
.then(other = modifier),
|
||||
horizontalAlignment = Alignment.End,
|
||||
) {
|
||||
AnimatedVisibility(
|
||||
visible = extended.value,
|
||||
) {
|
||||
Column(modifier = Modifier.animateContentSize()) {
|
||||
for (index in 0 until status.max.value) {
|
||||
Row(
|
||||
modifier = Modifier.height(intrinsicSize = IntrinsicSize.Min),
|
||||
) {
|
||||
val c1 by remember {
|
||||
derivedStateOf {
|
||||
status.c1.value.getOrNull(index)
|
||||
}
|
||||
}
|
||||
Divider(
|
||||
modifier = Modifier.verticalDivider(),
|
||||
)
|
||||
SummaryIcon(
|
||||
icon = c1?.icon,
|
||||
onClick = { c1?.let(onStatus) }
|
||||
)
|
||||
|
||||
val c2 by remember {
|
||||
derivedStateOf {
|
||||
status.c2.value.getOrNull(index)
|
||||
}
|
||||
}
|
||||
Divider(
|
||||
modifier = Modifier.verticalDivider(),
|
||||
)
|
||||
SummaryIcon(
|
||||
icon = c2?.icon,
|
||||
onClick = { c2?.let(onStatus) }
|
||||
)
|
||||
|
||||
val c3 by remember {
|
||||
derivedStateOf {
|
||||
status.c3.value.getOrNull(index)
|
||||
}
|
||||
}
|
||||
Divider(
|
||||
modifier = Modifier.verticalDivider(),
|
||||
)
|
||||
SummaryIcon(
|
||||
icon = c3?.icon,
|
||||
onClick = { c3?.let(onStatus) }
|
||||
)
|
||||
|
||||
val c4 by remember {
|
||||
derivedStateOf {
|
||||
status.c4.value.getOrNull(index)
|
||||
}
|
||||
}
|
||||
Divider(
|
||||
modifier = Modifier.verticalDivider(),
|
||||
)
|
||||
SummaryIcon(
|
||||
icon = c4?.icon,
|
||||
onClick = { c4?.let(onStatus) }
|
||||
)
|
||||
|
||||
val c5 by remember {
|
||||
derivedStateOf {
|
||||
status.c5.value.getOrNull(index)
|
||||
}
|
||||
}
|
||||
Divider(
|
||||
modifier = Modifier.verticalDivider(),
|
||||
)
|
||||
SummaryIcon(
|
||||
icon = c5?.icon,
|
||||
onClick = { c5?.let(onStatus) }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.padding(vertical = 4.dp)
|
||||
.align(alignment = Alignment.CenterHorizontally),
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
text = stringResource(id = R.string.character_sheet_title_status)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Composable
|
||||
fun SummaryIcon(
|
||||
modifier: Modifier = Modifier,
|
||||
@DrawableRes icon: Int?,
|
||||
onClick: () -> Unit,
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.clickable(enabled = icon != null, onClick = onClick)
|
||||
.size(size = MaterialTheme.lexicon.dimens.summary.cell)
|
||||
.then(other = modifier),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
icon?.let {
|
||||
Icon(
|
||||
painter = painterResource(id = it),
|
||||
contentDescription = null,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Composable
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
private fun StatusSummaryPreview() {
|
||||
LexiconTheme {
|
||||
Surface {
|
||||
StatusSummary(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
status = rememberStatusSummary(),
|
||||
extended = remember { mutableStateOf(true) },
|
||||
onStatus = { },
|
||||
onClick = { },
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,7 @@ fun rememberStatisticSummary(): StatisticSummaryUio {
|
|||
val proficiencies = rememberProficienciesSummary()
|
||||
val passives = rememberPassivesSummary()
|
||||
val spells = rememberSpellsSummary()
|
||||
val status = rememberStatusSummary()
|
||||
|
||||
return remember {
|
||||
StatisticSummaryUio(
|
||||
|
|
@ -33,6 +34,8 @@ fun rememberStatisticSummary(): StatisticSummaryUio {
|
|||
passives = passives,
|
||||
spellsVisibility = mutableStateOf(true),
|
||||
spells = spells,
|
||||
statusVisibility = mutableStateOf(true),
|
||||
status = status,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.pixelized.rplexicon.ui.screens.summary.composable.preview.statistic
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.Stable
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import com.pixelized.rplexicon.R
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.StatusSummaryUio
|
||||
|
||||
@Composable
|
||||
@Stable
|
||||
fun rememberStatusSummary(): StatusSummaryUio {
|
||||
return remember {
|
||||
StatusSummaryUio(
|
||||
max = mutableIntStateOf(2),
|
||||
c1 = mutableStateOf(
|
||||
listOf(
|
||||
StatusSummaryUio.Status(
|
||||
character = "Bulkhai",
|
||||
id = "frightened",
|
||||
icon = R.drawable.ic_status_frightened_24dp
|
||||
),
|
||||
)
|
||||
),
|
||||
c2 = mutableStateOf(emptyList()),
|
||||
c3 = mutableStateOf(emptyList()),
|
||||
c4 = mutableStateOf(emptyList()),
|
||||
c5 = mutableStateOf(
|
||||
listOf(
|
||||
StatusSummaryUio.Status(
|
||||
character = "Unathana",
|
||||
id = "paralyzed",
|
||||
icon = R.drawable.ic_status_paralyzed_24dp
|
||||
),
|
||||
StatusSummaryUio.Status(
|
||||
character = "Unathana",
|
||||
id = "poisoned",
|
||||
icon = R.drawable.ic_status_poisoned_24dp
|
||||
),
|
||||
)
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -47,6 +47,8 @@ import com.pixelized.rplexicon.ui.screens.summary.composable.SavingThrowsSummary
|
|||
import com.pixelized.rplexicon.ui.screens.summary.composable.SavingThrowsSummaryUio
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.SpellSummary
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.SpellSummaryUio
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.StatusSummary
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.StatusSummaryUio
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.preview.statistic.rememberStatisticSummary
|
||||
import com.pixelized.rplexicon.ui.theme.LexiconTheme
|
||||
|
||||
|
|
@ -66,6 +68,8 @@ data class StatisticSummaryUio(
|
|||
val passives: PassivesSummaryUio,
|
||||
val spellsVisibility: State<Boolean>,
|
||||
val spells: SpellSummaryUio,
|
||||
val statusVisibility: State<Boolean>,
|
||||
val status: StatusSummaryUio,
|
||||
)
|
||||
|
||||
@Composable
|
||||
|
|
@ -81,15 +85,18 @@ fun StatisticSummary(
|
|||
extendProficiencies: State<Boolean>,
|
||||
extendPassives: State<Boolean>,
|
||||
extendSpells: State<Boolean>,
|
||||
extendStatus: State<Boolean>,
|
||||
onAttribute: (Boolean) -> Unit,
|
||||
onCharacteristic: (Boolean) -> Unit,
|
||||
onSavingThrows: (Boolean) -> Unit,
|
||||
onProficiencies: (Boolean) -> Unit,
|
||||
onPassives: (Boolean) -> Unit,
|
||||
onSpells: (Boolean) -> Unit,
|
||||
onStatus: (Boolean) -> Unit,
|
||||
onAlteration: (StatusSummaryUio.Status) -> Unit,
|
||||
) {
|
||||
val density = LocalDensity.current
|
||||
|
||||
|
||||
val headerSize = remember {
|
||||
mutableStateOf(IntSize.Zero)
|
||||
}
|
||||
|
|
@ -104,12 +111,11 @@ fun StatisticSummary(
|
|||
) {
|
||||
Column(
|
||||
modifier = Modifier.verticalScroll(state = scrollState),
|
||||
verticalArrangement = Arrangement.spacedBy(space = 16.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(space = 8.dp),
|
||||
) {
|
||||
Spacer(
|
||||
modifier = Modifier.height(height = headerHeight.value),
|
||||
)
|
||||
|
||||
AnimatedVisibility(
|
||||
visible = summary.statsVisibility.value,
|
||||
enter = enterTransition(),
|
||||
|
|
@ -176,6 +182,18 @@ fun StatisticSummary(
|
|||
onClick = { onSpells(extendSpells.value.not()) },
|
||||
)
|
||||
}
|
||||
AnimatedVisibility(
|
||||
visible = summary.statusVisibility.value && summary.status.max.value > 0,
|
||||
enter = enterTransition(),
|
||||
) {
|
||||
StatusSummary(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
status = summary.status,
|
||||
extended = extendStatus,
|
||||
onClick = { onStatus(extendStatus.value.not()) },
|
||||
onStatus = onAlteration,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
AnimatedVisibility(
|
||||
|
|
@ -219,8 +237,8 @@ private fun rememberHeaderBackgroundGradient(): Brush {
|
|||
}
|
||||
|
||||
@Composable
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO, heightDp = 1680)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES, heightDp = 1680)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO, heightDp = 2000)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES, heightDp = 2000)
|
||||
fun StatisticSummaryPreview() {
|
||||
LexiconTheme {
|
||||
Surface {
|
||||
|
|
@ -235,12 +253,15 @@ fun StatisticSummaryPreview() {
|
|||
extendProficiencies = remember { mutableStateOf(true) },
|
||||
extendPassives = remember { mutableStateOf(true) },
|
||||
extendSpells = remember { mutableStateOf(true) },
|
||||
extendStatus = remember { mutableStateOf(true) },
|
||||
onAttribute = { },
|
||||
onCharacteristic = { },
|
||||
onSavingThrows = { },
|
||||
onProficiencies = { },
|
||||
onPassives = { },
|
||||
onSpells = { },
|
||||
onStatus = { },
|
||||
onAlteration = { },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +1,46 @@
|
|||
package com.pixelized.rplexicon.ui.screens.summary.pages.statistic
|
||||
|
||||
import android.app.Application
|
||||
import androidx.compose.runtime.State
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.lifecycle.AndroidViewModel
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.pixelized.rplexicon.R
|
||||
import com.pixelized.rplexicon.data.repository.authentication.FirebaseRepository
|
||||
import com.pixelized.rplexicon.data.repository.character.AlterationRepository
|
||||
import com.pixelized.rplexicon.data.repository.character.DescriptionRepository
|
||||
import com.pixelized.rplexicon.ui.screens.character.pages.alteration.AlterationDetailUio
|
||||
import com.pixelized.rplexicon.ui.screens.rolls.composable.ThrowCardFactory
|
||||
import com.pixelized.rplexicon.ui.screens.rolls.composable.ThrowsCardUio
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.ClassHeaderSummaryUio
|
||||
import com.pixelized.rplexicon.utilitary.extentions.context
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.lang.Appendable
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
class StatisticViewModel @Inject constructor(
|
||||
private val firebaseRepository: FirebaseRepository,
|
||||
private val throwCardFactory: ThrowCardFactory,
|
||||
private val alterationRepository: AlterationRepository,
|
||||
private val descriptionRepository: DescriptionRepository,
|
||||
summaryFactory: SummaryFactory,
|
||||
) : ViewModel() {
|
||||
application: Application,
|
||||
) : AndroidViewModel(application) {
|
||||
val summary = summaryFactory.fetchSummary(viewModelScope)
|
||||
|
||||
private var detailJob: Job? = null
|
||||
private val _detail = mutableStateOf<ThrowsCardUio?>(null)
|
||||
val detail: State<ThrowsCardUio?> get() = _detail
|
||||
|
||||
private val _alterationDetail = mutableStateOf<AlterationDetailUio?>(null)
|
||||
val alterationDetail: State<AlterationDetailUio?> get() = _alterationDetail
|
||||
|
||||
fun showDetail(dice: ClassHeaderSummaryUio.Dice) {
|
||||
detailJob?.cancel()
|
||||
detailJob = viewModelScope.launch(Dispatchers.IO) {
|
||||
|
|
@ -49,4 +63,25 @@ class StatisticViewModel @Inject constructor(
|
|||
detailJob = null
|
||||
_detail.value = null
|
||||
}
|
||||
|
||||
fun showAlterationDetail(name: String, character: String,) {
|
||||
val alteration = alterationRepository.getAlterations(character = character)
|
||||
.firstOrNull { it.name == name }
|
||||
val description = descriptionRepository.find(name = alteration?.name)
|
||||
|
||||
if (alteration != null) {
|
||||
_alterationDetail.value = AlterationDetailUio(
|
||||
name = name,
|
||||
original = description?.original,
|
||||
source = alteration.source,
|
||||
target = alteration.target,
|
||||
description = description?.description
|
||||
?: context.getString(R.string.no_available_description)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun hideAlterationDetail() {
|
||||
_alterationDetail.value = null
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.pixelized.rplexicon.ui.screens.summary.pages.statistic
|
|||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import com.pixelized.rplexicon.R
|
||||
import com.pixelized.rplexicon.data.model.Alteration
|
||||
import com.pixelized.rplexicon.data.model.CharacterSheet
|
||||
import com.pixelized.rplexicon.data.model.Property
|
||||
import com.pixelized.rplexicon.data.network.CharacterSheetFire
|
||||
|
|
@ -17,6 +18,7 @@ import com.pixelized.rplexicon.ui.screens.summary.composable.PassivesSummaryUio
|
|||
import com.pixelized.rplexicon.ui.screens.summary.composable.ProficiencySummaryUio
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.SavingThrowsSummaryUio
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.SpellSummaryUio
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.StatusSummaryUio
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.common.SummaryRowUio
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.common.label
|
||||
import com.pixelized.rplexicon.ui.screens.summary.composable.common.maxLabel
|
||||
|
|
@ -51,6 +53,7 @@ class SummaryFactory @Inject constructor(
|
|||
val proficienciesVisibility = mutableStateOf(false)
|
||||
val passivesVisibility = mutableStateOf(false)
|
||||
val spellsVisibility = mutableStateOf(false)
|
||||
val statusVisibility = mutableStateOf(false)
|
||||
|
||||
val header = ClassHeaderSummaryUio(
|
||||
clazz1 = mutableStateOf(ClassHeaderSummaryUio.Header()),
|
||||
|
|
@ -126,6 +129,14 @@ class SummaryFactory @Inject constructor(
|
|||
slot9 = SummaryRowUio(label = R.string.character_sheet_title_spell_slot_9),
|
||||
max = maxSpellSlot
|
||||
)
|
||||
val statuses = StatusSummaryUio(
|
||||
c1 = mutableStateOf(emptyList()),
|
||||
c2 = mutableStateOf(emptyList()),
|
||||
c3 = mutableStateOf(emptyList()),
|
||||
c4 = mutableStateOf(emptyList()),
|
||||
c5 = mutableStateOf(emptyList()),
|
||||
max = mutableIntStateOf(0),
|
||||
)
|
||||
|
||||
scope.launch(Dispatchers.IO) {
|
||||
val data = DataStruct()
|
||||
|
|
@ -150,6 +161,9 @@ class SummaryFactory @Inject constructor(
|
|||
fun SummaryRowUio.get(sheet: CharacterSheet?) =
|
||||
get(index = characters.indexOf(sheet?.name))
|
||||
|
||||
fun StatusSummaryUio.get(sheet: CharacterSheet?) =
|
||||
get(index = characters.indexOf(sheet?.name))
|
||||
|
||||
fun ClassHeaderSummaryUio.getClass(sheet: CharacterSheet?) =
|
||||
classes.getOrNull(index = characters.indexOf(sheet?.name))
|
||||
|
||||
|
|
@ -597,6 +611,29 @@ class SummaryFactory @Inject constructor(
|
|||
if (spellsVisibility.value.not()) delay(ENTER_ANIMATION_DELAY)
|
||||
spellsVisibility.value = true
|
||||
}
|
||||
|
||||
// Update the Status
|
||||
sheets.values.forEach { sheet ->
|
||||
val status = alterationRepository
|
||||
.getActiveAlterations(character = sheet.name)
|
||||
.filterDndStatus(character = sheet.name)
|
||||
withContext(Dispatchers.Main) {
|
||||
statuses.get(sheet = sheet)?.value = status
|
||||
}
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
statuses.max.value = listOf(
|
||||
statuses.c1.value.count(),
|
||||
statuses.c2.value.count(),
|
||||
statuses.c3.value.count(),
|
||||
statuses.c4.value.count(),
|
||||
statuses.c5.value.count(),
|
||||
).max()
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
if (statusVisibility.value.not()) delay(ENTER_ANIMATION_DELAY)
|
||||
statusVisibility.value = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -641,9 +678,44 @@ class SummaryFactory @Inject constructor(
|
|||
passives = passives,
|
||||
spellsVisibility = spellsVisibility,
|
||||
spells = spells,
|
||||
statusVisibility = statusVisibility,
|
||||
status = statuses,
|
||||
)
|
||||
}
|
||||
|
||||
private fun List<Alteration>.filterDndStatus(
|
||||
character: String,
|
||||
): List<StatusSummaryUio.Status> {
|
||||
return this
|
||||
.mapNotNull { alteration ->
|
||||
val icon = when (alteration.name) {
|
||||
PRONE -> R.drawable.ic_status_prone_24dp
|
||||
GRAPPLED -> R.drawable.ic_status_grappled_24dp
|
||||
DEAFENED -> R.drawable.ic_status_deafened_24dp
|
||||
BLINDED -> R.drawable.ic_status_blinded_24dp
|
||||
CHARMED -> R.drawable.ic_status_charmed_24dp
|
||||
FRIGHTENED -> R.drawable.ic_status_frightened_24dp
|
||||
RESTRAINED -> R.drawable.ic_status_restrained_24dp
|
||||
STUNNED -> R.drawable.ic_status_stunned_24dp
|
||||
INCAPACITATED -> R.drawable.ic_status_incapacitated_24dp
|
||||
UNCONSCIOUS -> R.drawable.ic_status_unconscious_24dp
|
||||
INVISIBLE -> R.drawable.ic_status_invisible_24dp
|
||||
PETRIFIED -> R.drawable.ic_status_petrified_24dp
|
||||
POISONED -> R.drawable.ic_status_poisoned_24dp
|
||||
PARALYZED -> R.drawable.ic_status_paralyzed_24dp
|
||||
else -> null
|
||||
}
|
||||
icon?.let {
|
||||
StatusSummaryUio.Status(
|
||||
character = character,
|
||||
id = alteration.name,
|
||||
icon = icon
|
||||
)
|
||||
}
|
||||
}
|
||||
.sortedBy { it.id }
|
||||
}
|
||||
|
||||
private class DataStruct {
|
||||
lateinit var sheets: Map<String, CharacterSheet>
|
||||
lateinit var fires: Map<String, CharacterSheetFire>
|
||||
|
|
@ -663,5 +735,20 @@ class SummaryFactory @Inject constructor(
|
|||
companion object {
|
||||
private const val ENTER_ANIMATION_INITIAL_DELAY = 250L
|
||||
private const val ENTER_ANIMATION_DELAY = 100L
|
||||
|
||||
private const val PRONE = "À terre"
|
||||
private const val GRAPPLED = "Agrippé"
|
||||
private const val DEAFENED = "Assourdi"
|
||||
private const val BLINDED = "Aveuglé"
|
||||
private const val CHARMED = "Charmé"
|
||||
private const val FRIGHTENED = "Effrayé"
|
||||
private const val RESTRAINED = "Entravé"
|
||||
private const val STUNNED = "Étourdi"
|
||||
private const val INCAPACITATED = "Neutralisé"
|
||||
private const val UNCONSCIOUS = "Inconscient"
|
||||
private const val INVISIBLE = "Invisible"
|
||||
private const val PETRIFIED = "Pétrifié"
|
||||
private const val POISONED = "Empoisonné"
|
||||
private const val PARALYZED = "Paralysé"
|
||||
}
|
||||
}
|
||||
9
app/src/main/res/drawable/ic_status_blinded_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_status_blinded_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M405.82,78.9l24.44,24.44L100.49,433.1 76.04,408.66zM168.32,255.68a87.7,87.7 0,0 1,117.2 -82.57l43.4,-43.4A236.36,236.36 0,0 0,256 118.45a239.71,239.71 0,0 0,-84.45 15.62,270.75 270.75,0 0,0 -38.86,18.59 293.18,293.18 0,0 0,-34.82 23.82,311.88 311.88,0 0,0 -29.42,26.51 336.4,336.4 0,0 0,-22.68 25.35l-4.46,5.55 -3.93,5.27c-2.44,3.2 -4.52,6.22 -6.2,8.68 -1.68,2.45 -2.97,4.54 -3.85,5.86L26,255.76l1.33,2.06c0.88,1.33 2.17,3.46 3.85,5.85 1.68,2.4 3.76,5.47 6.2,8.68l3.93,5.27 4.46,5.55a336.4,336.4 0,0 0,22.68 25.35,311.89 311.89,0 0,0 29.42,26.51q7.14,5.67 14.82,11.02l60.74,-60.74a87.51,87.51 0,0 1,-5.11 -29.64zM484.69,253.59c-0.88,-1.34 -2.17,-3.52 -3.85,-5.89 -1.68,-2.37 -3.76,-5.51 -6.2,-8.74 -2.44,-3.46 -5.26,-6.99 -8.39,-10.87a339.52,339.52 0,0 0,-22.68 -25.46,311.77 311.77,0 0,0 -29.42,-26.56 306.19,306.19 0,0 0,-17.59 -12.95l-59.38,59.38a87.69,87.69 0,0 1,-114.35 114.35l-43.31,43.31A240.01,240.01 0,0 0,256 392.91a236.83,236.83 0,0 0,84.45 -15.26,269.05 269.05,0 0,0 38.86,-18.54 290.32,290.32 0,0 0,34.82 -23.82,311.77 311.77,0 0,0 29.42,-26.56 339.52,339.52 0,0 0,22.68 -25.46c3.15,-3.88 5.95,-7.46 8.39,-10.87 2.44,-3.23 4.52,-6.25 6.2,-8.74 1.68,-2.49 2.97,-4.61 3.85,-5.89L486,255.69z" />
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_status_charmed_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_status_charmed_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M146.47,21.59c-19.84,0.39 -40.26,13.99 -46.94,38.94 -36.28,-36.28 -90.65,-8.07 -79,41.6 11.83,50.4 99.55,64.54 114.25,90 0,-32.13 66.5,-82.52 54.19,-135.13 -5.73,-24.47 -23.86,-35.77 -42.5,-35.41zM237,154.47c-35.24,0.73 -68.83,22.93 -79.69,69.31C133.2,326.81 263.44,425.5 263.44,488.44c28.8,-49.88 200.59,-77.56 223.75,-176.28 22.82,-97.27 -83.62,-152.5 -154.69,-81.44 -13.49,-50.34 -55.56,-77.08 -95.5,-76.25z" />
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_status_deafened_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_status_deafened_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:pathData="M453.39,34.03l24.58,24.58L58.6,477.98 34.02,453.4zM212.92,243.6c-10.16,-11.76 -24.06,-17.25 -37.99,-15.31q-0.27,14.41 -0.64,28.45 -0.42,17.1 -0.75,32.95l42.33,-42.33a46.75,46.75 0,0 0,-2.93 -3.76zM189.74,415.31c7.24,3.77 19.59,-3.42 28.69,-10.11l10.13,13.77c-13.17,9.69 -24.51,14.51 -34.28,14.51a26.52,26.52 0,0 1,-12.44 -3c-9.62,-5.03 -15.88,-15.65 -19.77,-31.79l-48.33,48.3c25.86,71.52 159.46,42.82 159.46,-70.65 0,-65.58 98.82,-69.34 122.36,-155.06 6.3,-22.92 8.42,-43.91 6.96,-63.06L176.59,384.15c3.41,21.42 8.75,28.88 13.15,31.16zM157.18,256.34c0.61,-25.12 1.24,-51.09 1.3,-77.87 0.06,-26.21 5.43,-47.9 15.95,-64.48a74.58,74.58 0,0 1,39.64 -31.24c40.01,-13.78 91.39,3.3 110.61,27.79l-13.45,10.56c-15.04,-19.15 -59.24,-33.3 -91.6,-22.17 -20.99,7.21 -34.77,23.89 -40.71,48.8a101.16,101.16 0,0 1,21.52 -15.29c22.07,-11.39 44.06,-10.55 63.59,2.45l-9.47,14.24c-12.39,-8.24 -25.84,-9.69 -39.98,-4.28 -22.22,8.45 -37.41,29.56 -39.01,34.42q0,16.12 -0.32,31.8c18.79,-1.78 37.15,5.82 50.61,21.38 0.77,0.9 1.52,1.81 2.23,2.73L376.08,87.17c-14.01,-18.79 -32.95,-34.61 -55.58,-47.67 -54.47,-31.55 -211.04,-12.66 -211.04,108.86V353.79l46.77,-46.81c0.15,-15.44 0.51,-32.33 0.95,-50.64z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_status_frightened_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_status_frightened_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M156.76,79.5l-21.91,58.55 -58.44,21.87 58.51,21.9 21.84,58.36 21.85,-58.38 58.48,-21.89 -58.41,-21.86 -21.92,-58.56zM356.84,79.5l-21.91,58.55 -58.44,21.87 58.51,21.9 21.84,58.36 21.85,-58.37 58.48,-21.89 -58.41,-21.86 -21.92,-58.56zM18.31,146.64C29.35,228.69 56.92,300.99 94.77,354.77l28.45,-18.16 -9.78,41.91c11.36,13.22 22.84,24.94 35.57,34.92l29.34,-32.83 5.34,55.17c14.4,7.16 29.94,11.87 45.34,14.67l27.56,-42.6 27.56,42.6c15.33,-2.78 30.14,-8.25 44.46,-15.36l6.22,-57.27 31.12,33.53c11.97,-9.67 23.07,-20.94 33.79,-33.53l-8.89,-41.21 27.56,17.46c37.16,-53.26 64.38,-124.48 75.57,-205.34 -15.07,38.65 -40.1,72.62 -72.02,99.18l5.34,44 -40.01,-20.26c-9.04,5.29 -17.83,10.48 -27.57,14.67l-5.33,48.89 -40.01,-34.22c-10.92,2.44 -22.37,3.86 -33.79,4.89l-24.01,39.81 -23.12,-39.11c-12.51,-1.1 -24.55,-3.52 -36.45,-6.28l-38.23,32.82 -5.34,-46.79c-10.03,-4.31 -19.16,-9.19 -28.45,-14.67l-39.12,20.26 6.22,-43.31c-32.86,-27.11 -58.72,-62.13 -73.8,-101.97z" />
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_status_grappled_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_status_grappled_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M233.16,36.16c-6.48,-0.05 -13.4,1.18 -20.47,3.63 -16.96,5.85 -33.58,18.89 -43.47,36.16 77.39,68.92 107.53,126.83 108.06,219.25 43.46,-77.78 36.56,-167.55 -17.22,-248.22 -6.93,-7.21 -16.31,-10.74 -26.91,-10.81zM326.94,71.53c-6.48,-0.05 -13.39,1.18 -20.47,3.63 -2.49,0.86 -4.98,1.9 -7.44,3.06 14.8,31.96 23.13,65.04 24.75,97.94 32.99,45.06 46.94,91.82 47.31,154.38 43.43,-77.79 36.5,-167.58 -17.31,-248.25 -6.92,-7.15 -16.28,-10.67 -26.84,-10.75zM397.72,121.1c-0.51,-0 -1.02,0.02 -1.53,0.03 19.36,45.11 25.91,92.2 19.03,137.75 18.28,35.42 26.38,73.77 26.66,121.22 43.44,-77.79 36.5,-167.58 -17.31,-248.25 -6.92,-7.15 -16.28,-10.67 -26.84,-10.75zM86.9,235.06c-9.71,0.26 -19.15,2.59 -27.13,6.47 -14.35,6.99 -22.99,17.96 -22.81,30.59 8.88,44.74 21.04,77.71 40.72,100.69 16.15,18.86 37.66,31.64 68.41,39.16 -39.89,-58.35 -46.97,-90.64 -41.69,-175.03 -4.37,-1.08 -8.85,-1.69 -13.31,-1.84 -1.39,-0.05 -2.8,-0.07 -4.19,-0.03z" />
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:pathData="M256,19.31c-44.4,0 -85.1,25.43 -115.25,68.12C110.6,130.13 91.59,189.85 91.59,256c0,66.15 19,125.87 49.16,168.56 30.15,42.69 70.85,68.13 115.25,68.13 44.4,0 85.07,-25.43 115.22,-68.13 30.15,-42.69 49.19,-102.41 49.19,-168.56 0,-66.15 -19.04,-125.87 -49.19,-168.56 -30.15,-42.69 -70.81,-68.12 -115.21,-68.12L256,19.31zM204.23,213.88l14.99,9.97 -20.07,30.19 30.19,20.07 -9.97,14.99 -30.19,-20.07 -20.07,30.19 -14.99,-9.97 20.07,-30.19L144,238.99l9.97,-14.99 30.19,20.07 20.07,-30.19zM307.77,213.88l20.07,30.19L358.03,224 368,238.99l-30.19,20.07 20.07,30.19 -14.99,9.97 -20.07,-30.19 -30.19,20.07 -9.97,-14.99 30.19,-20.07 -20.07,-30.19 14.99,-9.97zM256,367c26,0 52.24,8.52 70.36,26.64l-12.73,12.73c-3.28,-3.28 -7.01,-6.2 -11.07,-8.75 -0.06,1.55 -0.14,3.13 -0.27,4.74 -0.46,5.69 -1.33,11.65 -3.57,17.26 -2.24,5.6 -6.66,11.88 -14.23,13.49 -8.5,1.81 -15.98,-2.58 -21.13,-7.59 -5.15,-5.01 -9.12,-11.24 -12.49,-17.42 -4.78,-8.75 -8.21,-17.49 -9.83,-21.9 -16.58,2.6 -31.98,9.48 -42.69,20.18l-12.73,-12.73C203.76,375.52 230,367 256,367zM259.95,385.08c1.67,4.09 3.97,9.31 6.74,14.37 2.88,5.29 6.3,10.28 9.25,13.15 2.8,2.72 4.11,2.98 4.73,2.9 0.06,-0.07 0.54,-0.52 1.36,-2.56 1.1,-2.75 1.97,-7.35 2.34,-12.03 0.33,-4.11 0.34,-8.19 0.26,-11.52 -7.83,-2.49 -16.19,-3.95 -24.67,-4.3z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_status_invisible_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_status_invisible_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M260.7,31.1c5.2,0.51 9.9,2.45 14.5,4.9l9.1,-16.3c-6.4,-3.81 -13.9,-6.07 -20.7,-7.3 -0.9,6.24 -1.9,12.47 -2.9,18.7zM251.6,12.7c-7.6,0.51 -14.1,2.52 -21.1,6l8.3,16.7c5.1,-1.88 9.6,-3.72 14.6,-4l-1.8,-18.7zM213.1,31.4c-5,5.17 -9.8,11.69 -12.7,17l16.3,9.1c3.1,-4.71 5.9,-9.09 9.6,-12.8 -4.3,-4.46 -9,-8.78 -13.2,-13.3zM301.2,33.3l-14,12.4c3.8,3.98 6.6,8.63 9.3,13.4l16.7,-8.5c-3.5,-6.29 -7.8,-12.54 -12,-17.3zM192.4,67.4c-2.1,6.71 -3.3,14.19 -3.8,20.2l18.6,1.8c0.6,-6.22 1.4,-10.74 3,-16.5zM320.6,69.6c-6,1.86 -12,3.42 -18.1,4.9 1.1,5.58 2.2,11.79 2.7,16.6l18.7,-1c-0.8,-7.04 -1.8,-14.28 -3.3,-20.5zM207.4,106.2l-18.5,1.9c0.4,7 2.6,14.3 4.3,20.1l17.8,-5.7c-1.7,-5.8 -2.9,-11 -3.6,-16.3zM304.6,107.9c-0.8,5.7 -2.4,11.2 -4,16.2l17.5,6.6c2.3,-6.7 4.1,-14 5,-20zM217.9,137.3s-11.5,5.4 -16.1,6.7c0,0 4.8,9.6 6.9,17.1 7.6,-2.2 15.5,-3.2 23.3,-4.5 -4.7,-6.9 -10.5,-13.4 -14.1,-19.3zM293.2,139c-4.2,6.3 -9.2,12 -13.9,17.9 7.8,2.1 16,2.7 23.6,5.5 0,0 4.4,-12.9 6.1,-17.7 -5.7,-1.9 -15.8,-5.7 -15.8,-5.7zM184.3,151.7c-6.6,4.4 -11.1,8.1 -16.1,13.4l13.5,12.9c4.6,-4.5 7.8,-7.5 12.6,-10.5zM327.9,154.5l-10.8,15.2c4.6,3.1 8.7,6.9 12.3,11.1l13.9,-12.5c-5.4,-5.6 -9.4,-9.8 -15.4,-13.8zM155.8,181.9c-3.5,5.7 -6.3,11.8 -8.7,18l17.4,6.9c2,-5.4 4.5,-10.7 7.5,-15.6zM355.3,185.1l-16.2,9.2c2.8,5.1 5.4,10.4 7.6,15.8L364,203c-2.4,-6.2 -5.5,-12.1 -8.7,-17.9zM141.1,218.9c-1.6,6.2 -3,12.7 -3.8,19.2l18.4,2.8c0.8,-5.9 2.2,-11.7 3.5,-17.5zM370.2,221.9l-18.1,4.8c1.8,5.7 2.6,11.5 3.8,17.4l18.4,-3.1c-1.1,-6.4 -2.3,-12.8 -4.1,-19.1zM135.1,257.4c-0.5,6.8 -0.6,12.6 -0.6,19.3h18.7c0.1,-6.3 0.2,-12.9 0.6,-18zM376.7,260.3l-18.7,1.5c0.5,5.8 0.8,12 0.8,18l18.7,-0.1c-0.1,-7 -0.4,-13.2 -0.8,-19.4zM153.7,294.9l-18.7,1c0.4,6.4 1,12.7 1.7,19.1l18.6,-2c-0.8,-6 -1.2,-12.1 -1.6,-18.1zM358.2,297.8c-0.2,6 -1,12 -1.7,18l18.5,2.4c1,-6.3 1.4,-12.7 1.9,-19.1zM139,329.6c0.5,6.3 2,12.9 2.9,18.3h20.3v-18.7c-7.7,-0.2 -15.4,0.1 -23.2,0.4zM180.9,329.2c-0.1,6.4 0,12.3 0,18.7l19.2,-0.5c-0.5,-6.1 -0.9,-12.1 -1.2,-18.2zM310.9,329.2c-0.5,6.3 -1,12.7 -1.5,19l18.7,1.4 -0.2,-20.4zM346.6,329.2v18.7h23.2c1.3,-6.4 2.3,-11.6 3.4,-18 -8.8,-0.9 -17.7,-0.7 -26.6,-0.7zM201.3,366.1l-18.6,1.2 1.2,18.7 18.6,-1.3zM308,366.8l-1.3,18.6 18.6,1.4 1.4,-18.6zM247.8,378.7v18.7h18.6v-18.7zM203.8,403.4l-18.7,1.2 1.3,18.7L205,422zM305.3,404.1l-1.4,18.6 18.6,1.4 1.4,-18.6zM247.8,416.1v18.7h18.6v-18.7zM206.2,440.7l-18.6,1.2 1.2,18.7 18.7,-1.3zM302.5,441.3l-1.4,18.7 18.6,1.4 1.4,-18.7zM247.8,453.5v18.7h18.6v-18.7zM208.7,478l-18.7,1.2c0.5,6.8 0.9,13.6 1.4,20.4h15.7zM299.7,478.6l0.8,21h16.4c0.4,-6.5 1,-13.1 1.5,-19.6zM225.8,480.9v18.7h18.6v-18.7zM263.1,480.9v18.7h18.7v-18.7z" />
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_status_paralyzed_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_status_paralyzed_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M376,211H256V16L136,301h120v195z" />
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_status_petrified_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_status_petrified_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M221.75,17.81c-2.87,0.01 -5.72,0.09 -8.59,0.25C94,24.6 10.79,136.43 17.44,251.15 26,398.81 164.3,501.69 306.32,492.56h0.03c68.97,-4.45 134.88,-33.45 186.06,-79.56l4.34,-3.91 -1.63,-5.63 -29.84,-102.6 -1.22,-4.19 -3.97,-1.75L378,258.59c14.59,-24.46 22.4,-53.31 21,-82.56 -4.3,-89.98 -83.12,-154.5 -168.66,-158.06 -2.85,-0.12 -5.73,-0.17 -8.59,-0.16zM221.88,36.5c1.17,-0.01 2.36,0.01 3.53,0.03L218.5,81.28l-0.28,1.75 0.16,0.63c-26.73,2.11 -53.55,11.5 -75.88,28.44l-14.38,-47.28c25.05,-16.17 54.17,-26.35 86.06,-28.09 2.57,-0.14 5.13,-0.2 7.69,-0.22zM244.13,37.91c38.27,5.08 74,23.62 99.28,51.38l-34,19.94 -0.37,0.22c-19.42,-15.9 -44.87,-24.69 -71.59,-26.06l-0.22,-0.94 6.91,-44.53zM112.13,76.41l14.34,47.25 0.62,2.09c-14.64,15.2 -26.22,34.55 -32.84,58.13 -0.68,2.4 -1.28,4.79 -1.88,7.16l-40.47,-33.22c13.17,-31.82 33.87,-60.15 60.22,-81.41zM355.25,104.03c14.61,20.83 23.79,45.56 25.09,72.88 0.03,0.52 0.04,1.04 0.06,1.56l-35.84,2.87c-0.12,-2.07 -0.26,-4.16 -0.5,-6.25 -2.33,-20.82 -10.02,-38.2 -21.34,-52.03l32.53,-19.03zM239.13,148.97c2.35,0.04 4.66,0.25 6.97,0.59l-1.47,39.28c-4.21,0.59 -8.34,1.87 -12.22,3.91l-43.72,-17.81c11.27,-15.01 28.15,-25.32 47.94,-25.94 0.83,-0.03 1.67,-0.05 2.5,-0.03zM264.6,155.81c14.38,7.94 24.83,22.16 25.22,39.34 0.14,6.44 -1.44,13.01 -4.22,18.75 -1.47,-4.27 -3.73,-8.34 -6.81,-12 -4.44,-5.27 -10.04,-9.04 -16.09,-11.22l0.59,0.03 1.31,-34.91zM45.15,176.44l43.03,35.38c-3.9,25.77 -2.57,49.15 2.97,69.97L39,275.22c-1.42,-8.22 -2.41,-16.6 -2.91,-25.16 -1.46,-25.12 1.79,-50.09 9.06,-73.63zM179.44,191.31l38.03,15.56c-4.74,7.95 -6.34,17.34 -4.66,26.31l-28.84,25.13c-6.02,-10.77 -9.68,-22.97 -10.16,-36.19 -0.38,-10.63 1.66,-21.18 5.63,-30.81zM379.66,197.25c-3.35,28.99 -16.63,56.28 -36.75,76.22L321,251.56c13.37,-13.27 21.05,-31.42 23.19,-51.44l35.47,-2.88zM220.66,251.13c7.5,11.25 19.98,18.87 33.12,21.53l2.78,32.38c-23.83,-2.66 -46.19,-14.12 -61.66,-31.44l25.75,-22.47zM305.94,262.94l22.63,22.63c-15.32,10.92 -33.36,18.03 -53.25,19.66l-2.72,-32c12.85,-1.32 23.95,-4.93 33.34,-10.28zM43.22,294.59l54.72,6.88c9.88,23.13 25.38,42.46 44.59,57.75l-53.94,22.41c-20.91,-25.13 -36.71,-54.49 -45.38,-87.03zM448.06,310.03l0.47,0.22 26.91,92.56c-30.29,26.24 -65.75,46.28 -103.69,58.41l8.59,-87.03 0.16,-1.56c26.19,-14.8 49.55,-35.55 67.56,-62.59zM160.78,371.91c26.24,15.82 57.28,25.37 89.59,28.16l-44,61c-39.63,-13.12 -75.81,-35.4 -104.53,-64.72l58.94,-24.44zM360.75,382.44l-8.34,84.22c-15.49,3.77 -31.31,6.22 -47.28,7.25 -27.04,1.74 -53.94,-0.87 -79.69,-7.31l45.66,-63.34 1.72,-2.38c29.81,-0.32 60.02,-6.33 87.94,-18.44z" />
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_status_poisoned_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_status_poisoned_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M263.84,40.34C234.1,213.2 145.59,248.03 145.59,369.22c0,60.8 60.11,105.5 118.25,105.5 59.45,0 115.94,-41.8 115.94,-99.53 0,-116.33 -85.2,-162.31 -115.94,-334.84zM205.56,257.44c-27.96,75.53 -5.11,154.57 54.25,179.38 15.19,6.35 31.72,7.71 47.9,6.28 -116.13,49.79 -185.84,-79.82 -102.16,-185.66z" />
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_status_prone_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_status_prone_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:pathData="M221.31,16a23.68,23.69 0,0 0,-23.69 23.69v106.41a23.68,23.69 0,0 0,2.16 9.72,23.68 23.69,0 0,0 3.16,13.81l41.75,71.63 -79,55.44 6.09,-48.63a23.68,23.69 0,0 0,-8.19 -20.97l-66.28,-81.94a23.68,23.69 0,0 0,-33.31 -3.5l-9.19,7.44a23.68,23.69 0,0 0,-3.53 33.34l59.78,73.91 -11.25,89.94a23.68,23.69 0,0 0,12.47 23.88l37.47,53.47a23.69,23.68 1.57,0 0,2.34 2.81,23.68 23.69,0 0,0 13.59,20.06L262,491.53a23.68,23.69 0,0 0,9.97 2.22,23.68 23.69,0 0,0 23.53,-2.06l87.16,-60.94a23.68,23.69 0,0 0,5.84 -33l-6.78,-9.69a23.68,23.69 0,0 0,-32.97 -5.88l-72.41,50.66 -59.06,-27.63 120.6,-84.63a23.69,23.68 1.57,0 0,5.53 -5.5,23.68 23.69,0 0,0 14.63,-13.59l37.22,-91.53 87.81,-44.85a23.69,23.68 1.18,0 0,10.31 -31.88L488,122.69a23.69,23.68 1.18,0 0,-31.88 -10.34l-94.69,48.38a23.69,23.68 1.18,0 0,-9.84 9.44,23.68 23.69,0 0,0 -8.34,10.47l-27.38,67.31 -5.22,-7.44a23.68,23.69 0,0 0,-3 -8.84l-50.81,-87.09V39.69A23.68,23.69 0,0 0,233.15 16h-11.84zM77.75,376A59.99,60 0,0 0,16 436a59.99,60 0,1 0,120 0,59.99 60,0 0,0 -58.25,-60z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_status_restrained_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_status_restrained_24dp.xml
Normal file
File diff suppressed because one or more lines are too long
9
app/src/main/res/drawable/ic_status_stunned_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_status_stunned_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:pathData="M358.5,283.23c-22.89,3.1 -52,5.23 -88.72,6.48 -23.3,0.79 -49.43,1.19 -77.68,1.19 -35.57,0 -67.27,-0.63 -86.89,-1.09a208.69,208.69 0,0 0,8.9 58.51c22.42,74.88 81.29,125.55 139.88,125.55a99,99 0,0 0,28.48 -4.16c65,-19.46 98.09,-101.96 76.03,-186.48zM196.12,370.51l-13.58,-8.25 -6,10.53 -15.74,-9 6.27,-10.93 -14,-8.5 9.42,-15.5 13.58,8.25 6,-10.53 15.74,9 -6.27,10.93 14,8.5zM294.42,344.69l-13.58,-8.25 -6,10.53 -15.74,-9 6.24,-10.97 -14,-8.49 9.45,-15.51 13.58,8.25 6,-10.53 15.74,9 -6.27,10.93 14,8.5zM416.21,117.42l22,18.33 24.32,-15.08 -10.64,26.57 21.86,18.47 -28.55,-1.91 -10.84,26.5 -7,-27.75 -28.54,-2.1 24.17,-15.23zM415.99,38.58l2.08,17.88 17.62,3.67 -16.36,7.5 2,17.89 -12.21,-13.24 -16.41,7.39L401.53,64l-12.1,-13.33 17.65,3.55zM62.92,38.13L81.35,60l26.59,-10.58 -15.13,24.32 18.28,22 -27.78,-6.87 -15.32,24.19 -2,-28.54 -27.74,-7.07 26.52,-10.76zM415.99,243.44c-4.56,12.66 -25.56,26.15 -146.72,30.27 -25.88,0.88 -52.47,1.18 -77.14,1.18 -41.91,0 -121.2,-1.21 -121.2,-1.21v-16s79.47,1.21 121.21,1.21c24.14,0 50.12,-0.29 75.43,-1.14 38.77,-1.29 69.93,-3.69 92.62,-7.11 34.07,-5.15 39.81,-11.23 40.63,-12.44 -0.24,-0.57 -1.22,-2.35 -4.86,-5.23 -10.14,-8 -28.53,-16 -53.3,-23.44a202.41,202.41 0,0 0,-16.56 -21.22c2,0.51 4,1 5.88,1.53 35.17,9.36 60,19.64 73.88,30.56 6.51,5.18 13.58,13.36 10.13,23.04zM111.18,241.93c1.5,-7.33 8.84,-26.5 12.41,-31.92 56.35,3.86 150.85,-15.72 176.38,-25.16 15.21,13.25 32.71,35.84 40.61,52.19 -57.31,6.52 -159.43,6.65 -229.43,4.9zM130.58,169.84c-10.08,-0.6 -33.73,-2.07 -42.65,2 11.87,11.21 75,12.46 128.23,4.92 57.06,-8.08 110,-21.46 141.07,-42.63 12.94,-8.82 19.78,-21.71 18.54,-27.43 -6.3,-29.16 -174.12,-39.46 -174.12,-39.46s178.29,3.69 179.61,39.45c1.42,38.36 -82.14,67.8 -162.44,80.33 -76.27,11.9 -149.39,12.73 -145.6,-18.73 2.2,-18.28 51.33,-14.87 72.59,-12.45 -4.22,2.91 -11.95,10.56 -15.26,14.01zM206.46,150.71a106.28,106.28 0,0 1,42.58 4.6c-12.73,3.12 -58.29,9.31 -85.16,10 21.21,-12.93 38.79,-14.14 42.55,-14.59z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_status_unconscious_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_status_unconscious_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M264.44,17.09c-65.79,0 -122.04,41.78 -145.63,93.41 -20.03,34.08 -31.84,74.99 -31.84,118 0,73.85 20.42,140.63 52.81,188.41 32.4,47.78 76.15,76.28 123.85,76.28 47.69,0 91.45,-28.5 123.84,-76.28 32.39,-47.78 52.81,-114.56 52.81,-188.41 0,-41.82 -10.43,-80.8 -28.31,-113.53 -22.31,-53.66 -79.85,-97.88 -147.53,-97.88zM264.44,35.78c72.46,0 132.26,60.31 138.25,117.56L267.06,153.35l-6.22,-22.63 -9,-32.78 -9,32.78 -10.5,38.22 -16.84,-61.28 -9.03,-32.78 -9,32.78L185,152.97h-58.81c6.22,-57.15 65.95,-117.19 138.25,-117.19zM206.47,145.44l16.84,61.25 9.03,32.78 9,-32.78 10.5,-38.25 1,3.59h149.81c-5.97,55.65 -64.63,101.03 -138.22,101.03 -73.75,0 -132.57,-45.58 -138.31,-101.41h73.12l1.91,-6.88 5.31,-19.34zM134.69,284.84c18.35,18.1 37.53,26.73 55.72,27.53 18.19,0.8 35.93,-6.09 52.13,-21.5l12.88,13.56c-19.21,18.27 -42.28,27.66 -65.84,26.63 -23.56,-1.03 -47.1,-12.33 -68,-32.94l13.13,-13.28zM399.44,284.84l13.13,13.28c-20.9,20.6 -44.44,31.91 -68,32.94 -23.56,1.03 -46.63,-8.35 -65.84,-26.63l12.87,-13.56c16.2,15.4 33.97,22.3 52.16,21.5 18.19,-0.8 37.33,-9.44 55.69,-27.53zM266.53,419.59c26.46,-0.07 52.92,3.19 79.35,10.03l-4.69,18.09c-49.81,-12.9 -99.4,-12.4 -149.38,0.03l-4.53,-18.13c26.34,-6.55 52.79,-9.96 79.25,-10.03z" />
|
||||
</vector>
|
||||
|
|
@ -105,6 +105,7 @@
|
|||
<string name="character_sheet_title_attribute">Attributs</string>
|
||||
<string name="character_sheet_title_passive">Talents passifs</string>
|
||||
<string name="character_sheet_title_spells">Sortilèges</string>
|
||||
<string name="character_sheet_title_status">Statut</string>
|
||||
<string name="character_sheet_title_saving_throws">Jet de sauvegarde</string>
|
||||
<string name="character_sheet_title_proficiencies">Talents</string>
|
||||
<string name="character_sheet_martial_masteries">Maîtrises martiales :</string>
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@
|
|||
<string name="character_sheet_title_attribute">Attributes</string>
|
||||
<string name="character_sheet_title_passive">Passives proficiencies</string>
|
||||
<string name="character_sheet_title_spells">Spells</string>
|
||||
<string name="character_sheet_title_status">Status</string>
|
||||
<string name="character_sheet_martial_masteries">Martial masteries:</string>
|
||||
<string name="character_sheet_languages_masteries">Languages masteries:</string>
|
||||
<string name="character_sheet_others_masteries">Others masteries:</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue