source: binary-improvements/7dtd-server-fixes/src/CustomCommands/EnableRendering.cs@ 212

Last change on this file since 212 was 141, checked in by alloc, 10 years ago

Fixes: missing source file

File size: 880 bytes
RevLine 
[141]1using System;
2using System.Collections.Generic;
3
4namespace AllocsFixes.CustomCommands
5{
6 public class EnableRendering : ConsoleCommand
7 {
8 public EnableRendering (ConsoleSdtd cons) : base(cons)
9 {
10 }
11
12 public override string Description ()
13 {
14 return "enable/disable live map rendering";
15 }
16
17 public override string[] Names ()
18 {
19 return new string[] { "enablerendering", string.Empty };
20 }
21
22 public override void Run (string[] _params)
23 {
24 try {
25 if (_params.Length != 1) {
26 m_Console.SendResult ("Current state: " + AllocsFixes.MapRendering.MapRendering.renderingEnabled);
27 return;
28 }
29
30 AllocsFixes.MapRendering.MapRendering.renderingEnabled = _params[0].Equals("1");
31 m_Console.SendResult ("Set live map rendering to " + _params [0].Equals ("1"));
32 } catch (Exception e) {
33 Log.Out ("Error in EnableRendering.Run: " + e);
34 }
35 }
36 }
37}
Note: See TracBrowser for help on using the repository browser.