CraftSystem: remove alt recipes
This commit is contained in:
@@ -121,20 +121,14 @@ local function getCraftTabTemplate(self, playerName, tabType, tabName, handler)
|
||||
local item = ItemStack(craft.output)
|
||||
local itemDef = item:get_definition()
|
||||
|
||||
local recipeIndex = craftTabData.selected_recipe_index or 0
|
||||
if recipeIndex > #craft.altRecipes then
|
||||
recipeIndex = #craft.altRecipes
|
||||
craftTabData.selected_recipe_index = #craft.altRecipes
|
||||
end
|
||||
|
||||
local player = core.get_player_by_name(playerName)
|
||||
assert(player ~= nil)
|
||||
local mainList = player:get_inventory():get_list('main')
|
||||
|
||||
CraftTab
|
||||
:itemImage(5.5, 0.5, 2, 2, craft.output)
|
||||
:label(10, 0.5, ('%s/%s'):format(recipeIndex+1, #craft.altRecipes+1))
|
||||
:textArea(5.5, 3, 5, 4, nil, nil, craft:toString(recipeIndex, mainList))
|
||||
:label(10, 0.5, ('%s/%s'):format(0+1, 'TODO')) -- TODO
|
||||
:textArea(5.5, 3, 5, 4, nil, nil, craft:toString(mainList))
|
||||
:button(5.5, 7.5, 0.5, 1, tabType..'::'..tabName..'::alt_recipe_back', '<')
|
||||
:button(6, 7.5, 2, 1, tabType..'::'..tabName..'::craft_item', '1')
|
||||
:button(8, 7.5,2, 1, tabType..'::'..tabName..'::craft_item', ''..tostring(itemDef.stack_max))
|
||||
|
||||
Reference in New Issue
Block a user