mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 02:54:04 +09:00
fix: reopening crafting would reset the visible mult to 1 but internally wouldn't
This commit is contained in:
@@ -391,8 +391,7 @@ class UICrafting(val full: UIInventoryFull) : UICanvas(), HasInventory {
|
||||
}
|
||||
|
||||
private fun resetSpinner(value: Long = 1L) {
|
||||
spinnerCraftCount.value = value
|
||||
spinnerCraftCount.fboUpdateLatch = true
|
||||
spinnerCraftCount.resetToSmallest()
|
||||
itemListIngredients.numberMultiplier = value
|
||||
itemListCraftable.numberMultiplier = value
|
||||
}
|
||||
@@ -541,7 +540,7 @@ class UICrafting(val full: UIInventoryFull) : UICanvas(), HasInventory {
|
||||
* For each ingredient of the recipe, returns list of (ingredient, how many the player has the ingredient, how many the recipe wants)
|
||||
*/
|
||||
fun recipeToIngredientRecord(inventory: FixtureInventory, recipe: CraftingCodex.CraftingRecipe, nearbyCraftingStations: List<String>): List<RecipeIngredientRecord> {
|
||||
val hasStation = if (recipe.workbench.isEmpty()) true else nearbyCraftingStations.contains(recipe.workbench)
|
||||
val hasStation = if (recipe.workbench.isBlank()) true else nearbyCraftingStations.contains(recipe.workbench)
|
||||
return recipe.ingredients.map { ingredient ->
|
||||
val selectedItem = if (ingredient.keyMode == CraftingCodex.CraftingItemKeyMode.TAG) {
|
||||
// If the player has the required item, use it; otherwise, will take an item from the ItemCodex
|
||||
|
||||
Reference in New Issue
Block a user