From: dsc Date: Sat, 12 Feb 2011 13:18:24 +0000 (-0800) Subject: Equipslots now work. X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=a11ffe4a058b42056e403d9f754f5c0a7ad044c7;p=tanks.git Equipslots now work. --- diff --git a/src/tanks/inventory/equipslot.cjs b/src/tanks/inventory/equipslot.cjs new file mode 100644 index 0000000..f54d11e --- /dev/null +++ b/src/tanks/inventory/equipslot.cjs @@ -0,0 +1,33 @@ +var Y = require('Y').Y +, evt = require('evt') +, Bag = require('tanks/inventory/bag').Bag +, + +EquipSlot = +exports['EquipSlot'] = +Bag.subclass('EquipSlot', { + + /// Setup /// + hasUI : true, + isDraggable : true, + equipsContents : true, + max : 1, + cols : 10, + reqs : null, + // highlightIconOnOpen : true, // Whether to highlight the inventory icon when bag is open + + /// Bookkeeping /// + bagName : 'equip-slot', + ui : null, // ContainerUI + + + init : function initEquipSlot(name, inventory, player, options){ + this.inventory = inventory; + this._layerId = name+'_slot'; + Bag.init.call(this, player, name, options); + this.showUI(); + if (this.ui) this.ui.layer.addClass(name+' equipslot bag'); + } + +}) +;