Переглянути джерело

close trade when moving

tags/v0.1.5^2
Big Bad Waffle 6 роки тому
джерело
коміт
25416ad12a
3 змінених файлів з 19 додано та 0 видалено
  1. +3
    -0
      src/client/js/components/trade.js
  2. +5
    -0
      src/client/ui/templates/trade/trade.js
  3. +11
    -0
      src/server/components/trade.js

+ 3
- 0
src/client/js/components/trade.js Переглянути файл

@@ -49,6 +49,9 @@ define([

if (redraw)
events.emit('onGetTradeList', this.itemList, this.action);

if (blueprint.closeTrade)
events.emit('onCloseTrade');
}
};
});

+ 5
- 0
src/client/ui/templates/trade/trade.js Переглянути файл

@@ -23,6 +23,7 @@ define([

postRender: function() {
this.onEvent('onGetTradeList', this.onGetTradeList.bind(this));
this.onEvent('onCloseTrade', this.hide.bind(this));
},

onGetTradeList: function(itemList, action) {
@@ -191,6 +192,10 @@ define([
uiTooltipItem.showWorth(canAfford);
},

beforeHide: function() {
events.emit('onHideOverlay', this.el);
},

onServerRespond: function(el) {
el.removeClass('disabled');
}


+ 11
- 0
src/server/components/trade.js Переглянути файл

@@ -341,6 +341,17 @@ define([
result.gold = this.gold;

return result;
},

events: {
beforeMove: function() {
if (!this.target)
return;

this.obj.syncer.set(true, 'trade', 'closeTrade', true);

this.target = null;
}
}
};
});

Завантаження…
Відмінити
Зберегти