Clients can be given a permission to select the sub or the game mode

This commit is contained in:
Joonas Rikkonen
2017-09-24 17:11:10 +03:00
parent 04b0c63f30
commit 5eb1544f1e
5 changed files with 104 additions and 12 deletions
@@ -14,7 +14,8 @@ namespace Barotrauma
{
if (value == allowSubVoting) return;
allowSubVoting = value;
GameMain.NetLobbyScreen.SubList.Enabled = value || GameMain.Server != null;
GameMain.NetLobbyScreen.SubList.Enabled = value || GameMain.Server != null ||
(GameMain.Client != null && GameMain.Client.HasPermission(ClientPermissions.SelectSub));
GameMain.NetLobbyScreen.InfoFrame.FindChild("subvotes", true).Visible = value;
if (GameMain.Server != null)
@@ -36,7 +37,10 @@ namespace Barotrauma
{
if (value == allowModeVoting) return;
allowModeVoting = value;
GameMain.NetLobbyScreen.ModeList.Enabled = value || GameMain.Server != null;
GameMain.NetLobbyScreen.ModeList.Enabled =
value || GameMain.Server != null ||
(GameMain.Client != null && GameMain.Client.HasPermission(ClientPermissions.SelectMode));
GameMain.NetLobbyScreen.InfoFrame.FindChild("modevotes", true).Visible = value;
//gray out modes that can't be voted