Added a rudimentary (aka programmer-designed) hero-type filter for the item store.
This commit is contained in:
parent
38948137b9
commit
22e1318970
4 changed files with 61 additions and 3 deletions
app
locale
styles/play/modal
templates/play/modal
views/play/modal
|
@ -197,6 +197,9 @@
|
||||||
hard: "Hard"
|
hard: "Hard"
|
||||||
player: "Player"
|
player: "Player"
|
||||||
player_level: "Level" # Like player level 5, not like level: Dungeons of Kithgard
|
player_level: "Level" # Like player level 5, not like level: Dungeons of Kithgard
|
||||||
|
warrior: "Warrior"
|
||||||
|
ranger: "Ranger"
|
||||||
|
wizard: "Wizard"
|
||||||
|
|
||||||
units:
|
units:
|
||||||
second: "second"
|
second: "second"
|
||||||
|
|
|
@ -111,6 +111,29 @@
|
||||||
color: white
|
color: white
|
||||||
|
|
||||||
|
|
||||||
|
//- Hero Type Select
|
||||||
|
|
||||||
|
#hero-type-select
|
||||||
|
position: absolute
|
||||||
|
top: 102px
|
||||||
|
left: 177px
|
||||||
|
background: rgb(26,21,17)
|
||||||
|
padding: 2px 0
|
||||||
|
z-index: 3
|
||||||
|
border-radius: 2px
|
||||||
|
|
||||||
|
label
|
||||||
|
background: rgb(58,47,38)
|
||||||
|
color: rgb(195,153,124)
|
||||||
|
border: 2px solid rgb(85,70,57)
|
||||||
|
margin: 0 2px
|
||||||
|
|
||||||
|
&.active
|
||||||
|
background: rgb(33,28,21)
|
||||||
|
border: 2px solid rgb(64,53,41)
|
||||||
|
color: white
|
||||||
|
|
||||||
|
|
||||||
//- Item List
|
//- Item List
|
||||||
|
|
||||||
.tab-content
|
.tab-content
|
||||||
|
@ -120,7 +143,19 @@
|
||||||
width: 669px
|
width: 669px
|
||||||
height: 507px
|
height: 507px
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
|
|
||||||
|
&.filter-warrior
|
||||||
|
.item.Ranger, .item.Wizard
|
||||||
|
display: none
|
||||||
|
|
||||||
|
&.filter-ranger
|
||||||
|
.item.Warrior, .item.Wizard
|
||||||
|
display: none
|
||||||
|
|
||||||
|
&.filter-wizard
|
||||||
|
.item.Ranger, .item.Warrior
|
||||||
|
display: none
|
||||||
|
|
||||||
.tab-pane
|
.tab-pane
|
||||||
height: 100%
|
height: 100%
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,21 @@
|
||||||
a.one-line(href="#item-category-" + category, data-toggle="tab")
|
a.one-line(href="#item-category-" + category, data-toggle="tab")
|
||||||
img.tab-icon(src="/images/pages/play/modal/item-icon-"+category+".png", draggable="false")
|
img.tab-icon(src="/images/pages/play/modal/item-icon-"+category+".png", draggable="false")
|
||||||
span.big-font= itemCategoryNames[index]
|
span.big-font= itemCategoryNames[index]
|
||||||
|
|
||||||
|
#hero-type-select.btn-group(data-toggle="buttons")
|
||||||
|
label.btn.active#all
|
||||||
|
input(type="radio", name="hero-class-select", autocomplete="off")
|
||||||
|
span(data-i18n="editor.level_tab_thangs_all")
|
||||||
|
label.btn#warrior
|
||||||
|
input(type="radio", name="hero-class-select", autocomplete="off")
|
||||||
|
span(data-i18n="general.warrior")
|
||||||
|
label.btn#ranger
|
||||||
|
input(type="radio", name="hero-class-select", autocomplete="off")
|
||||||
|
span(data-i18n="general.ranger")
|
||||||
|
label.btn#wizard
|
||||||
|
input(type="radio", name="hero-class-select", autocomplete="off")
|
||||||
|
span(data-i18n="general.wizard")
|
||||||
|
|
||||||
.tab-content
|
.tab-content
|
||||||
for category, index in itemCategories
|
for category, index in itemCategories
|
||||||
.tab-pane(id="item-category-" + category, class=index ? "" : "active")
|
.tab-pane(id="item-category-" + category, class=index ? "" : "active")
|
||||||
|
@ -27,7 +40,7 @@
|
||||||
for item in itemCategoryCollections[category].models
|
for item in itemCategoryCollections[category].models
|
||||||
- var hidden = item.comingSoon && !me.isAdmin()
|
- var hidden = item.comingSoon && !me.isAdmin()
|
||||||
- hidden = hidden || (!item.get('gems') && !item.owned)
|
- hidden = hidden || (!item.get('gems') && !item.owned)
|
||||||
div(class="item" + (hidden ? " hide" : "") + (item.silhouetted && !item.owned ? " silhouetted" : ""), data-item-id=item.id)
|
div(class="item " + item.get('heroClass') + (hidden ? " hide" : "") + (item.silhouetted && !item.owned ? " silhouetted" : ""), data-item-id=item.id)
|
||||||
if item.silhouetted && !item.owned
|
if item.silhouetted && !item.owned
|
||||||
span.glyphicon.glyphicon-lock.bolder
|
span.glyphicon.glyphicon-lock.bolder
|
||||||
span.glyphicon.glyphicon-lock
|
span.glyphicon.glyphicon-lock
|
||||||
|
|
|
@ -52,6 +52,7 @@ module.exports = class PlayItemsModal extends ModalView
|
||||||
'click #close-modal': 'hide'
|
'click #close-modal': 'hide'
|
||||||
'click': 'onClickedSomewhere'
|
'click': 'onClickedSomewhere'
|
||||||
'update .tab-pane .nano': 'onScrollItemPane'
|
'update .tab-pane .nano': 'onScrollItemPane'
|
||||||
|
'click #hero-type-select label': 'onClickHeroTypeSelect'
|
||||||
|
|
||||||
constructor: (options) ->
|
constructor: (options) ->
|
||||||
@onScrollItemPane = _.throttle(_.bind(@onScrollItemPane, @), 200)
|
@onScrollItemPane = _.throttle(_.bind(@onScrollItemPane, @), 200)
|
||||||
|
@ -162,6 +163,12 @@ module.exports = class PlayItemsModal extends ModalView
|
||||||
item = @idToItem[itemEl.data('item-id')]
|
item = @idToItem[itemEl.data('item-id')]
|
||||||
itemEl.find('.item-silhouette, .item-img').attr('src', item.getPortraitURL())
|
itemEl.find('.item-silhouette, .item-img').attr('src', item.getPortraitURL())
|
||||||
|
|
||||||
|
onClickHeroTypeSelect: (e) ->
|
||||||
|
value = $(e.target).closest('label').attr('id')
|
||||||
|
tabContent = @$el.find('.tab-content')
|
||||||
|
tabContent.removeClass('filter-wizard filter-ranger filter-warrior')
|
||||||
|
tabContent.addClass("filter-#{value}") if value isnt 'all'
|
||||||
|
|
||||||
onUnlockButtonClicked: (e) ->
|
onUnlockButtonClicked: (e) ->
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
button = $(e.target).closest('button')
|
button = $(e.target).closest('button')
|
||||||
|
|
Reference in a new issue