Admins can play all heroes. Fixed another bug with playback controls being disabled when they shouldn't be.

This commit is contained in:
Nick Winter 2014-11-15 12:46:57 -08:00
parent ff30935a58
commit 0f70b7e552
4 changed files with 11 additions and 12 deletions

View file

@ -12,14 +12,13 @@ module.exports = class ThangType extends CocoModel
@heroes:
captain: '529ec584c423d4e83b000014'
knight: '529ffbf1cf1818f2be000001'
librarian: '52fbf74b7e01835453bd8d8e'
equestrian: '52e95b4222efc8e70900175d'
'potion-master': '52e9adf7427172ae56002172'
thoktar: '52a00542cf1818f2be000006'
'robot-walker': '5301696ad82649ec2c0c9b0d'
'michael-heasell': '53e126a4e06b897606d38bef'
'ian-elliott': '53e12be0d042f23505c3023b'
'samurai': '53e12be0d042f23505c3023b'
'ninja': '52fc0ed77e01835453bd8f6c'
'forest-archer': '5466d4f2417c8b48a9811e87'
trapper: '5466d449417c8b48a9811e83'
librarian: '52fbf74b7e01835453bd8d8e'
'potion-master': '52e9adf7427172ae56002172'
sorcerer: '52fd1524c7e6cf99160e7bc9'
@items:
'simple-boots': '53e237bf53457600003e3f05'
urlRoot: '/db/thang.type'

View file

@ -87,7 +87,7 @@ module.exports = class User extends CocoModel
heroes: ->
heroes = (me.get('earned')?.heroes ? []).concat(me.get('purchased')?.heroes ? []).concat([ThangType.heroes.captain, ThangType.heroes.knight])
heroes = heroes.concat [ThangType.heroes.ninja, ThangType.heroes.librarian] if me.isAdmin()
heroes = _.values ThangType.heroes if me.isAdmin()
heroes
items: -> (me.get('earned')?.items ? []).concat(me.get('purchased')?.items ? []).concat([ThangType.items['simple-boots']])
levels: -> (me.get('earned')?.levels ? []).concat(me.get('purchased')?.levels ? [])

View file

@ -83,7 +83,7 @@ module.exports = class InventoryModal extends ModalView
# sort into one of the four groups
locked = not (item.get('original') in me.items())
#locked = false if me.get('slug') is 'nick'
locked = false if me.get('slug') is 'nick'
if locked and item.get('slug') isnt 'simple-boots'
@itemGroups.lockedItems.add(item)

View file

@ -141,8 +141,8 @@ module.exports = class LevelPlaybackView extends CocoView
catch error
console.warn('error disabling scrubber', error)
@timePopup?.disable()
$('#volume-button', @$el).removeClass('disabled')
@$el.addClass 'controls-disabled'
$('#volume-button', @$el).removeClass('disabled')
@$el.addClass 'controls-disabled'
onEnableControls: (e) ->
return if @realTime
@ -154,7 +154,7 @@ module.exports = class LevelPlaybackView extends CocoView
catch error
console.warn('error enabling scrubber', error)
@timePopup?.enable()
@$el.removeClass 'controls-disabled'
@$el.removeClass 'controls-disabled'
onSetPlaying: (e) ->
@playing = (e ? {}).playing ? true