Unstable 0.1400.0.0

This commit is contained in:
Markus Isberg
2021-05-11 15:47:47 +03:00
parent 3f324b14e8
commit 92f0264af2
247 changed files with 8238 additions and 1911 deletions
@@ -8,6 +8,7 @@ using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Xml.Linq;
using Barotrauma.Networking;
namespace Barotrauma
{
@@ -32,7 +33,7 @@ namespace Barotrauma
public string FallBackTextTag;
/// <summary>
/// Currently implemented only for int fields. TODO: implement the remaining types (SerializableEntityEditor)
/// Currently implemented only for int and bool fields. TODO: implement the remaining types (SerializableEntityEditor)
/// </summary>
public bool ReadOnly;
@@ -60,6 +61,34 @@ namespace Barotrauma
{
}
[AttributeUsage(AttributeTargets.Property)]
class ConditionallyEditable : Editable
{
public ConditionallyEditable(ConditionType conditionType)
{
this.conditionType = conditionType;
}
private ConditionType conditionType;
public enum ConditionType
{
//These need to exist at compile time, so it is a little awkward
//I would love to see a better way to do this
AllowLinkingWifiToChat
}
public bool IsEditable()
{
switch (conditionType)
{
case ConditionType.AllowLinkingWifiToChat:
return GameMain.NetworkMember?.ServerSettings?.AllowLinkingWifiToChat ?? true;
}
return false;
}
}
[AttributeUsage(AttributeTargets.Property)]
public class Serialize : Attribute