Add Object action in the character action sheet.

This commit is contained in:
Thomas Andres Gomez 2023-10-24 18:08:25 +02:00
parent f9b3adfee0
commit cd921ac16f
21 changed files with 416 additions and 10 deletions

View file

@ -12,6 +12,7 @@ import com.pixelized.rplexicon.repository.data.character.CharacterSheetRepositor
import com.pixelized.rplexicon.repository.data.character.DescriptionRepository
import com.pixelized.rplexicon.repository.data.character.EquipmentRepository
import com.pixelized.rplexicon.repository.data.character.InventoryRepository
import com.pixelized.rplexicon.repository.data.character.ObjectActionRepository
import com.pixelized.rplexicon.repository.data.character.SkillRepository
import com.pixelized.rplexicon.repository.data.character.SpellRepository
import com.pixelized.rplexicon.repository.data.lexicon.LexiconRepository
@ -35,6 +36,7 @@ class LauncherViewModel @Inject constructor(
alterationRepository: AlterationRepository,
characterSheetRepository: CharacterSheetRepository,
actionRepository: ActionRepository,
objectActionRepository: ObjectActionRepository,
spellRepository: SpellRepository,
skillRepository: SkillRepository,
descriptionRepository: DescriptionRepository,
@ -124,6 +126,14 @@ class LauncherViewModel @Inject constructor(
_error.emit(FetchErrorUio.Structure(type = Type.ACTION))
}
}
val objects = async {
try {
objectActionRepository.fetchObjectAction()
} catch (exception: Exception) {
Log.e(TAG, exception.message, exception)
_error.emit(FetchErrorUio.Structure(type = Type.OBJECT))
}
}
val spell = async {
try {
spellRepository.fetchSpells()
@ -142,7 +152,7 @@ class LauncherViewModel @Inject constructor(
}
awaitAll(lexicon, location, quest)
awaitAll(description, inventory, equipment, alteration, action, spell, skill)
awaitAll(description, inventory, equipment, alteration, action, objects, spell, skill)
isLoading = false
}