Fix default difficulty not being serialised
This commit is contained in:
@@ -159,12 +159,12 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
var difficulty = lobby.Get<DropDownButtonWidget>("DIFFICULTY_DROPDOWNBUTTON");
|
||||
difficulty.IsVisible = () => Map != null && Map.Difficulties != null && Map.Difficulties.Any();
|
||||
difficulty.IsDisabled = () => !Game.IsHost || gameStarting || orderManager.LocalClient == null || orderManager.LocalClient.IsReady;
|
||||
difficulty.GetText = () => orderManager.LobbyInfo.GlobalSettings.Difficulty ?? "";
|
||||
difficulty.GetText = () => orderManager.LobbyInfo.GlobalSettings.Difficulty;
|
||||
difficulty.OnMouseDown = _ =>
|
||||
{
|
||||
var options = Map.Difficulties.Select(d => new DifficultyDropDownOption
|
||||
{
|
||||
Title = d ?? "",
|
||||
Title = d,
|
||||
IsSelected = () => orderManager.LobbyInfo.GlobalSettings.Difficulty == d,
|
||||
OnClick = () => orderManager.IssueOrder(Order.Command("difficulty {0}".F(d)))
|
||||
});
|
||||
@@ -270,8 +270,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
var title = Ui.Root.Get<LabelWidget>("TITLE");
|
||||
title.Text = orderManager.LobbyInfo.GlobalSettings.ServerName;
|
||||
|
||||
orderManager.LobbyInfo.GlobalSettings.Difficulty = Map.Difficulties != null && Map.Difficulties.Any() ? Map.Difficulties.First() : null;
|
||||
}
|
||||
|
||||
void UpdatePlayerList()
|
||||
|
||||
Reference in New Issue
Block a user