mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-14 05:55:00 -04:00
Fixed a bug with hero placeholder loading. Improved game menu modal close button usability.
This commit is contained in:
parent
389f6fb9c1
commit
2872de71ce
7 changed files with 34 additions and 8 deletions
app
models
styles
templates/game-menu
views/game-menu
|
@ -69,13 +69,13 @@ module.exports = class Level extends CocoModel
|
|||
heroThangType = session?.get('heroConfig')?.thangType
|
||||
levelThang.thangType = heroThangType if heroThangType
|
||||
|
||||
thangType = supermodel.getModelByOriginal(ThangType, levelThang.thangType)
|
||||
thangType = supermodel.getModelByOriginal(ThangType, levelThang.thangType, (m) -> m.get('components')?)
|
||||
|
||||
configs = {}
|
||||
for thangComponent in levelThang.components
|
||||
configs[thangComponent.original] = thangComponent
|
||||
|
||||
for defaultThangComponent in thangType.get('components') or []
|
||||
for defaultThangComponent in thangType?.get('components') or []
|
||||
if levelThangComponent = configs[defaultThangComponent.original]
|
||||
# Take the ThangType default Components and merge level-specific Component config into it
|
||||
copy = $.extend true, {}, defaultThangComponent.config
|
||||
|
|
|
@ -84,9 +84,9 @@ module.exports = class SuperModel extends Backbone.Model
|
|||
modelURL = modelURL() if _.isFunction(modelURL)
|
||||
return @models[modelURL] or null
|
||||
|
||||
getModelByOriginal: (ModelClass, original) ->
|
||||
getModelByOriginal: (ModelClass, original, filter=null) ->
|
||||
_.find @models, (m) ->
|
||||
m.get('original') is original and m.constructor.className is ModelClass.className
|
||||
m.get('original') is original and m.constructor.className is ModelClass.className and (not filter or filter(m))
|
||||
|
||||
getModelByOriginalAndMajorVersion: (ModelClass, original, majorVersion=0) ->
|
||||
_.find @models, (m) ->
|
||||
|
|
|
@ -132,6 +132,9 @@ a
|
|||
|
||||
.close
|
||||
font-size: 28px
|
||||
padding: 15px
|
||||
margin-right: -15px
|
||||
margin-top: -15px
|
||||
@include opacity(0.60)
|
||||
&:hover
|
||||
@include opacity(1)
|
||||
|
|
|
@ -1,10 +1,31 @@
|
|||
@import "app/styles/mixins"
|
||||
|
||||
#game-menu-modal
|
||||
|
||||
.close
|
||||
// We have to style this indendently because it's not in the header (we don't have a header).
|
||||
position: absolute
|
||||
top: 10px
|
||||
right: 20px
|
||||
top: -5px
|
||||
right: 0
|
||||
padding: 15px
|
||||
font-size: 28px
|
||||
background-color: transparent
|
||||
z-index: 1
|
||||
|
||||
@include opacity(0.60)
|
||||
|
||||
&:hover
|
||||
@include opacity(1)
|
||||
|
||||
// Make room for an overlaid close button in the lower right (we don't have a footer).
|
||||
.overlaid-close-button
|
||||
position: absolute
|
||||
right: 35px
|
||||
bottom: 20px
|
||||
|
||||
#inventory-view #available-equipment
|
||||
bottom: 60px
|
||||
|
||||
.modal-dialog
|
||||
margin-top: 0
|
||||
|
||||
|
@ -58,3 +79,4 @@
|
|||
&, &:hover, &:focus
|
||||
border-color: #ddd transparent #ddd #ddd
|
||||
*border-right-color: #fff
|
||||
|
||||
|
|
|
@ -147,7 +147,6 @@ $stashWidth: $totalWidth - $equippedWidth - $stashMargin
|
|||
right: 0
|
||||
top: 0
|
||||
bottom: 0
|
||||
//bottom: $selectedAreaHeight + 10
|
||||
overflow: scroll
|
||||
border: 2px solid #ccc
|
||||
padding: 4px
|
||||
|
|
|
@ -23,4 +23,5 @@ block modal-body-content
|
|||
.tab-pane(id=submenu + '-view')
|
||||
.clearfix
|
||||
|
||||
block modal-footer
|
||||
block modal-footer
|
||||
button.btn.btn-primary.btn-lg.overlaid-close-button(type="button", data-dismiss="modal", aria-hidden="true", data-i18n="modal.close") Close
|
||||
|
|
|
@ -23,6 +23,7 @@ module.exports = class GameMenuModal extends ModalView
|
|||
super options
|
||||
@options.showDevBits = me.isAdmin() or /https?:\/\/localhost/.test(window.location.href)
|
||||
@options.showInventory = @options.level.get('type', true) is 'hero'
|
||||
@options.levelID = @options.level.get('slug')
|
||||
|
||||
getRenderData: (context={}) ->
|
||||
context = super(context)
|
||||
|
|
Loading…
Add table
Reference in a new issue