Last change
on this file since 509 was 509, checked in by alloc, 19 hours ago |
Initial commit for FiniteItemRepairs mod
|
File size:
986 bytes
|
Line | |
---|
1 | using System.Collections.Generic;
|
---|
2 | using JetBrains.Annotations;
|
---|
3 |
|
---|
4 | namespace FiniteItemRepairs {
|
---|
5 | [UsedImplicitly]
|
---|
6 | public class ConsoleCmdDegradationPercent : ConsoleCmdAbstract {
|
---|
7 | public override string[] getCommands () {
|
---|
8 | return new[] { "degradationpercent", "degperc" };
|
---|
9 | }
|
---|
10 |
|
---|
11 | public override bool IsExecuteOnClient => true;
|
---|
12 | public override bool AllowedInMainMenu => true;
|
---|
13 |
|
---|
14 | public override void Execute (List<string> parms, CommandSenderInfo senderInfo) {
|
---|
15 | if (parms.Count == 0)
|
---|
16 | {
|
---|
17 | SdtdConsole.Instance.Output($"Current DegradationPercentage: {Settings.Data.DegradationPercent:P0} (== {Settings.Data.DegradationPercent})");
|
---|
18 | return;
|
---|
19 | }
|
---|
20 |
|
---|
21 | if (!StringParsers.TryParseFloat(parms[0], out float value))
|
---|
22 | {
|
---|
23 | SdtdConsole.Instance.Output("Can not parse input value as float");
|
---|
24 | return;
|
---|
25 | }
|
---|
26 |
|
---|
27 | Settings.Data.DegradationPercent = value;
|
---|
28 | }
|
---|
29 |
|
---|
30 | public override string getDescription () {
|
---|
31 | return "Get / set the degradation percentage per item repair";
|
---|
32 | }
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.