Complete the Crafting Table view/controller

* Add output box to the crafting table view
* Add remaining crafting patterns to all MC 1.7.10 recipes
* Add all crafting patterns to Buildcraft 6.2.6
* Disable mods which don't have patterns yet
* Add the Url constants for computing urls from templates
* Add the `findItemDisplay` to ModPack (along with tests) and remove
  all replace all uses of `getPathSlugs` with it
This commit is contained in:
Andrew Miner
2015-01-09 10:08:02 -08:00
parent b8d60ac245
commit b8a0918541
19 changed files with 278 additions and 97 deletions
@@ -6,7 +6,6 @@ All rights reserved.
###
BaseController = require './base_controller'
{ImageUrl} = require '../constants'
ImageLoader = require './image_loader'
########################################################################################################################
@@ -32,24 +31,9 @@ module.exports = class StackController extends BaseController
super
refresh: ->
{itemName, itemSlug, modSlug} = @_gatherData()
imageUrl = ImageUrl itemSlug:itemSlug, modSlug:modSlug
display = @modPack.findItemDisplay @model.itemSlug
@$nameField.html itemName
@$nameField.html display.itemName
@$quantityField.html @model.quantity
@_imageLoader.load imageUrl, @$image
@_imageLoader.load display.iconUrl, @$image
super
# Private Methods ##############################################################################
_gatherData: ->
itemSlug = @model.itemSlug
item = @modPack.findItem @model.itemSlug
if item?
itemName = item.name
modSlug = item.modVersion.slug
else
itemName = @modPack.findName @model.itemSlug
modSlug = 'minecraft'
return itemName:itemName, itemSlug:itemSlug, modSlug:modSlug