From a11ffe4a058b42056e403d9f754f5c0a7ad044c7 Mon Sep 17 00:00:00 2001 From: dsc Date: Sat, 12 Feb 2011 05:18:24 -0800 Subject: [PATCH] Equipslots now work. --- src/tanks/inventory/equipslot.cjs | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) create mode 100644 src/tanks/inventory/equipslot.cjs 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'); + } + +}) +; -- 1.7.0.4