Kaynağa Gözat

Merge branch '88-item-grid-shop-stash' into 'staging'

Fixes #88

See merge request !61
tags/v0.1.2^2
Big Bad Waffle 7 yıl önce
ebeveyn
işleme
113209165a
2 değiştirilmiş dosya ile 17 ekleme ve 2 silme
  1. +7
    -0
      src/client/ui/templates/trade/template.html
  2. +10
    -2
      src/client/ui/templates/trade/trade.js

+ 7
- 0
src/client/ui/templates/trade/template.html Dosyayı Görüntüle

@@ -1,3 +1,10 @@
<div class="uiTrade uiInventory"> <div class="uiTrade uiInventory">
<div class="heading">
<div class="heading-text">trade</div>
</div>
<div class="stats">
<div class="list"></div>
</div>
<div class="grid"></div> <div class="grid"></div>
<div class="tooltip"></div>
</div> </div>

+ 10
- 2
src/client/ui/templates/trade/trade.js Dosyayı Görüntüle

@@ -23,6 +23,8 @@ define([
}, },


onGetTradeList: function(itemList, action) { onGetTradeList: function(itemList, action) {
this.find('.heading-text').html(action);

var uiInventory = $('.uiInventory').data('ui'); var uiInventory = $('.uiInventory').data('ui');


var container = this.el.find('.grid') var container = this.el.find('.grid')
@@ -54,8 +56,14 @@ define([
return 0; return 0;
}); });


var iLen = buyItems.length;
var iLen = Math.max(buyItems.length, 50);
for (var i = 0; i < iLen; i++) { for (var i = 0; i < iLen; i++) {
if (!buyItems[i]) {
$(tplItem).appendTo(container);

continue;
}

var item = $.extend(true, {}, buyItems[i]); var item = $.extend(true, {}, buyItems[i]);
item.worth = ~~(itemList.markup * item.worth); item.worth = ~~(itemList.markup * item.worth);


@@ -74,7 +82,7 @@ define([
} }


var imgX = (-item.sprite[0] * size) + offset; var imgX = (-item.sprite[0] * size) + offset;
var imgY = (-item.sprite[1] * size) + offset + 4;
var imgY = (-item.sprite[1] * size) + offset;


var itemEl = $(tplItem) var itemEl = $(tplItem)
.appendTo(container); .appendTo(container);


Yükleniyor…
İptal
Kaydet