Show list to make in order to be made

This commit is contained in:
Andrew Miner
2015-01-04 15:18:00 -08:00
parent 761a244a83
commit 5c5ea861cc
3 changed files with 12 additions and 1 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -110,7 +110,15 @@ module.exports = class CraftingTableController extends BaseController
if @model.plan? if @model.plan?
@_resetStackControllers() @_resetStackControllers()
@model.plan.need.each (stack)=> makeController 'need', stack @model.plan.need.each (stack)=> makeController 'need', stack
@model.plan.make.each (stack)=> makeController 'make', stack
slugs = {}
for recipe in @model.plan.steps
slug = recipe.item.slug
if not slugs[slug]?
slugs[slug] = true
stack = @model.plan.make.getStack slug
makeController 'make', stack
@model.plan.result.each (stack)=> makeController 'result', stack @model.plan.result.each (stack)=> makeController 'result', stack
super super
+3
View File
@@ -55,6 +55,9 @@ module.exports = class Inventory extends BaseModel
stack = @_stacks[itemSlug] stack = @_stacks[itemSlug]
onStack stack onStack stack
getStack: (itemSlug)->
return @_stacks[itemSlug]
hasAtLeast: (itemSlug, quantity=1)-> hasAtLeast: (itemSlug, quantity=1)->
if quantity is 0 then return true if quantity is 0 then return true