Client LuaCsForBarotrauma
Editable.cs
1 using System;
2 
3 namespace Barotrauma;
4 
5 [AttributeUsage(AttributeTargets.Property)]
6 class Editable : Attribute
7 {
11  public int MaxLength = -1;
12  public int DecimalCount = 1;
13 
14  public int MinValueInt = int.MinValue, MaxValueInt = int.MaxValue;
15  public float MinValueFloat = float.MinValue, MaxValueFloat = float.MaxValue;
17  public float ValueStep;
18 
23  public bool TransferToSwappedItem;
24 
28  public string[] VectorComponentLabels;
29 
33  public string FallBackTextTag;
34 
38  public bool ReadOnly;
39 
40  public Editable()
41  {
42  }
43 
44  public Editable(int minValue, int maxValue)
45  {
46  MinValueInt = minValue;
47  MaxValueInt = maxValue;
48  }
49 
50  public Editable(float minValue, float maxValue, int decimals = 1)
51  {
52  MinValueFloat = minValue;
53  MaxValueFloat = maxValue;
54  DecimalCount = decimals;
55  }
56 }
57 
58 [AttributeUsage(AttributeTargets.Property)]
59 sealed class InGameEditable : Editable
60 {
61 }
62 
int DecimalCount
Definition: Editable.cs:12
float ValueStep
Definition: Editable.cs:17
bool ForceShowPlusMinusButtons
Definition: Editable.cs:16
Editable()
Definition: Editable.cs:40
string[] VectorComponentLabels
Labels of the components of a vector property (defaults to x,y,z,w)
Definition: Editable.cs:28
Editable(int minValue, int maxValue)
Definition: Editable.cs:44
int MaxLength
Maximum length of the value if the value is a string. Only has an effect is larger than 0.
Definition: Editable.cs:11
bool ReadOnly
Currently implemented only for int and bool fields. TODO: implement the remaining types (Serializable...
Definition: Editable.cs:38
Editable(float minValue, float maxValue, int decimals=1)
Definition: Editable.cs:50
float MinValueFloat
Definition: Editable.cs:15
int MinValueInt
Definition: Editable.cs:14
bool TransferToSwappedItem
Should the value customized in the editor be applied to the new item swapped in place of this item....
Definition: Editable.cs:23
string FallBackTextTag
If a translation can't be found for the property name, this tag is used instead
Definition: Editable.cs:33