Changed code to use object initializers everywhere

This commit is contained in:
penev92
2022-01-20 01:07:24 +02:00
committed by abcdefg30
parent 70e2769a85
commit ab09ce21b4
9 changed files with 58 additions and 31 deletions

View File

@@ -107,8 +107,11 @@ namespace OpenRA.Mods.Common.Widgets
panel = p;
// Mask to prevent any clicks from being sent to other widgets
fullscreenMask = new MaskWidget();
fullscreenMask.Bounds = new Rectangle(0, 0, Game.Renderer.Resolution.Width, Game.Renderer.Resolution.Height);
fullscreenMask = new MaskWidget
{
Bounds = new Rectangle(0, 0, Game.Renderer.Resolution.Width, Game.Renderer.Resolution.Height)
};
fullscreenMask.OnMouseDown += mi => { Game.Sound.PlayNotification(ModRules, null, "Sounds", ClickSound, null); RemovePanel(); };
if (onCancel != null)
fullscreenMask.OnMouseDown += _ => onCancel();