- Timestamp:
- Dec 12, 2015, 4:08:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/AllocsCommands/Commands/ShowInventory.cs
r250 r253 6 6 { 7 7 public class ShowInventory : ConsoleCmdAbstract { 8 8 9 public override string GetDescription () { 9 10 return "list inventory of a given player"; … … 69 70 70 71 private void PrintEquipment (InvItem[] _equipment) { 71 AddEquipment ("head", _equipment, XMLData.Item.EnumEquipmentSlot.Head, NGuiInvGridEquipment.EnumClothingLayer.Middle);72 AddEquipment ("eyes", _equipment, XMLData.Item.EnumEquipmentSlot.Eyes, NGuiInvGridEquipment.EnumClothingLayer.Middle);73 AddEquipment ("face", _equipment, XMLData.Item.EnumEquipmentSlot.Face, NGuiInvGridEquipment.EnumClothingLayer.Middle);72 AddEquipment ("head", _equipment, EquipmentSlots.Headgear); 73 AddEquipment ("eyes", _equipment, EquipmentSlots.Eyewear); 74 AddEquipment ("face", _equipment, EquipmentSlots.Face); 74 75 75 AddEquipment ("armor", _equipment, XMLData.Item.EnumEquipmentSlot.Chest, NGuiInvGridEquipment.EnumClothingLayer.Outer);76 AddEquipment ("jacket", _equipment, XMLData.Item.EnumEquipmentSlot.Chest, NGuiInvGridEquipment.EnumClothingLayer.Middle);77 AddEquipment ("shirt", _equipment, XMLData.Item.EnumEquipmentSlot.Chest, NGuiInvGridEquipment.EnumClothingLayer.Inner);76 AddEquipment ("armor", _equipment, EquipmentSlots.ChestArmor); 77 AddEquipment ("jacket", _equipment, EquipmentSlots.Jacket); 78 AddEquipment ("shirt", _equipment, EquipmentSlots.Shirt); 78 79 79 AddEquipment ("legarmor", _equipment, XMLData.Item.EnumEquipmentSlot.Legs, NGuiInvGridEquipment.EnumClothingLayer.Outer);80 AddEquipment ("pants", _equipment, XMLData.Item.EnumEquipmentSlot.Legs, NGuiInvGridEquipment.EnumClothingLayer.Inner);81 AddEquipment ("boots", _equipment, XMLData.Item.EnumEquipmentSlot.Feet, NGuiInvGridEquipment.EnumClothingLayer.Inner);80 AddEquipment ("legarmor", _equipment, EquipmentSlots.LegArmor); 81 AddEquipment ("pants", _equipment, EquipmentSlots.Legs); 82 AddEquipment ("boots", _equipment, EquipmentSlots.Feet); 82 83 83 AddEquipment ("gloves", _equipment, XMLData.Item.EnumEquipmentSlot.Hands, NGuiInvGridEquipment.EnumClothingLayer.Inner); 84 AddEquipment ("backpack", _equipment, XMLData.Item.EnumEquipmentSlot.Back, NGuiInvGridEquipment.EnumClothingLayer.Outer); 84 AddEquipment ("gloves", _equipment, EquipmentSlots.Hands); 85 85 } 86 86 87 private void AddEquipment (string _slotname, InvItem[] _items, XMLData.Item.EnumEquipmentSlot _slot, NGuiInvGridEquipment.EnumClothingLayer _layer) { 88 int index = (int)_slot + (int)_layer * (int)XMLData.Item.EnumEquipmentSlot.Count; 89 if (_items != null && _items [index] != null) { 90 if (_items [index].quality < 0) { 91 SdtdConsole.Instance.Output (string.Format (" Slot {0:8}: {1:000}", _slotname, _items [index].itemName)); 92 } else { 93 SdtdConsole.Instance.Output (string.Format (" Slot {0:8}: {1:000} - quality: {2}", _slotname, _items [index].itemName, _items [index].quality)); 87 private void AddEquipment (string _slotname, InvItem[] _items, EquipmentSlots _slot) { 88 int[] slotindices = XUiM_PlayerEquipment.GetSlotIndicesByEquipmentSlot (_slot); 89 90 for (int i = 0; i < slotindices.Length; i++) { 91 if (_items != null && _items [slotindices [i]] != null) { 92 InvItem item = _items [slotindices [i]]; 93 if (item.quality < 0) { 94 SdtdConsole.Instance.Output (string.Format (" Slot {0:8}: {1:000}", _slotname, item.itemName)); 95 } else { 96 SdtdConsole.Instance.Output (string.Format (" Slot {0:8}: {1:000} - quality: {2}", _slotname, item.itemName, item.quality)); 97 } 98 DoParts (_items [slotindices [i]].parts, 1); 99 return; 94 100 } 95 DoParts (_items [index].parts, 1);96 101 } 97 102 }
Note:
See TracChangeset
for help on using the changeset viewer.