- Timestamp:
- Sep 4, 2018, 2:33:52 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/API/GetPlayerInventory.cs
r325 r326 75 75 76 76 internal static JSONNode GetJsonForItem (InvItem _item) { 77 if (_item != null) { 78 JSONObject jsonItem = new JSONObject (); 79 jsonItem.Add ("count", new JSONNumber (_item.count)); 80 jsonItem.Add ("name", new JSONString (_item.itemName)); 81 jsonItem.Add ("icon", new JSONString (_item.icon)); 82 jsonItem.Add ("iconcolor", new JSONString (_item.iconcolor)); 83 jsonItem.Add ("quality", new JSONNumber (_item.quality)); 84 if (_item.quality >= 0) { 85 jsonItem.Add ("qualitycolor", new JSONString (QualityInfo.GetQualityColorHex (_item.quality))); 86 } 87 88 return jsonItem; 77 if (_item == null) { 78 return new JSONNull (); 89 79 } 90 80 91 return new JSONNull (); 81 JSONObject jsonItem = new JSONObject (); 82 jsonItem.Add ("count", new JSONNumber (_item.count)); 83 jsonItem.Add ("name", new JSONString (_item.itemName)); 84 jsonItem.Add ("icon", new JSONString (_item.icon)); 85 jsonItem.Add ("iconcolor", new JSONString (_item.iconcolor)); 86 jsonItem.Add ("quality", new JSONNumber (_item.quality)); 87 if (_item.quality >= 0) { 88 jsonItem.Add ("qualitycolor", new JSONString (QualityInfo.GetQualityColorHex (_item.quality))); 89 } 90 91 return jsonItem; 92 92 93 } 93 94 }
Note:
See TracChangeset
for help on using the changeset viewer.