Fix IDE0200

This commit is contained in:
RoosterDragon
2024-11-25 20:44:40 +00:00
committed by Gustas Kažukauskas
parent ce3ad6fbb3
commit 0338258b45
45 changed files with 64 additions and 64 deletions

View File

@@ -191,7 +191,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
filenameInput = panel.Get<TextFieldWidget>("FILENAME_INPUT");
filenameInput.OnTextEdited = () => ApplyFilter();
filenameInput.OnTextEdited = ApplyFilter;
filenameInput.OnEscKey = _ =>
{
if (string.IsNullOrEmpty(filenameInput.Text))

View File

@@ -265,7 +265,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
slider.GetValue = () => so.GetValue(SelectedActor);
slider.OnChange += value => so.OnChange(SelectedActor, value);
slider.OnChange += value => editorActionHandle.OnChange(value);
slider.OnChange += editorActionHandle.OnChange;
var valueField = sliderContainer.GetOrNull<TextFieldWidget>("VALUE");
if (valueField != null)

View File

@@ -48,9 +48,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
var actionManager = world.WorldActor.Trait<EditorActionManager>();
undoButton.IsDisabled = () => !actionManager.HasUndos();
undoButton.OnClick = () => actionManager.Undo();
undoButton.OnClick = actionManager.Undo;
redoButton.IsDisabled = () => !actionManager.HasRedos();
redoButton.OnClick = () => actionManager.Redo();
redoButton.OnClick = actionManager.Redo;
}
}
}

View File

