Code cleanup

This commit is contained in:
Matthias Mailänder
2022-05-28 16:09:52 +02:00
committed by teinarss
parent 10ac07bf9f
commit 2c8c6e50da
20 changed files with 42 additions and 35 deletions

View File

@@ -212,7 +212,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
slotsButton.IsVisible = () => panel != PanelType.Servers;
slotsButton.IsDisabled = () => configurationDisabled() || panel != PanelType.Players ||
(orderManager.LobbyInfo.Slots.Values.All(s => !s.AllowBots) &&
orderManager.LobbyInfo.Slots.Count(s => !s.Value.LockTeam && orderManager.LobbyInfo.ClientInSlot(s.Key) != null) == 0);
!orderManager.LobbyInfo.Slots.Any(s => !s.Value.LockTeam && orderManager.LobbyInfo.ClientInSlot(s.Key) != null));
slotsButton.OnMouseDown = _ =>
{
@@ -269,7 +269,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
Title = $"{d} Teams",
IsSelected = () => false,
OnClick = () => orderManager.IssueOrder(Order.Command($"assignteams {d.ToString()}"))
OnClick = () => orderManager.IssueOrder(Order.Command($"assignteams {d}"))
}).ToList();
if (orderManager.LobbyInfo.Slots.Any(s => s.Value.AllowBots))

View File

@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
"Slot", new List<SlotDropDownOption>
{
new SlotDropDownOption("Open", "slot_open " + slot.PlayerReference, () => (!slot.Closed && client == null)),
new SlotDropDownOption("Open", "slot_open " + slot.PlayerReference, () => !slot.Closed && client == null),
new SlotDropDownOption("Closed", "slot_close " + slot.PlayerReference, () => slot.Closed)
}
}

View File

@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
[ObjectCreator.UseCtor]
public SpawnSelectorTooltipLogic(Widget widget, TooltipContainerWidget tooltipContainer, MapPreviewWidget preview, bool showUnoccupiedSpawnpoints)
{
bool showTooltip = true;
var showTooltip = true;
widget.IsVisible = () => preview.TooltipSpawnIndex != -1 && showTooltip;
var label = widget.Get<LabelWidget>("LABEL");
var flag = widget.Get<ImageWidget>("FLAG");