Use var everywhere
This commit is contained in:
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
|
||||
menu.Get<LabelWidget>("VERSION_LABEL").Text = Game.modData.Manifest.Mod.Version;
|
||||
|
||||
bool hideButtons = false;
|
||||
var hideButtons = false;
|
||||
menu.Get("MENU_BUTTONS").IsVisible = () => !hideButtons;
|
||||
|
||||
// TODO: Create a mechanism to do things like this cleaner. Also needed for scripted missions
|
||||
@@ -94,7 +94,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
|
||||
// Menu panels - ordered from lowest to highest priority
|
||||
var panelParent = Game.OpenWindow(world, "INGAME_MENU_PANEL");
|
||||
PanelType panelType = PanelType.Objectives;
|
||||
var panelType = PanelType.Objectives;
|
||||
var visibleButtons = 0;
|
||||
|
||||
// Debug / Cheats panel
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
public void Update(IEnumerable<ProductionQueue> allQueues)
|
||||
{
|
||||
var queues = allQueues.Where(q => q.Info.Group == Group).ToList();
|
||||
List<ProductionTab> tabs = new List<ProductionTab>();
|
||||
var tabs = new List<ProductionTab>();
|
||||
|
||||
// Remove stale queues
|
||||
foreach (var t in Tabs)
|
||||
@@ -165,7 +165,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
// Draw tab buttons
|
||||
Game.Renderer.EnableScissor(new Rectangle(leftButtonRect.Right, rb.Y + 1, rightButtonRect.Left - leftButtonRect.Right - 1, rb.Height));
|
||||
var origin = new int2(leftButtonRect.Right - 1 + (int)listOffset, leftButtonRect.Y);
|
||||
SpriteFont font = Game.Renderer.Fonts["TinyBold"];
|
||||
var font = Game.Renderer.Fonts["TinyBold"];
|
||||
contentWidth = 0;
|
||||
|
||||
foreach (var tab in Groups[queueGroup].Tabs)
|
||||
@@ -176,8 +176,8 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
ButtonWidget.DrawBackground(baseName, rect, false, false, hover, false);
|
||||
contentWidth += TabWidth - 1;
|
||||
|
||||
int2 textSize = font.Measure(tab.Name);
|
||||
int2 position = new int2(rect.X + (rect.Width - textSize.X) / 2, rect.Y + (rect.Height - textSize.Y) / 2);
|
||||
var textSize = font.Measure(tab.Name);
|
||||
var position = new int2(rect.X + (rect.Width - textSize.X) / 2, rect.Y + (rect.Height - textSize.Y) / 2);
|
||||
font.DrawTextWithContrast(tab.Name, position, tab.Queue.CurrentDone ? Color.Gold : Color.White, Color.Black, 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user