Last change
on this file since 405 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
|
Rev | Line | |
---|
[224] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 |
|
---|
[325] | 4 | namespace AllocsFixes.CustomCommands {
|
---|
| 5 | public class EnableRendering : ConsoleCmdAbstract {
|
---|
| 6 | public override string GetDescription () {
|
---|
[224] | 7 | return "enable/disable live map rendering";
|
---|
| 8 | }
|
---|
| 9 |
|
---|
[325] | 10 | public override string[] GetCommands () {
|
---|
| 11 | return new[] {"enablerendering"};
|
---|
[224] | 12 | }
|
---|
| 13 |
|
---|
[325] | 14 | public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
|
---|
[359] | 15 | if (_params.Count != 1) {
|
---|
| 16 | SdtdConsole.Instance.Output ("Current state: " + MapRendering.MapRendering.renderingEnabled);
|
---|
| 17 | return;
|
---|
| 18 | }
|
---|
[224] | 19 |
|
---|
[359] | 20 | MapRendering.MapRendering.renderingEnabled = _params [0].Equals ("1");
|
---|
| 21 | SdtdConsole.Instance.Output ("Set live map rendering to " + _params [0].Equals ("1"));
|
---|
[224] | 22 | }
|
---|
| 23 | }
|
---|
| 24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.