Insane hackery for #1777 to give us more code editor space, better use of space with tall screens, and scrolling API properties. Watch out for bugs.
This commit is contained in:
parent
d750c95933
commit
7dff105cdf
12 changed files with 96 additions and 51 deletions
app
lib/surface
models
styles/play
templates/play
views/play/level/tome
server/routes
|
@ -141,6 +141,7 @@ module.exports = Lank = class Lank extends CocoClass
|
||||||
onSurfaceTicked: (e) -> @age += e.dt
|
onSurfaceTicked: (e) -> @age += e.dt
|
||||||
|
|
||||||
playNextAction: =>
|
playNextAction: =>
|
||||||
|
return if @destroyed
|
||||||
@playAction(@actionQueue.splice(0, 1)[0]) if @actionQueue.length
|
@playAction(@actionQueue.splice(0, 1)[0]) if @actionQueue.length
|
||||||
|
|
||||||
playAction: (action) ->
|
playAction: (action) ->
|
||||||
|
|
|
@ -119,7 +119,9 @@ module.exports = class User extends CocoModel
|
||||||
|
|
||||||
# Signs and Portents was receiving updates after test started, and also had a big bug on March 4, so just look at test from March 5 on.
|
# Signs and Portents was receiving updates after test started, and also had a big bug on March 4, so just look at test from March 5 on.
|
||||||
# ... and stopped working well until another update on March 10, so maybe March 11+...
|
# ... and stopped working well until another update on March 10, so maybe March 11+...
|
||||||
|
# ... and another round, and then basically it just isn't completing well, so we pause the test until we can fix it.
|
||||||
getFourthLevelGroup: ->
|
getFourthLevelGroup: ->
|
||||||
|
return 'signs-and-portents'
|
||||||
return @fourthLevelGroup if @fourthLevelGroup
|
return @fourthLevelGroup if @fourthLevelGroup
|
||||||
group = me.get('testGroupNumber') % 8
|
group = me.get('testGroupNumber') % 8
|
||||||
@fourthLevelGroup = switch group
|
@fourthLevelGroup = switch group
|
||||||
|
|
|
@ -63,7 +63,6 @@ $level-resize-transition-time: 0.5s
|
||||||
|
|
||||||
.level-content
|
.level-content
|
||||||
position: relative
|
position: relative
|
||||||
overflow: hidden
|
|
||||||
|
|
||||||
#canvas-wrapper
|
#canvas-wrapper
|
||||||
top: 50px
|
top: 50px
|
||||||
|
@ -128,6 +127,10 @@ $level-resize-transition-time: 0.5s
|
||||||
top: 0px
|
top: 0px
|
||||||
bottom: 0
|
bottom: 0
|
||||||
@include transition(width $level-resize-transition-time ease-in-out, right $level-resize-transition-time ease-in-out)
|
@include transition(width $level-resize-transition-time ease-in-out, right $level-resize-transition-time ease-in-out)
|
||||||
|
z-index: 2
|
||||||
|
|
||||||
|
#game-area
|
||||||
|
position: relative
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
|
|
||||||
// Level Docs
|
// Level Docs
|
||||||
|
|
|
@ -63,6 +63,7 @@
|
||||||
overflow: visible
|
overflow: visible
|
||||||
// https://github.com/codecombat/codecombat/issues/1411#issuecomment-60492750 -- trying to make sure system defaults don't mess up our monospace font.
|
// https://github.com/codecombat/codecombat/issues/1411#issuecomment-60492750 -- trying to make sure system defaults don't mess up our monospace font.
|
||||||
font-family: Monaco, Menlo, Ubuntu Mono, Consolas, "source-code-pro", monospace !important
|
font-family: Monaco, Menlo, Ubuntu Mono, Consolas, "source-code-pro", monospace !important
|
||||||
|
@include transition(height 0.25s ease-in-out)
|
||||||
|
|
||||||
&.disabled
|
&.disabled
|
||||||
@include opacity(0.8)
|
@include opacity(0.8)
|
||||||
|
|
|
@ -9,13 +9,19 @@
|
||||||
background-color: transparent
|
background-color: transparent
|
||||||
background-size: 100% 100%
|
background-size: 100% 100%
|
||||||
z-index: 2
|
z-index: 2
|
||||||
//overflow-y: auto
|
@include transition(top 0.25s ease-in-out, height 0.25s ease-in-out)
|
||||||
|
box-shadow: 10px 4px 4px black
|
||||||
|
overflow-y: hidden
|
||||||
|
|
||||||
.code-palette-background
|
.code-palette-background
|
||||||
width: 100%
|
width: 100%
|
||||||
|
height: 592px
|
||||||
position: absolute
|
position: absolute
|
||||||
left: 0px
|
left: 0px
|
||||||
z-index: -1
|
z-index: -1
|
||||||
|
background: transparent url(/images/level/code_palette_wood_background.png)
|
||||||
|
background-size: 100% 592px
|
||||||
|
overflow: visible
|
||||||
|
|
||||||
&.controls-disabled
|
&.controls-disabled
|
||||||
.code-palette-background
|
.code-palette-background
|
||||||
|
@ -71,6 +77,9 @@
|
||||||
@include flex-column()
|
@include flex-column()
|
||||||
@include flex-align-content-start()
|
@include flex-align-content-start()
|
||||||
|
|
||||||
|
&.no-help
|
||||||
|
margin-top: 3%
|
||||||
|
|
||||||
.property-entry-item-group
|
.property-entry-item-group
|
||||||
display: inline-block
|
display: inline-block
|
||||||
min-height: 38px
|
min-height: 38px
|
||||||
|
@ -97,6 +106,15 @@
|
||||||
width: -webkit-calc(100% - 38px)
|
width: -webkit-calc(100% - 38px)
|
||||||
width: calc(100% - 38px)
|
width: calc(100% - 38px)
|
||||||
|
|
||||||
|
&.shortenize.hero .properties
|
||||||
|
.property-entry-item-group
|
||||||
|
width: 175px
|
||||||
|
|
||||||
|
.spell-palette-entry-view
|
||||||
|
width: 137px
|
||||||
|
width: -webkit-calc(100% - 38px)
|
||||||
|
width: calc(100% - 38px)
|
||||||
|
|
||||||
@media only screen and (max-width: 1100px)
|
@media only screen and (max-width: 1100px)
|
||||||
#spell-palette-view
|
#spell-palette-view
|
||||||
// Make sure we have enough room for at least two columns
|
// Make sure we have enough room for at least two columns
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#tome-view
|
#tome-view
|
||||||
height: 100%
|
height: 100%
|
||||||
margin-bottom: -20px
|
margin-bottom: -20px
|
||||||
|
overflow: hidden
|
||||||
|
|
||||||
> .popover
|
> .popover
|
||||||
// Only those popovers which are our direct children (spell documentation)
|
// Only those popovers which are our direct children (spell documentation)
|
||||||
|
|
|
@ -4,34 +4,36 @@
|
||||||
#control-bar-view
|
#control-bar-view
|
||||||
|
|
||||||
#fullscreen-editor-background-screen(title="Click to minimize the code editor")
|
#fullscreen-editor-background-screen(title="Click to minimize the code editor")
|
||||||
|
|
||||||
#code-area
|
#code-area
|
||||||
#code-area-gradient.gradient
|
#code-area-gradient.gradient
|
||||||
#tome-view
|
#tome-view
|
||||||
|
|
||||||
#canvas-wrapper
|
|
||||||
canvas(width=924, height=589)#webgl-surface
|
|
||||||
canvas(width=924, height=589)#normal-surface
|
|
||||||
#ascii-surface
|
|
||||||
#canvas-left-gradient.gradient
|
|
||||||
#canvas-top-gradient.gradient
|
|
||||||
#goals-view
|
|
||||||
|
|
||||||
#level-flags-view
|
|
||||||
|
|
||||||
#gold-view
|
#game-area
|
||||||
|
|
||||||
#problem-alert-view
|
#canvas-wrapper
|
||||||
|
canvas(width=924, height=589)#webgl-surface
|
||||||
|
canvas(width=924, height=589)#normal-surface
|
||||||
|
#ascii-surface
|
||||||
|
#canvas-left-gradient.gradient
|
||||||
|
#canvas-top-gradient.gradient
|
||||||
|
#goals-view
|
||||||
|
|
||||||
#level-chat-view
|
#level-flags-view
|
||||||
|
|
||||||
#multiplayer-status-view
|
|
||||||
|
|
||||||
#playback-view
|
|
||||||
|
|
||||||
#thang-hud
|
|
||||||
|
|
||||||
#level-dialogue-view
|
#gold-view
|
||||||
|
|
||||||
|
#problem-alert-view
|
||||||
|
|
||||||
|
#level-chat-view
|
||||||
|
|
||||||
|
#multiplayer-status-view
|
||||||
|
|
||||||
|
#playback-view
|
||||||
|
|
||||||
|
#thang-hud
|
||||||
|
|
||||||
|
#level-dialogue-view
|
||||||
|
|
||||||
button.btn.btn-lg.btn-warning.banner.header-font#stop-real-time-playback-button(title="Stop real-time playback", data-i18n="play_level.skip") Skip
|
button.btn.btn-lg.btn-warning.banner.header-font#stop-real-time-playback-button(title="Stop real-time playback", data-i18n="play_level.skip") Skip
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
img(src="/images/level/code_palette_wood_background.png", draggable="false").code-palette-background
|
|
||||||
span.code-palette-background
|
span.code-palette-background
|
||||||
if entryGroupSlugs
|
if entryGroupSlugs
|
||||||
// Non-hero; group by entry groups, or maybe nothing.
|
// Non-hero; group by entry groups, or maybe nothing.
|
||||||
|
@ -13,6 +12,9 @@ if entryGroupSlugs
|
||||||
div(class="properties properties-" + slug + " nano-content")
|
div(class="properties properties-" + slug + " nano-content")
|
||||||
else
|
else
|
||||||
// Hero; group by items, no tabs.
|
// Hero; group by items, no tabs.
|
||||||
button.btn.btn-sm.btn-info.banner#spell-palette-help-button(data-i18n="play_level.tome_help")
|
if showsHelp
|
||||||
.properties
|
button.btn.btn-sm.btn-info.banner#spell-palette-help-button(data-i18n="play_level.tome_help")
|
||||||
|
.properties
|
||||||
|
else
|
||||||
|
.properties.no-help
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,8 @@ module.exports = class DocFormatter
|
||||||
@doc.shorterName = @doc.shortName.replace ';', ''
|
@doc.shorterName = @doc.shortName.replace ';', ''
|
||||||
if @doc.owner is 'this' or @options.tabbify
|
if @doc.owner is 'this' or @options.tabbify
|
||||||
@doc.shorterName = @doc.shorterName.replace /^this\./, ''
|
@doc.shorterName = @doc.shorterName.replace /^this\./, ''
|
||||||
|
else if (@options.language in ['python', 'lua']) and (@doc.owner is 'this' or @options.tabbify)
|
||||||
|
@doc.shorterName = @doc.shortName.replace /^self[:.]/, ''
|
||||||
@doc.title = if @options.shortenize then @doc.shorterName else @doc.shortName
|
@doc.title = if @options.shortenize then @doc.shorterName else @doc.shortName
|
||||||
|
|
||||||
# Grab the language-specific documentation for some sub-properties, if we have it.
|
# Grab the language-specific documentation for some sub-properties, if we have it.
|
||||||
|
|
|
@ -29,6 +29,8 @@ module.exports = class SpellPaletteView extends CocoView
|
||||||
@session = options.session
|
@session = options.session
|
||||||
@supermodel = options.supermodel
|
@supermodel = options.supermodel
|
||||||
@thang = options.thang
|
@thang = options.thang
|
||||||
|
docs = @options.level.get('documentation') ? {}
|
||||||
|
@showsHelp = docs.specificArticles?.length or docs.generalArticles?.length
|
||||||
@createPalette()
|
@createPalette()
|
||||||
$(window).on 'resize', @onResize
|
$(window).on 'resize', @onResize
|
||||||
|
|
||||||
|
@ -39,6 +41,7 @@ module.exports = class SpellPaletteView extends CocoView
|
||||||
c.entryGroupNames = @entryGroupNames
|
c.entryGroupNames = @entryGroupNames
|
||||||
c.tabbed = _.size(@entryGroups) > 1
|
c.tabbed = _.size(@entryGroups) > 1
|
||||||
c.defaultGroupSlug = @defaultGroupSlug
|
c.defaultGroupSlug = @defaultGroupSlug
|
||||||
|
c.showsHelp = @showsHelp
|
||||||
c
|
c
|
||||||
|
|
||||||
afterRender: ->
|
afterRender: ->
|
||||||
|
@ -72,6 +75,7 @@ module.exports = class SpellPaletteView extends CocoView
|
||||||
if entryIndex is 0
|
if entryIndex is 0
|
||||||
entry.$el.addClass 'first-entry'
|
entry.$el.addClass 'first-entry'
|
||||||
@$el.addClass 'hero'
|
@$el.addClass 'hero'
|
||||||
|
@$el.toggleClass 'shortenize', Boolean @shortenize
|
||||||
@updateMaxHeight() unless application.isIPadApp
|
@updateMaxHeight() unless application.isIPadApp
|
||||||
|
|
||||||
afterInsert: ->
|
afterInsert: ->
|
||||||
|
@ -83,18 +87,27 @@ module.exports = class SpellPaletteView extends CocoView
|
||||||
|
|
||||||
updateMaxHeight: ->
|
updateMaxHeight: ->
|
||||||
return unless @isHero
|
return unless @isHero
|
||||||
nColumns = Math.floor @$el.find('.properties').innerWidth() / 212 # ~212px is a good max entry width; will always have 2 columns
|
# We figure out how many columns we can fit, width-wise, and then guess how many rows will be needed.
|
||||||
|
# We can then assign a height based on the number of rows, and the flex layout will do the rest.
|
||||||
|
columnWidth = if @shortenize then 175 else 212
|
||||||
|
nColumns = Math.floor @$el.find('.properties').innerWidth() / columnWidth # will always have 2 columns, since at 1024px screen we have 424px .properties
|
||||||
columns = ({items: [], nEntries: 0} for i in [0 ... nColumns])
|
columns = ({items: [], nEntries: 0} for i in [0 ... nColumns])
|
||||||
|
orderedColumns = []
|
||||||
nRows = 0
|
nRows = 0
|
||||||
for group, entries of @entryGroups
|
entryGroupsByLength = _.sortBy _.keys(@entryGroups), (group) => @entryGroups[group].length
|
||||||
|
entryGroupsByLength.reverse()
|
||||||
|
for group in entryGroupsByLength
|
||||||
|
entries = @entryGroups[group]
|
||||||
continue unless shortestColumn = _.sortBy(columns, (column) -> column.nEntries)[0]
|
continue unless shortestColumn = _.sortBy(columns, (column) -> column.nEntries)[0]
|
||||||
shortestColumn.nEntries += Math.max 2, entries.length
|
shortestColumn.nEntries += Math.max 2, entries.length # Item portrait is two rows tall
|
||||||
shortestColumn.items.push @entryGroupElements[group]
|
shortestColumn.items.push @entryGroupElements[group]
|
||||||
|
orderedColumns.push shortestColumn unless shortestColumn in orderedColumns
|
||||||
nRows = Math.max nRows, shortestColumn.nEntries
|
nRows = Math.max nRows, shortestColumn.nEntries
|
||||||
for column in columns
|
for column in orderedColumns
|
||||||
for item in column.items
|
for item in column.items
|
||||||
item.detach().appendTo @$el.find('.properties')
|
item.detach().appendTo @$el.find('.properties')
|
||||||
@$el.find('.properties').css('height', 19 * (nRows + 1))
|
desiredHeight = 19 * (nRows + 1)
|
||||||
|
@$el.find('.properties').css('height', desiredHeight)
|
||||||
|
|
||||||
onResize: (e) =>
|
onResize: (e) =>
|
||||||
@updateMaxHeight()
|
@updateMaxHeight()
|
||||||
|
@ -151,7 +164,7 @@ module.exports = class SpellPaletteView extends CocoView
|
||||||
count += added.length
|
count += added.length
|
||||||
Backbone.Mediator.publish 'tome:update-snippets', propGroups: propGroups, allDocs: allDocs, language: @options.language
|
Backbone.Mediator.publish 'tome:update-snippets', propGroups: propGroups, allDocs: allDocs, language: @options.language
|
||||||
|
|
||||||
shortenize = count > 6
|
@shortenize = count > 6
|
||||||
tabbify = count >= 10
|
tabbify = count >= 10
|
||||||
@entries = []
|
@entries = []
|
||||||
for owner, props of propGroups
|
for owner, props of propGroups
|
||||||
|
@ -163,7 +176,7 @@ module.exports = class SpellPaletteView extends CocoView
|
||||||
console.log 'could not find doc for', prop, 'from', allDocs['__' + prop], 'for', owner, 'of', propGroups
|
console.log 'could not find doc for', prop, 'from', allDocs['__' + prop], 'for', owner, 'of', propGroups
|
||||||
doc ?= prop
|
doc ?= prop
|
||||||
if doc
|
if doc
|
||||||
@entries.push @addEntry(doc, shortenize, tabbify, owner is 'snippets')
|
@entries.push @addEntry(doc, @shortenize, tabbify, owner is 'snippets')
|
||||||
groupForEntry = (entry) ->
|
groupForEntry = (entry) ->
|
||||||
return 'more' if entry.doc.owner is 'this' and entry.doc.name in (propGroups.more ? [])
|
return 'more' if entry.doc.owner is 'this' and entry.doc.name in (propGroups.more ? [])
|
||||||
entry.doc.owner
|
entry.doc.owner
|
||||||
|
@ -229,7 +242,7 @@ module.exports = class SpellPaletteView extends CocoView
|
||||||
|
|
||||||
Backbone.Mediator.publish 'tome:update-snippets', propGroups: propsByItem, allDocs: allDocs, language: @options.language
|
Backbone.Mediator.publish 'tome:update-snippets', propGroups: propsByItem, allDocs: allDocs, language: @options.language
|
||||||
|
|
||||||
shortenize = propCount > 6
|
@shortenize = propCount > 6
|
||||||
@entries = []
|
@entries = []
|
||||||
for itemName, props of propsByItem
|
for itemName, props of propsByItem
|
||||||
for prop, propIndex in props
|
for prop, propIndex in props
|
||||||
|
@ -243,7 +256,7 @@ module.exports = class SpellPaletteView extends CocoView
|
||||||
console.log 'could not find doc for', prop, 'from', allDocs['__' + prop], 'for', owner, 'of', propsByItem, 'with item', item
|
console.log 'could not find doc for', prop, 'from', allDocs['__' + prop], 'for', owner, 'of', propsByItem, 'with item', item
|
||||||
doc ?= prop
|
doc ?= prop
|
||||||
if doc
|
if doc
|
||||||
@entries.push @addEntry(doc, shortenize, false, owner is 'snippets', item, propIndex > 0)
|
@entries.push @addEntry(doc, @shortenize, false, owner is 'snippets', item, propIndex > 0)
|
||||||
@entryGroups = _.groupBy @entries, (entry) -> itemsByProp[entry.doc.name]?.get('name') ? 'Hero'
|
@entryGroups = _.groupBy @entries, (entry) -> itemsByProp[entry.doc.name]?.get('name') ? 'Hero'
|
||||||
iOSEntryGroups = {}
|
iOSEntryGroups = {}
|
||||||
for group, entries of @entryGroups
|
for group, entries of @entryGroups
|
||||||
|
@ -264,16 +277,6 @@ module.exports = class SpellPaletteView extends CocoView
|
||||||
@controlsEnabled = enabled
|
@controlsEnabled = enabled
|
||||||
@$el.find('*').attr('disabled', not enabled)
|
@$el.find('*').attr('disabled', not enabled)
|
||||||
@$el.toggleClass 'controls-disabled', not enabled
|
@$el.toggleClass 'controls-disabled', not enabled
|
||||||
@toggleBackground()
|
|
||||||
|
|
||||||
toggleBackground: =>
|
|
||||||
# TODO: make the palette background an actual background and do the CSS trick
|
|
||||||
# used in spell_list_entry.sass for disabling
|
|
||||||
background = @$el.find('img.code-palette-background')[0]
|
|
||||||
if background.naturalWidth is 0 # not loaded yet
|
|
||||||
return _.delay @toggleBackground, 100
|
|
||||||
filters.revertImage background, 'span.code-palette-background' if @controlsEnabled
|
|
||||||
filters.darkenImage background, 'span.code-palette-background', 0.8 unless @controlsEnabled
|
|
||||||
|
|
||||||
onFrameChanged: (e) ->
|
onFrameChanged: (e) ->
|
||||||
return unless e.selectedThang?.id is @thang.id
|
return unless e.selectedThang?.id is @thang.id
|
||||||
|
|
|
@ -568,15 +568,22 @@ module.exports = class SpellView extends CocoView
|
||||||
@lastScreenLineCount = screenLineCount
|
@lastScreenLineCount = screenLineCount
|
||||||
lineHeight = @ace.renderer.lineHeight or 20
|
lineHeight = @ace.renderer.lineHeight or 20
|
||||||
tomeHeight = $('#tome-view').innerHeight()
|
tomeHeight = $('#tome-view').innerHeight()
|
||||||
|
spellPaletteView = $('#spell-palette-view')
|
||||||
spellListTabEntryHeight = $('#spell-list-tab-entry-view').outerHeight()
|
spellListTabEntryHeight = $('#spell-list-tab-entry-view').outerHeight()
|
||||||
spellToolbarHeight = $('.spell-toolbar-view').outerHeight()
|
spellToolbarHeight = $('.spell-toolbar-view').outerHeight()
|
||||||
spellPaletteHeight = $('#spell-palette-view').outerHeight()
|
@spellPaletteHeight ?= spellPaletteView.outerHeight() # Remember this until resize, since we change it afterward
|
||||||
maxHeight = tomeHeight - spellListTabEntryHeight - spellToolbarHeight - spellPaletteHeight
|
spellPaletteAllowedHeight = Math.min @spellPaletteHeight, tomeHeight / 3
|
||||||
|
maxHeight = tomeHeight - spellListTabEntryHeight - spellToolbarHeight - spellPaletteAllowedHeight
|
||||||
linesAtMaxHeight = Math.floor(maxHeight / lineHeight)
|
linesAtMaxHeight = Math.floor(maxHeight / lineHeight)
|
||||||
lines = Math.max 8, Math.min(screenLineCount + 2, linesAtMaxHeight)
|
lines = Math.max 8, Math.min(screenLineCount + 2, linesAtMaxHeight)
|
||||||
# 2 lines buffer is nice
|
# 2 lines buffer is nice
|
||||||
@ace.setOptions minLines: lines, maxLines: lines
|
@ace.setOptions minLines: lines, maxLines: lines
|
||||||
$('#spell-palette-view').css('top', 175 + lineHeight * lines) # Move spell palette up, slightly overlapping us.
|
# Move spell palette up, slightly overlapping us.
|
||||||
|
newTop = 175 + lineHeight * lines
|
||||||
|
spellPaletteView.css('top', newTop)
|
||||||
|
# Expand it to bottom of tome if too short.
|
||||||
|
newHeight = Math.max @spellPaletteHeight, tomeHeight - newTop + 10
|
||||||
|
spellPaletteView.css('height', newHeight) if @spellPaletteHeight isnt newHeight
|
||||||
|
|
||||||
hideProblemAlert: ->
|
hideProblemAlert: ->
|
||||||
Backbone.Mediator.publish 'tome:hide-problem-alert', {}
|
Backbone.Mediator.publish 'tome:hide-problem-alert', {}
|
||||||
|
@ -1035,6 +1042,8 @@ module.exports = class SpellView extends CocoView
|
||||||
_.delay (=> @resize()), 500 + 100 # Wait $level-resize-transition-time, plus a bit.
|
_.delay (=> @resize()), 500 + 100 # Wait $level-resize-transition-time, plus a bit.
|
||||||
|
|
||||||
onWindowResize: (e) =>
|
onWindowResize: (e) =>
|
||||||
|
@spellPaletteHeight = null
|
||||||
|
$('#spell-palette-view').css 'height', 'auto' # Let it go back to controlling its own height
|
||||||
_.delay (=> @resize?()), 500 + 100 # Wait $level-resize-transition-time, plus a bit.
|
_.delay (=> @resize?()), 500 + 100 # Wait $level-resize-transition-time, plus a bit.
|
||||||
|
|
||||||
resize: ->
|
resize: ->
|
||||||
|
|
|
@ -706,9 +706,10 @@ sendNextStepsEmail = (user, now, daysAgo) ->
|
||||||
return log.error "Couldn't find next level for #{user.get('email')}: #{err}" if err
|
return log.error "Couldn't find next level for #{user.get('email')}: #{err}" if err
|
||||||
name = if user.get('firstName') and user.get('lastName') then "#{user.get('firstName')}" else user.get('name')
|
name = if user.get('firstName') and user.get('lastName') then "#{user.get('firstName')}" else user.get('name')
|
||||||
name = 'hero' if not name or name is 'Anoner'
|
name = 'hero' if not name or name is 'Anoner'
|
||||||
secretLevel = switch user.get('testGroupNumber') % 8
|
#secretLevel = switch user.get('testGroupNumber') % 8
|
||||||
when 0, 1, 2, 3 then name: 'Forgetful Gemsmith', slug: 'forgetful-gemsmith'
|
# when 0, 1, 2, 3 then name: 'Forgetful Gemsmith', slug: 'forgetful-gemsmith'
|
||||||
when 4, 5, 6, 7 then name: 'Signs and Portents', slug: 'signs-and-portents'
|
# when 4, 5, 6, 7 then name: 'Signs and Portents', slug: 'signs-and-portents'
|
||||||
|
secretLevel = name: 'Signs and Portents', slug: 'signs-and-portents' # We turned off this test for now and are sending everyone to forgetful-gemsmith
|
||||||
|
|
||||||
# TODO: make this smarter, actually data-driven, looking at all available sessions
|
# TODO: make this smarter, actually data-driven, looking at all available sessions
|
||||||
shadowGuardSession = _.find sessions, levelID: 'shadow-guard'
|
shadowGuardSession = _.find sessions, levelID: 'shadow-guard'
|
||||||
|
|
Reference in a new issue