Equipslots now work.
authordsc <david.schoonover@gmail.com>
Sat, 12 Feb 2011 13:18:24 +0000 (05:18 -0800)
committerdsc <david.schoonover@gmail.com>
Sat, 12 Feb 2011 13:18:24 +0000 (05:18 -0800)
src/tanks/inventory/equipslot.cjs [new file with mode: 0644]

diff --git a/src/tanks/inventory/equipslot.cjs b/src/tanks/inventory/equipslot.cjs
new file mode 100644 (file)
index 0000000..f54d11e
--- /dev/null
@@ -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');
+    }
+    
+})
+;