Change crafting table name to show step count
This commit is contained in:
@@ -42,7 +42,10 @@ module.exports = class CraftingTableController extends BaseController
|
||||
@$outputLink = @$('.output a')
|
||||
@$outputQuantity = @$('.quantity')
|
||||
@$prev = @$('.prev')
|
||||
@$title = @$('h2 p')
|
||||
@$tool = @$('.tool p')
|
||||
|
||||
@defaultTitle = @$title.html()
|
||||
super
|
||||
|
||||
refresh: ->
|
||||
@@ -52,6 +55,9 @@ module.exports = class CraftingTableController extends BaseController
|
||||
if @model.hasSteps
|
||||
if @model.hasPrevStep then @$prev.addClass 'enabled'
|
||||
if @model.hasNextStep then @$next.addClass 'enabled'
|
||||
@$title.html "Step #{@model.step + 1} of #{@model.stepCount}"
|
||||
else
|
||||
@$title.html @defaultTitle
|
||||
|
||||
@$tool.html @model.toolNames
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ module.exports = class CraftingTable extends BaseModel
|
||||
multiplier: { get:@getMultiplier }
|
||||
output: { get:@getOutput }
|
||||
step: { get:@getStep, set:@setStep }
|
||||
stepCount: { get:@getStepCount }
|
||||
toolNames: { get:@getToolNames }
|
||||
}
|
||||
|
||||
@@ -73,6 +74,10 @@ module.exports = class CraftingTable extends BaseModel
|
||||
|
||||
return this
|
||||
|
||||
getStepCount: ->
|
||||
return 0 unless @_steps?
|
||||
return @_steps.length
|
||||
|
||||
getToolNames: ->
|
||||
recipe = @_steps[@_step]?.recipe
|
||||
return '' unless recipe?
|
||||
|
||||
Reference in New Issue
Block a user