Replace F extension with string interpolation

This commit is contained in:
teinarss
2021-04-24 17:46:24 +02:00
committed by reaperrr
parent 1385aca783
commit 10676be377
300 changed files with 752 additions and 799 deletions

View File

@@ -79,7 +79,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var displaySelectionDropDown = panel.Get<DropDownButtonWidget>("DISPLAY_SELECTION_DROPDOWN");
displaySelectionDropDown.OnMouseDown = _ => ShowDisplaySelectionDropdown(displaySelectionDropDown, ds);
var displaySelectionLabel = new CachedTransform<int, string>(i => "Display {0}".F(i + 1));
var displaySelectionLabel = new CachedTransform<int, string>(i => $"Display {i + 1}");
displaySelectionDropDown.GetText = () => displaySelectionLabel.Update(ds.VideoDisplay);
displaySelectionDropDown.IsDisabled = () => Game.Renderer.DisplayCount < 2;
@@ -115,7 +115,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
};
var uiScaleDropdown = panel.Get<DropDownButtonWidget>("UI_SCALE_DROPDOWN");
var uiScaleLabel = new CachedTransform<float, string>(s => "{0}%".F((int)(100 * s)));
var uiScaleLabel = new CachedTransform<float, string>(s => $"{(int)(100 * s)}%");
uiScaleDropdown.OnMouseDown = _ => ShowUIScaleDropdown(uiScaleDropdown, ds);
uiScaleDropdown.GetText = () => uiScaleLabel.Update(ds.UIScale);
@@ -142,7 +142,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var frameLimitCheckbox = panel.Get<CheckboxWidget>("FRAME_LIMIT_CHECKBOX");
var frameLimitOrigLabel = frameLimitCheckbox.Text;
var frameLimitLabel = new CachedTransform<int, string>(fps => frameLimitOrigLabel + " ({0} FPS)".F(fps));
var frameLimitLabel = new CachedTransform<int, string>(fps => frameLimitOrigLabel + $" ({fps} FPS)");
frameLimitCheckbox.GetText = () => frameLimitLabel.Update(ds.MaxFramerate);
// Player profile
@@ -285,7 +285,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
() => s.VideoDisplay == o,
() => s.VideoDisplay = o);
var label = "Display {0}".F(o + 1);
var label = $"Display {o + 1}";
item.Get<LabelWidget>("LABEL").GetText = () => label;
return item;
};
@@ -421,7 +421,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
});
});
var label = "{0}%".F((int)(100 * o));
var label = $"{(int)(100 * o)}%";
item.Get<LabelWidget>("LABEL").GetText = () => label;
return item;
};