/** * Get informations from a skill/item when * using right click on it. */ function onElementInfo( event ) { var index = parseInt(this.parentNode.getAttribute('data-index'), 10); var element = _list[index]; event.stopImmediatePropagation(); // Display skill informations if (element.isSkill) { SkillDescription.append(); SkillDescription.setSkill( _list[index].ID ); } // Display item informations else { if (ItemInfo.uid === _list[index].ID) { ItemInfo.remove(); return false; } ItemInfo.append(); ItemInfo.uid = _list[index].ID; ItemInfo.setItem(Inventory.getItemById(_list[index].ID )); } return false; }
.on('contextmenu', '.item', function(event) { var matches = this.className.match(/(\w+) (\d+)/); var index = parseInt(matches[2], 10); var list; var i, count; for( i = 0, list = Inventory.list, count = list.length; i < count; ++i ) { if( list[i].index === index ) { // Don't add the same UI twice, remove it if( ItemInfo.uid === list[i].ITID ) { ItemInfo.remove(); break; } // Add ui to window ItemInfo.append(); ItemInfo.uid = list[i].ITID; ItemInfo.setItem( list[i] ); break; } } event.stopImmediatePropagation(); return false; })
.on('contextmenu', '.item', function(event) { var idx = parseInt( this.getAttribute('data-index'), 10); var item = this.parentNode.className.match(/send/i) ? _send[idx] : _recv[idx]; // Don't add the same UI twice, remove it if (ItemInfo.uid === item.ITID) { ItemInfo.remove(); } // Add ui to window ItemInfo.append(); ItemInfo.uid = item.ITID; ItemInfo.setItem(item); event.stopImmediatePropagation(); return false; });
.on('contextmenu', '.item', function(event) { var index = parseInt(this.getAttribute('data-index'), 10); var i = getItemIndexById(index); if (i > -1) { // Don't add the same UI twice, remove it if (ItemInfo.uid === _list[i].ITID) { ItemInfo.remove(); } // Add ui to window ItemInfo.append(); ItemInfo.uid = _list[i].ITID; ItemInfo.setItem( _list[i] ); } event.stopImmediatePropagation(); return false; });
/** * Display ItemInfo UI */ function onItemInfo( event ) { var idx = parseInt( this.getAttribute('data-index'), 10); var item = this.parentNode.className.match(/send/i) ? _send[idx] : _recv[idx]; if (!item) { return stopPropagation(event); } // Don't add the same UI twice, remove it if (ItemInfo.uid === item.ITID) { ItemInfo.remove(); } // Add ui to window ItemInfo.append(); ItemInfo.uid = item.ITID; ItemInfo.setItem(item); return stopPropagation(event); }
.on('contextmenu', '.item', function(event) { var index = parseInt(this.getAttribute('data-index'), 10); var item = Inventory.getItemByIndex(index); event.stopImmediatePropagation(); if (!item) { return false; } // Don't add the same UI twice, remove it if (ItemInfo.uid === item.ITID) { ItemInfo.remove(); return false; } // Add ui to window ItemInfo.append(); ItemInfo.uid = item.ITID; ItemInfo.setItem(item); return false; })
.on('contextmenu', '.item', function(event) { var matches = this.className.match(/(\w+) (\d+)/); var index = parseInt(matches[2], 10); var item = Inventory.getItemByIndex(index); event.stopImmediatePropagation(); if (!item) { return false; } // Don't add the same UI twice, remove it if (ItemInfo.uid === item.ITID) { ItemInfo.remove(); return false; } // Add ui to window ItemInfo.append(); ItemInfo.uid = item.ITID; ItemInfo.setItem(item); return false; })
.on('contextmenu', '.item', function(event) { var matches = this.className.match(/(\w+) (\d+)/); var index = parseInt(matches[2], 10); var item = Equipment.list[index]; if( item ) { // Don't add the same UI twice, remove it if( ItemInfo.uid === item.ITID ) { ui.remove(); } // Add ui to window else { ItemInfo.append(); ItemInfo.uid = item.ITID; ItemInfo.setItem( item ); } } event.stopImmediatePropagation(); return false; })
/** * Get informations about an item */ function onItemInfo(event) { var index = parseInt( this.parentNode.getAttribute('data-index'), 10); var item = _input[index]; event.stopImmediatePropagation(); if (!item) { return false; } // Don't add the same UI twice, remove it if (ItemInfo.uid === item.ITID) { ItemInfo.remove(); return false; } // Add ui to window ItemInfo.append(); ItemInfo.uid = item.ITID; ItemInfo.setItem(item); return false; }
/** * Right click on an item */ function onEquipmentInfo( event ) { var index = parseInt(this.getAttribute('data-index'), 10); var item = _list[index]; if (item) { // Don't add the same UI twice, remove it if (ItemInfo.uid === item.ITID) { ItemInfo.remove(); } // Add ui to window else { ItemInfo.append(); ItemInfo.uid = item.ITID; ItemInfo.setItem(item); } } event.stopImmediatePropagation(); return false; }