mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Hid parts of game menu that aren't ready yet.
This commit is contained in:
parent
8fafd46b7f
commit
9fd31c70e7
4 changed files with 26 additions and 14 deletions
|
@ -2,6 +2,7 @@ h3(data-i18n="play_level.reload_title") Reload All Code?
|
||||||
|
|
||||||
p(data-i18n="play_level.reload_really") Are you sure you want to reload this level back to the beginning?
|
p(data-i18n="play_level.reload_really") Are you sure you want to reload this level back to the beginning?
|
||||||
|
|
||||||
|
if showDevBits
|
||||||
p
|
p
|
||||||
a(href='#', data-dismiss="modal", aria-hidden="true", data-i18n="play_level.reload_confirm").btn.btn-primary#restart-level-confirm-button Reload All
|
a(href='#', data-dismiss="modal", aria-hidden="true", data-i18n="play_level.reload_confirm").btn.btn-primary#restart-level-confirm-button Reload All
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,11 @@ block modal-header
|
||||||
block modal-body-content
|
block modal-body-content
|
||||||
.tabbable.tabs-left
|
.tabbable.tabs-left
|
||||||
- var submenus = ["inventory", "choose-hero", "save-load", "options", "guide", "multiplayer"]
|
- var submenus = ["inventory", "choose-hero", "save-load", "options", "guide", "multiplayer"]
|
||||||
|
- if (!showDevBits) { // Not done yet.
|
||||||
|
- submenus.splice(4, 1);
|
||||||
|
- submenus.splice(2, 1);
|
||||||
|
- submenus.splice(0, 1);
|
||||||
|
- }
|
||||||
ul.nav.nav-tabs
|
ul.nav.nav-tabs
|
||||||
for submenu, index in submenus
|
for submenu, index in submenus
|
||||||
li(class=index ? "" : "active")
|
li(class=index ? "" : "active")
|
||||||
|
|
|
@ -13,6 +13,7 @@ module.exports = class ChooseHeroView extends CocoView
|
||||||
|
|
||||||
getRenderData: (context={}) ->
|
getRenderData: (context={}) ->
|
||||||
context = super(context)
|
context = super(context)
|
||||||
|
context.showDevBits = @options.showDevBits
|
||||||
context
|
context
|
||||||
|
|
||||||
afterRender: ->
|
afterRender: ->
|
||||||
|
|
|
@ -14,17 +14,22 @@ module.exports = class GameMenuModal extends ModalView
|
||||||
modalWidthPercent: 95
|
modalWidthPercent: 95
|
||||||
id: 'game-menu-modal'
|
id: 'game-menu-modal'
|
||||||
|
|
||||||
|
constructor: (options) ->
|
||||||
|
super options
|
||||||
|
@options.showDevBits = me.isAdmin() or /https?:\/\/localhost/.test(window.location.href)
|
||||||
|
|
||||||
events:
|
events:
|
||||||
'change input.select': 'onSelectionChanged'
|
'change input.select': 'onSelectionChanged'
|
||||||
|
|
||||||
getRenderData: (context={}) ->
|
getRenderData: (context={}) ->
|
||||||
context = super(context)
|
context = super(context)
|
||||||
|
context.showDevBits = @options.showDevBits
|
||||||
context
|
context
|
||||||
|
|
||||||
afterRender: ->
|
afterRender: ->
|
||||||
super()
|
super()
|
||||||
@insertSubView new submenuView @options for submenuView in submenuViews
|
@insertSubView new submenuView @options for submenuView in submenuViews
|
||||||
@subviews.inventory_view.$el.addClass 'active'
|
(if @options.showDevBits then @subviews.inventory_view else @subviews.choose_hero_view).$el.addClass 'active'
|
||||||
|
|
||||||
onHidden: ->
|
onHidden: ->
|
||||||
subview.onHidden?() for subviewKey, subview of @subviews
|
subview.onHidden?() for subviewKey, subview of @subviews
|
||||||
|
|
Loading…
Reference in a new issue