(8b6b6ed4c) Added indication to server preview window if server has VOIP enabled

This commit is contained in:
Joonas Rikkonen
2019-04-23 11:17:55 +03:00
parent b48a854828
commit b6d854fc94
4 changed files with 15 additions and 3 deletions
@@ -25,6 +25,7 @@ namespace Barotrauma.Networking
public SelectionMode? ModeSelectionMode; public SelectionMode? ModeSelectionMode;
public SelectionMode? SubSelectionMode; public SelectionMode? SubSelectionMode;
public bool? AllowSpectating; public bool? AllowSpectating;
public bool? VoipEnabled;
public bool? AllowRespawn; public bool? AllowRespawn;
public YesNoMaybe? TraitorsEnabled; public YesNoMaybe? TraitorsEnabled;
public string GameMode; public string GameMode;
@@ -150,11 +151,14 @@ namespace Barotrauma.Networking
else else
allowRespawn.Selected = AllowRespawn.Value; allowRespawn.Selected = AllowRespawn.Value;
/*new GUITickBox(new RectTransform(new Vector2(1.0f, elementHeight), columnRight.RectTransform), TextManager.Get("ServerListHasPassword")) var voipEnabledTickBox = new GUITickBox(new RectTransform(new Vector2(1.0f, elementHeight), columnRight.RectTransform), TextManager.Get("serversettingsvoicechatenabled"))
{ {
Selected = HasPassword,
CanBeFocused = false CanBeFocused = false
};*/ };
if (!VoipEnabled.HasValue)
new GUITextBlock(new RectTransform(new Vector2(0.8f, 0.8f), voipEnabledTickBox.Box.RectTransform, Anchor.Center), "?", textAlignment: Alignment.Center);
else
voipEnabledTickBox.Selected = VoipEnabled.Value;
var usingWhiteList = new GUITickBox(new RectTransform(new Vector2(1, elementHeight), columnRight.RectTransform), TextManager.Get("ServerListUsingWhitelist")) var usingWhiteList = new GUITickBox(new RectTransform(new Vector2(1, elementHeight), columnRight.RectTransform), TextManager.Get("ServerListUsingWhitelist"))
{ {
@@ -214,6 +214,7 @@ namespace Barotrauma.Steam
} }
if (s.Rules.ContainsKey("allowspectating")) serverInfo.AllowSpectating = s.Rules["allowspectating"] == "True"; if (s.Rules.ContainsKey("allowspectating")) serverInfo.AllowSpectating = s.Rules["allowspectating"] == "True";
if (s.Rules.ContainsKey("allowrespawn")) serverInfo.AllowRespawn = s.Rules["allowrespawn"] == "True"; if (s.Rules.ContainsKey("allowrespawn")) serverInfo.AllowRespawn = s.Rules["allowrespawn"] == "True";
if (s.Rules.ContainsKey("voicechatenabled")) serverInfo.VoipEnabled = s.Rules["voicechatenabled"] == "True";
if (s.Rules.ContainsKey("traitors")) if (s.Rules.ContainsKey("traitors"))
{ {
if (Enum.TryParse(s.Rules["traitors"], out YesNoMaybe traitorsEnabled)) serverInfo.TraitorsEnabled = traitorsEnabled; if (Enum.TryParse(s.Rules["traitors"], out YesNoMaybe traitorsEnabled)) serverInfo.TraitorsEnabled = traitorsEnabled;
@@ -377,6 +377,12 @@ namespace Barotrauma.Networking
private set; private set;
} }
[Serialize(true, true)]
public bool VoipEnabled {
get;
private set;
}
[Serialize(true, true)] [Serialize(true, true)]
public bool EndRoundAtLevelEnd public bool EndRoundAtLevelEnd
{ {
@@ -14,6 +14,7 @@
minrespawnratio="0.2" minrespawnratio="0.2"
autorestartinterval="60" autorestartinterval="60"
allowspectating="True" allowspectating="True"
voicechatenabled="True"
endroundatlevelend="True" endroundatlevelend="True"
saveserverlogs="True" saveserverlogs="True"
allowragdollbutton="True" allowragdollbutton="True"