Last change
on this file since 394 was 359, checked in by alloc, 5 years ago |
Removed unnecessary try-catch-blocks from commands (command handler catches exceptions anyway and provides more detailed output)
|
File size:
728 bytes
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 |
|
---|
4 | namespace AllocsFixes.CustomCommands {
|
---|
5 | public class EnableRendering : ConsoleCmdAbstract {
|
---|
6 | public override string GetDescription () {
|
---|
7 | return "enable/disable live map rendering";
|
---|
8 | }
|
---|
9 |
|
---|
10 | public override string[] GetCommands () {
|
---|
11 | return new[] {"enablerendering"};
|
---|
12 | }
|
---|
13 |
|
---|
14 | public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
|
---|
15 | if (_params.Count != 1) {
|
---|
16 | SdtdConsole.Instance.Output ("Current state: " + MapRendering.MapRendering.renderingEnabled);
|
---|
17 | return;
|
---|
18 | }
|
---|
19 |
|
---|
20 | MapRendering.MapRendering.renderingEnabled = _params [0].Equals ("1");
|
---|
21 | SdtdConsole.Instance.Output ("Set live map rendering to " + _params [0].Equals ("1"));
|
---|
22 | }
|
---|
23 | }
|
---|
24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.