Fix IDE0042

This commit is contained in:
RoosterDragon
2023-02-19 12:17:36 +00:00
committed by Gustas
parent 5b70d344cc
commit 555aac3f64
12 changed files with 43 additions and 44 deletions

View File

@@ -101,12 +101,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
for (var i = 0; i < numTabs; i++)
{
var type = visiblePanels[i];
var info = panels[type];
var (panel, label, setup) = panels[type];
var tabButton = tabContainer?.Get<ButtonWidget>($"BUTTON{i + 1}");
if (tabButton != null)
{
tabButton.Text = modData.Translation.GetString(info.Label);
tabButton.Text = modData.Translation.GetString(label);
tabButton.OnClick = () =>
{
if (activePanel == IngameInfoPanel.Chat)
@@ -117,9 +117,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
tabButton.IsHighlighted = () => activePanel == type;
}
var panelContainer = widget.Get<ContainerWidget>(info.Panel);
var panelContainer = widget.Get<ContainerWidget>(panel);
panelContainer.IsVisible = () => activePanel == type;
info.Setup(tabButton, panelContainer);
setup(tabButton, panelContainer);
if (activePanel == IngameInfoPanel.AutoSelect)
activePanel = type;

View File

@@ -228,9 +228,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
flag.GetImageCollection = () => "flags";
flag.GetImageName = () => factionId;
var tooltip = SplitOnFirstToken(faction.Description);
item.GetTooltipText = () => tooltip.First;
item.GetTooltipDesc = () => tooltip.Second;
var (text, desc) = SplitOnFirstToken(faction.Description);
item.GetTooltipText = () => text;
item.GetTooltipDesc = () => desc;
return item;
}
@@ -566,9 +566,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
dropdown.IsDisabled = () => s.LockFaction || orderManager.LocalClient.IsReady;
dropdown.OnMouseDown = _ => ShowFactionDropDown(dropdown, c, orderManager, factions);
var tooltip = SplitOnFirstToken(factions[c.Faction].Description);
dropdown.GetTooltipText = () => tooltip.First;
dropdown.GetTooltipDesc = () => tooltip.Second;
var (text, desc) = SplitOnFirstToken(factions[c.Faction].Description);
dropdown.GetTooltipText = () => text;
dropdown.GetTooltipDesc = () => desc;
SetupFactionWidget(dropdown, c, factions);
}

View File

@@ -69,10 +69,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var template = sysInfoData.Get<LabelWidget>("DATA_TEMPLATE");
sysInfoData.RemoveChildren();
foreach (var info in GetSystemInformation().Values)
foreach (var (name, value) in GetSystemInformation().Values)
{
var label = template.Clone() as LabelWidget;
var text = info.Label + ": " + info.Value;
var text = name + ": " + value;
label.GetText = () => text;
sysInfoData.AddChild(label);
}