Changeset 359 for binary-improvements/AllocsCommands/Commands/ListItems.cs
- Timestamp:
- Oct 29, 2019, 11:20:45 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/AllocsCommands/Commands/ListItems.cs
r325 r359 22 22 23 23 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) { 24 try { 25 if (_params.Count != 1 || _params [0].Length == 0) { 26 SdtdConsole.Instance.Output ("Usage: listitems <searchString>"); 27 return; 24 if (_params.Count != 1 || _params [0].Length == 0) { 25 SdtdConsole.Instance.Output ("Usage: listitems <searchString>"); 26 return; 27 } 28 29 int count = ItemClass.ItemNames.Count; 30 bool showAll = _params [0].Trim ().Equals ("*"); 31 32 int listed = 0; 33 for (int i = 0; i < count; i++) { 34 string s = ItemClass.ItemNames [i]; 35 if (showAll || s.IndexOf (_params [0], StringComparison.OrdinalIgnoreCase) >= 0) { 36 SdtdConsole.Instance.Output (" " + s); 37 listed++; 28 38 } 39 } 29 40 30 int count = ItemClass.ItemNames.Count; 31 bool showAll = _params [0].Trim ().Equals ("*"); 32 33 int listed = 0; 34 for (int i = 0; i < count; i++) { 35 string s = ItemClass.ItemNames [i]; 36 if (showAll || s.IndexOf (_params [0], StringComparison.OrdinalIgnoreCase) >= 0) { 37 SdtdConsole.Instance.Output (" " + s); 38 listed++; 39 } 40 } 41 42 SdtdConsole.Instance.Output ("Listed " + listed + " matching items."); 43 } catch (Exception e) { 44 Log.Out ("Error in ListItems.Run: " + e); 45 } 41 SdtdConsole.Instance.Output ("Listed " + listed + " matching items."); 46 42 } 47 43 }
Note:
See TracChangeset
for help on using the changeset viewer.