source: binary-improvements/MapRendering/Commands/EnableRendering.cs@ 232

Last change on this file since 232 was 230, checked in by alloc, 10 years ago

Binary improvements

File size: 865 bytes
Line 
1using System;
2using System.Collections.Generic;
3
4namespace AllocsFixes.CustomCommands
5{
6 public class EnableRendering : ConsoleCmdAbstract
7 {
8 public override string GetDescription ()
9 {
10 return "enable/disable live map rendering";
11 }
12
13 public override string[] GetCommands ()
14 {
15 return new string[] { "enablerendering" };
16 }
17
18 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo)
19 {
20 try {
21 if (_params.Count != 1) {
22 SdtdConsole.Instance.Output ("Current state: " + AllocsFixes.MapRendering.MapRendering.renderingEnabled);
23 return;
24 }
25
26 AllocsFixes.MapRendering.MapRendering.renderingEnabled = _params[0].Equals("1");
27 SdtdConsole.Instance.Output ("Set live map rendering to " + _params [0].Equals ("1"));
28 } catch (Exception e) {
29 Log.Out ("Error in EnableRendering.Run: " + e);
30 }
31 }
32 }
33}
Note: See TracBrowser for help on using the repository browser.