Allow up to 9999 of a single item stack
This commit is contained in:
@@ -16,6 +16,8 @@ StackController = require './stack_controller'
|
|||||||
|
|
||||||
module.exports = class InventoryController extends BaseController
|
module.exports = class InventoryController extends BaseController
|
||||||
|
|
||||||
|
@MAX_QUANTITY = 9999
|
||||||
|
|
||||||
@ONLY_DIGITS = /^[0-9]*$/
|
@ONLY_DIGITS = /^[0-9]*$/
|
||||||
|
|
||||||
constructor: (options={})->
|
constructor: (options={})->
|
||||||
@@ -85,7 +87,7 @@ module.exports = class InventoryController extends BaseController
|
|||||||
onQuantityFieldBlur: ->
|
onQuantityFieldBlur: ->
|
||||||
value = @$quantityField.val().replace /[^0-9]/g, ''
|
value = @$quantityField.val().replace /[^0-9]/g, ''
|
||||||
if value.length is 0 then value = '1'
|
if value.length is 0 then value = '1'
|
||||||
value = Math.min value, 64
|
value = Math.min value, InventoryController.MAX_QUANTITY
|
||||||
@$quantityField.val value
|
@$quantityField.val value
|
||||||
@onQuantityFieldChanged()
|
@onQuantityFieldChanged()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user