Silhouetted items show what level they'd need to unlock after a while on hover from inventory modal.

This commit is contained in:
Nick Winter 2014-11-26 07:33:07 -08:00
parent 48e78aa0d0
commit 18238a1781
3 changed files with 32 additions and 8 deletions
app
styles/game-menu
templates/game-menu
views/game-menu

View file

@ -341,7 +341,7 @@ $itemSlotGridHeight: 70px
position: relative
width: 60px
&:not(.equipped):not(.restricted):not(.locked):not(.silhouette)
&:not(.equipped):not(.restricted):not(.silhouette)
cursor: pointer
&:hover
@ -368,6 +368,18 @@ $itemSlotGridHeight: 70px
padding: 0
@include transition(0.1s ease)
.required-level
@include opacity(0)
@include transition(0.6s ease-in)
pointer-events: none
font-size: 14px
text-align: center
width: 100%
bottom: 20px
top: inherit
position: absolute
color: white
&.active
background-color: rgb(81,153,236)
@ -409,14 +421,18 @@ $itemSlotGridHeight: 70px
//.status-message .restricted-message
// display: inline
&.locked
//background-color: gray
&.locked:not(:hover)
@include filter(contrast(75%))
&.silhouette
pointer-events: none
@include filter(contrast(25%) brightness(25%))
opacity: 0.5
img
@include filter(contrast(25%) brightness(25%))
opacity: 0.5
&:hover
.required-level
@include opacity(1)
text-shadow: 0 1px 0 black, 1px 0 0 black, 0 -1px 0 black, -1px 0 0 black
//- Hero/Play buttons

View file

@ -46,6 +46,10 @@
for item in itemGroups.lockedItems.models
.item(class=item.classes, data-item-id=item.id)
img(src=item.getPortraitURL(), draggable="false")
if item.level
.required-level
span(data-i18n="general.player_level")
span.spl= item.level
.clearfix
#item-details-view

View file

@ -103,6 +103,9 @@ module.exports = class InventoryModal extends ModalView
else
@itemGroups.availableItems.add(item)
# level to unlock
item.level = item.levelRequiredForItem() if item.get('tier')?
onLoaded: ->
# Both items and session have been loaded.
@onItemsLoaded()
@ -210,8 +213,9 @@ module.exports = class InventoryModal extends ModalView
onUnequippedItemClick: (e) ->
return if @justDoubleClicked
@playSound 'menu-button-click'
itemEl = $(e.target).closest('.item')
return if itemEl.hasClass('silhouette')
@playSound 'menu-button-click'
@selectUnequippedItem(itemEl)
onUnequippedItemDoubleClick: (e) ->