#540 move 'allow cheats' to lobby from prelobby
This commit is contained in:
@@ -226,6 +226,19 @@ namespace OpenRA.Mods.RA.Server
|
||||
server.SyncLobbyInfo();
|
||||
return true;
|
||||
}},
|
||||
{ "allowcheats",
|
||||
s =>
|
||||
{
|
||||
if (conn.PlayerIndex != 0)
|
||||
{
|
||||
server.SendChatTo( conn, "Only the host can set that option" );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool.TryParse(s, out server.lobbyInfo.GlobalSettings.AllowCheats);
|
||||
server.SyncLobbyInfo();
|
||||
return true;
|
||||
}},
|
||||
{ "kick",
|
||||
s =>
|
||||
{
|
||||
|
||||
@@ -43,8 +43,6 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
||||
cs.GetWidget<TextFieldWidget>("EXTERNAL_PORT").Text = settings.Server.ExternalPort.ToString();
|
||||
cs.GetWidget<CheckboxWidget>("CHECKBOX_ONLINE").Bind(settings.Server, "AdvertiseOnline");
|
||||
cs.GetWidget<CheckboxWidget>("CHECKBOX_ONLINE").OnChange += _ => settings.Save();
|
||||
cs.GetWidget<CheckboxWidget>("CHECKBOX_CHEATS").Bind(settings.Server, "AllowCheats");
|
||||
cs.GetWidget<CheckboxWidget>("CHECKBOX_CHEATS").OnChange += _ => settings.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
||||
var lobby = Game.OpenWindow(orderManager.world, "SERVER_LOBBY");
|
||||
lobby.GetWidget<ChatDisplayWidget>("CHAT_DISPLAY").ClearChat();
|
||||
lobby.GetWidget("CHANGEMAP_BUTTON").Visible = true;
|
||||
lobby.GetWidget("LOCKTEAMS_CHECKBOX").Visible = true;
|
||||
lobby.GetWidget("LOCKTEAMS_CHECKBOX").Visible = true;
|
||||
lobby.GetWidget("ALLOWCHEATS_CHECKBOX").Visible = true;
|
||||
lobby.GetWidget("DISCONNECT_BUTTON").Visible = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -112,6 +112,15 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
||||
if (Game.IsHost)
|
||||
orderManager.IssueOrder(Order.Command(
|
||||
"lockteams {0}".F(!orderManager.LobbyInfo.GlobalSettings.LockTeams)));
|
||||
};
|
||||
|
||||
var allowCheats = lobby.GetWidget<CheckboxWidget>("ALLOWCHEATS_CHECKBOX");
|
||||
allowCheats.IsChecked = () => orderManager.LobbyInfo.GlobalSettings.AllowCheats;
|
||||
allowCheats.OnChange += _ =>
|
||||
{
|
||||
if (Game.IsHost)
|
||||
orderManager.IssueOrder(Order.Command(
|
||||
"allowcheats {0}".F(!orderManager.LobbyInfo.GlobalSettings.AllowCheats)));
|
||||
};
|
||||
|
||||
var startGameButton = lobby.GetWidget("START_GAME_BUTTON");
|
||||
|
||||
Reference in New Issue
Block a user