Changeset 488 for binary-improvements/MapRendering/API
- Timestamp:
- Jun 21, 2024, 2:58:18 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/API/GetPlayerInventory.cs
r455 r488 94 94 _writer.WriteBeginObject (); 95 95 96 AddEquipment (ref _writer, "head", _equ, EquipmentSlots.Headgear, _showIconColor, _showIconName); 97 _writer.WriteValueSeparator (); 98 AddEquipment (ref _writer, "eyes", _equ, EquipmentSlots.Eyewear, _showIconColor, _showIconName); 99 _writer.WriteValueSeparator (); 100 AddEquipment (ref _writer, "face", _equ, EquipmentSlots.Face, _showIconColor, _showIconName); 96 AddEquipment (ref _writer, "head", _equ, EquipmentSlots.Head, _showIconColor, _showIconName); 101 97 _writer.WriteValueSeparator (); 102 98 103 AddEquipment (ref _writer, "armor", _equ, EquipmentSlots.ChestArmor, _showIconColor, _showIconName); 104 _writer.WriteValueSeparator (); 105 AddEquipment (ref _writer, "jacket", _equ, EquipmentSlots.Jacket, _showIconColor, _showIconName); 106 _writer.WriteValueSeparator (); 107 AddEquipment (ref _writer, "shirt", _equ, EquipmentSlots.Shirt, _showIconColor, _showIconName); 99 AddEquipment (ref _writer, "armor", _equ, EquipmentSlots.Chest, _showIconColor, _showIconName); 108 100 _writer.WriteValueSeparator (); 109 101 110 AddEquipment (ref _writer, "legarmor", _equ, EquipmentSlots.LegArmor, _showIconColor, _showIconName);111 _writer.WriteValueSeparator ();112 AddEquipment (ref _writer, "pants", _equ, EquipmentSlots.Legs, _showIconColor, _showIconName);113 _writer.WriteValueSeparator ();114 102 AddEquipment (ref _writer, "boots", _equ, EquipmentSlots.Feet, _showIconColor, _showIconName); 115 103 _writer.WriteValueSeparator (); … … 123 111 _writer.WritePropertyName (_slotname); 124 112 125 int [] slotindices = XUiM_PlayerEquipment.GetSlotIndicesByEquipmentSlot (_slot);113 int slotindex = (int)_slot; 126 114 127 for (int i = 0; i < slotindices.Length; i++) { 128 if (_items? [slotindices [i]] != null) { 129 InvItem item = _items [slotindices [i]]; 130 131 GetJsonForItem (ref _writer, item, _showIconColor, _showIconName); 132 return; 133 } 115 if (_items == null || _items[slotindex] == null) { 116 // Slot not found / empty 117 _writer.WriteNull (); 118 return; 134 119 } 135 136 // Slot not found / empty137 _writer.WriteNull ();120 121 InvItem item = _items [slotindex]; 122 GetJsonForItem (ref _writer, item, _showIconColor, _showIconName); 138 123 } 139 124
Note:
See TracChangeset
for help on using the changeset viewer.