Add AddItem dialog to the inventory screen.

This commit is contained in:
Thomas Andres Gomez 2025-04-18 16:00:35 +02:00
parent c94c820efb
commit 48074f3d13
17 changed files with 704 additions and 84 deletions

View file

@ -26,8 +26,8 @@ class CharacterSheetJsonFactory(
val json = CharacterSheetJsonV1(
id = sheet.id,
name = sheet.name,
portrait = sheet.portrait,
thumbnail = sheet.thumbnail,
portrait = sheet.portrait?.takeIf { it.isNotBlank() },
thumbnail = sheet.thumbnail?.takeIf { it.isNotBlank() },
level = sheet.level,
shouldLevelUp = sheet.shouldLevelUp,
strength = sheet.strength,

View file

@ -14,7 +14,7 @@ data class Inventory(
data class Item(
val inventoryId: String,
val itemId: String,
val count: Int,
val count: Float,
val equipped: Boolean,
)

View file

@ -20,7 +20,7 @@ data class InventoryJsonV1(
data class ItemJson(
val inventoryId: String,
val itemId: String,
val count: Int,
val count: Float,
val equipped: Boolean?,
)
}

View file

@ -30,8 +30,8 @@ class ItemJsonFactoryV1 {
metadata = ItemJsonV1.ItemMetadataJsonV1(
name = item.metadata.label,
description = item.metadata.description,
image = item.metadata.image,
thumbnail = item.metadata.thumbnail,
image = item.metadata.image?.takeIf { it.isNotBlank() },
thumbnail = item.metadata.thumbnail?.takeIf { it.isNotBlank() },
),
options = ItemJsonV1.ItemOptionJsonV1(
stackable = item.options.stackable,