Fixed a few bugs.
This commit is contained in:
parent
2ef7bff2c5
commit
cd3bf4d0db
4 changed files with 7 additions and 7 deletions
app
|
@ -24,8 +24,8 @@ module.exports = class CoordinateGrid extends CocoClass
|
||||||
toString: -> '<CoordinateGrid>'
|
toString: -> '<CoordinateGrid>'
|
||||||
|
|
||||||
build: (worldSize) ->
|
build: (worldSize) ->
|
||||||
worldWidth = worldSize[0] ? 80
|
worldWidth = worldSize[0] or 80
|
||||||
worldHeight = worldSize[1] ? 68
|
worldHeight = worldSize[1] or 68
|
||||||
@gridContainer = new createjs.Container()
|
@gridContainer = new createjs.Container()
|
||||||
@gridShape = new createjs.Shape()
|
@gridShape = new createjs.Shape()
|
||||||
@gridContainer.addChild @gridShape
|
@gridContainer.addChild @gridShape
|
||||||
|
|
|
@ -224,7 +224,7 @@ module.exports = class SpriteBoss extends CocoClass
|
||||||
for slot, itemID of thang.inventoryIDs
|
for slot, itemID of thang.inventoryIDs
|
||||||
item = @world.getThangByID itemID
|
item = @world.getThangByID itemID
|
||||||
unless item.equipped
|
unless item.equipped
|
||||||
#console.log thang.id, 'equipping', item, 'in', thang.slot, 'Surface-side'
|
console.log thang.id, 'equipping', item, 'in', thang.slot, 'Surface-side, but it cannot equip?' unless item.equip
|
||||||
item.equip()
|
item.equip()
|
||||||
itemsJustEquipped.push item
|
itemsJustEquipped.push item
|
||||||
return itemsJustEquipped
|
return itemsJustEquipped
|
||||||
|
|
|
@ -496,8 +496,8 @@ module.exports = Surface = class Surface extends CocoClass
|
||||||
event =
|
event =
|
||||||
deltaX: e.deltaX
|
deltaX: e.deltaX
|
||||||
deltaY: e.deltaY
|
deltaY: e.deltaY
|
||||||
screenPos: @mouseScreenPos
|
|
||||||
canvas: @canvas
|
canvas: @canvas
|
||||||
|
event.screenPos = @mouseScreenPos if @mouseScreenPos
|
||||||
Backbone.Mediator.publish 'surface:mouse-scrolled', event unless @disabled
|
Backbone.Mediator.publish 'surface:mouse-scrolled', event unless @disabled
|
||||||
|
|
||||||
hookUpChooseControls: ->
|
hookUpChooseControls: ->
|
||||||
|
|
|
@ -143,11 +143,11 @@ module.exports = # /app/lib/surface
|
||||||
|
|
||||||
'surface:stage-mouse-up': c.object {required: ['onBackground', 'originalEvent']},
|
'surface:stage-mouse-up': c.object {required: ['onBackground', 'originalEvent']},
|
||||||
onBackground: {type: 'boolean'}
|
onBackground: {type: 'boolean'}
|
||||||
x: {type: 'number'}
|
x: {type: ['number', 'undefined']}
|
||||||
y: {type: 'number'}
|
y: {type: ['number', 'undefined']}
|
||||||
originalEvent: {type: 'object'}
|
originalEvent: {type: 'object'}
|
||||||
|
|
||||||
'surface:mouse-scrolled': c.object {required: ['deltaX', 'deltaY', 'screenPos', 'canvas']},
|
'surface:mouse-scrolled': c.object {required: ['deltaX', 'deltaY', 'canvas']},
|
||||||
deltaX: {type: 'number'}
|
deltaX: {type: 'number'}
|
||||||
deltaY: {type: 'number'}
|
deltaY: {type: 'number'}
|
||||||
screenPos: c.object {required: ['x', 'y']},
|
screenPos: c.object {required: ['x', 'y']},
|
||||||
|
|
Reference in a new issue