@@ -110,7 +110,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void CreateCategoryPanel(MapBlitFilters copyFilter, CheckboxWidget checkbox)
{
checkbox.GetText = () => copyFilter.ToString();
checkbox.GetText = copyFilter.ToString;
checkbox.IsChecked = () => selectionFilters.HasFlag(copyFilter);
checkbox.IsVisible = () => true;
checkbox.OnClick = () => selectionFilters ^= copyFilter;

View File

@@ -102,7 +102,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
foreach (var cat in allCategories)
{
var category = categoryTemplate.Clone();
category.GetText = () => cat.ToString();
category.GetText = cat.ToString;
category.IsVisible = () => true;
if (cat.HasFlag(MapOverlays.Grid))

View File

@@ -98,7 +98,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
continue;
var checkbox = visOptionTemplate.Clone();
checkbox.GetText = () => visibilityOption.ToString();
checkbox.GetText = visibilityOption.ToString;
checkbox.IsChecked = () => map.Visibility.HasFlag(visibilityOption);
checkbox.OnClick = () => map.Visibility ^= visibilityOption;
visibilityPanel.AddChild(checkbox);

View File

@@ -118,8 +118,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
saveWidgets.IsVisible = () => true;
saveTextField = saveWidgets.Get<TextFieldWidget>("SAVE_TEXTFIELD");
saveTextField.OnEnterKey = input => saveButton.HandleKeyPress(input);
saveTextField.OnEscKey = input => cancelButton.HandleKeyPress(input);
saveTextField.OnEnterKey = saveButton.HandleKeyPress;
saveTextField.OnEscKey = cancelButton.HandleKeyPress;
}
else
{
@@ -226,7 +226,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
var savePaths = Directory.GetFiles(baseSavePath, "*.orasav", SearchOption.AllDirectories)
.OrderByDescending(p => File.GetLastWriteTime(p))
.OrderByDescending(File.GetLastWriteTime)
.ToList();
foreach (var savePath in savePaths)

View File

@@ -196,8 +196,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
CreateStatsOption(SupportPowers, ObserverStatsPanel.SupportPowers, supportPowersPlayerTemplate, () => DisplayStats(SupportPowerStats)),
CreateStatsOption(Combat, ObserverStatsPanel.Combat, combatPlayerTemplate, () => DisplayStats(CombatStats)),
CreateStatsOption(Army, ObserverStatsPanel.Army, armyPlayerTemplate, () => DisplayStats(ArmyStats)),
CreateStatsOption(EarningsGraph, ObserverStatsPanel.Graph, null, () => IncomeGraph()),
CreateStatsOption(ArmyGraph, ObserverStatsPanel.ArmyGraph, null, () => ArmyValueGraph()),
CreateStatsOption(EarningsGraph, ObserverStatsPanel.Graph, null, IncomeGraph),
CreateStatsOption(ArmyGraph, ObserverStatsPanel.ArmyGraph, null, ArmyValueGraph),
};
ScrollItemWidget SetupItem(StatsDropDownOption option, ScrollItemWidget template)
@@ -352,7 +352,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var armyText = new CachedTransform<int, string>(i => "$" + i.ToString(NumberFormatInfo.CurrentInfo));
template.Get<LabelWidget>("ARMY_VALUE").GetText = () => armyText.Update(stats.ArmyValue);
var visionText = new CachedTransform<int, string>(i => Vision(i));
var visionText = new CachedTransform<int, string>(Vision);
template.Get<LabelWidget>("VISION").GetText = () => player.Shroud.Disabled ? "100%" : visionText.Update(player.Shroud.RevealedCells);
return template;
@@ -520,7 +520,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var experienceText = new CachedTransform<int, string>(i => i.ToString(NumberFormatInfo.CurrentInfo));
template.Get<LabelWidget>("EXPERIENCE").GetText = () => experienceText.Update(stats.Experience);
var actionsText = new CachedTransform<double, string>(d => AverageOrdersPerMinute(d));
var actionsText = new CachedTransform<double, string>(AverageOrdersPerMinute);
template.Get<LabelWidget>("ACTIONS_MIN").GetText = () => actionsText.Update(stats.OrderCount);
return template;

View File

@@ -793,7 +793,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var item = ScrollItemWidget.Setup(template,
() => selectedReplay == replay,
() => SelectReplay(replay),
() => WatchReplay());
WatchReplay);
replayState[replay] = new ReplayState
{

View File

@@ -118,7 +118,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
contexts.UnionWith(hd.Contexts);
filterInput = panel.Get<TextFieldWidget>("FILTER_INPUT");
filterInput.OnTextEdited = () => InitHotkeyList();
filterInput.OnTextEdited = InitHotkeyList;
filterInput.OnEscKey = _ =>
{
if (string.IsNullOrEmpty(filterInput.Text))

View File

@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var mouseScrollDropdown = panel.Get<DropDownButtonWidget>("MOUSE_SCROLL_TYPE_DROPDOWN");
mouseScrollDropdown.OnMouseDown = _ => ShowMouseScrollDropdown(mouseScrollDropdown, gs);
mouseScrollDropdown.GetText = () => gs.MouseScroll.ToString();
mouseScrollDropdown.GetText = gs.MouseScroll.ToString;
var mouseControlDescClassic = panel.Get("MOUSE_CONTROL_DESC_CLASSIC");
mouseControlDescClassic.IsVisible = () => gs.UseClassicMouseStyle;
@@ -113,7 +113,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var zoomModifierDropdown = panel.Get<DropDownButtonWidget>("ZOOM_MODIFIER");
zoomModifierDropdown.OnMouseDown = _ => ShowZoomModifierDropdown(zoomModifierDropdown, gs);
zoomModifierDropdown.GetText = () => gs.ZoomModifier.ToString();
zoomModifierDropdown.GetText = gs.ZoomModifier.ToString;
SettingsUtils.AdjustSettingsScrollPanelLayout(scrollPanel);

View File

@@ -198,7 +198,7 @@ namespace OpenRA.Mods.Common.Widgets
}
case TextFieldType.Integer:
return new string(input.Where(c => char.IsDigit(c)).ToArray());
return new string(input.Where(char.IsDigit).ToArray());
default:
return input;