Ignore:
Timestamp:
Dec 12, 2015, 4:08:53 PM (9 years ago)
Author:
alloc
Message:

Fixes 6_8_10

File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/AllocsCommands/Commands/ShowInventory.cs

    r250 r253  
    66{
    77        public class ShowInventory : ConsoleCmdAbstract {
     8
    89                public override string GetDescription () {
    910                        return "list inventory of a given player";
     
    6970
    7071                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);
    7475
    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);
    7879
    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);
    8283
    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);
    8585                }
    8686
    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;
    94100                                }
    95                                 DoParts (_items [index].parts, 1);
    96101                        }
    97102                }
Note: See TracChangeset for help on using the changeset viewer.