Add readonly where it is missing and fix those field names according to their modifiers (#2589)

This commit is contained in:
DrSmugleaf
2020-11-21 14:02:00 +01:00
committed by GitHub
parent c7f2b67297
commit 749cd11d33
94 changed files with 344 additions and 374 deletions

View File

@@ -1,11 +1,8 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mime;
using Content.Client.GameObjects.Components.Arcade;
using Content.Client.Utility;
using Content.Shared.Arcade;
using Content.Shared.GameObjects.Components.Arcade;
using Content.Shared.Input;
using Robust.Client.Graphics;
using Robust.Client.Graphics.Drawing;
@@ -13,7 +10,6 @@ using Robust.Client.Interfaces.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Input;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Utility;
@@ -22,15 +18,14 @@ namespace Content.Client.Arcade
{
public class BlockGameMenu : SS14Window
{
private static readonly Color OverlayBackgroundColor = new Color(74,74,81,180);
private static readonly Color OverlayShadowColor = new Color(0,0,0,83);
private static Color overlayBackgroundColor = new Color(74,74,81,180);
private static Color overlayShadowColor = new Color(0,0,0,83);
private static readonly Vector2 BlockSize = new Vector2(15,15);
private static Vector2 blockSize = new Vector2(15,15);
private readonly BlockGameBoundUserInterface _owner;
private BlockGameBoundUserInterface _owner;
private PanelContainer _mainPanel;
private readonly PanelContainer _mainPanel;
private VBoxContainer _gameRootContainer;
private GridContainer _gameGrid;
@@ -88,7 +83,7 @@ namespace Content.Client.Arcade
var rootBack = new StyleBoxTexture
{
Texture = backgroundTexture,
Modulate = overlayShadowColor
Modulate = OverlayShadowColor
};
rootBack.SetPatchMargin(StyleBox.Margin.All, 10);
_highscoresRootContainer = new PanelContainer
@@ -98,7 +93,7 @@ namespace Content.Client.Arcade
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
};
var c = new Color(overlayBackgroundColor.R,overlayBackgroundColor.G,overlayBackgroundColor.B,220);
var c = new Color(OverlayBackgroundColor.R,OverlayBackgroundColor.G,OverlayBackgroundColor.B,220);
var innerBack = new StyleBoxTexture
{
Texture = backgroundTexture,
@@ -154,7 +149,7 @@ namespace Content.Client.Arcade
var rootBack = new StyleBoxTexture
{
Texture = backgroundTexture,
Modulate = overlayShadowColor
Modulate = OverlayShadowColor
};
rootBack.SetPatchMargin(StyleBox.Margin.All, 10);
_gameOverRootContainer = new PanelContainer
@@ -167,7 +162,7 @@ namespace Content.Client.Arcade
var innerBack = new StyleBoxTexture
{
Texture = backgroundTexture,
Modulate = overlayBackgroundColor
Modulate = OverlayBackgroundColor
};
innerBack.SetPatchMargin(StyleBox.Margin.All, 10);
var menuInnerPanel = new PanelContainer
@@ -212,7 +207,7 @@ namespace Content.Client.Arcade
var rootBack = new StyleBoxTexture
{
Texture = backgroundTexture,
Modulate = overlayShadowColor
Modulate = OverlayShadowColor
};
rootBack.SetPatchMargin(StyleBox.Margin.All, 10);
_menuRootContainer = new PanelContainer
@@ -225,7 +220,7 @@ namespace Content.Client.Arcade
var innerBack = new StyleBoxTexture
{
Texture = backgroundTexture,
Modulate = overlayBackgroundColor
Modulate = OverlayBackgroundColor
};
innerBack.SetPatchMargin(StyleBox.Margin.All, 10);
var menuInnerPanel = new PanelContainer
@@ -404,7 +399,7 @@ namespace Content.Client.Arcade
var nextBlockPanel = new PanelContainer
{
PanelOverride = previewBack,
CustomMinimumSize = blockSize * 6.5f,
CustomMinimumSize = BlockSize * 6.5f,
SizeFlagsHorizontal = SizeFlags.None,
SizeFlagsVertical = SizeFlags.None
};
@@ -442,7 +437,7 @@ namespace Content.Client.Arcade
var holdBlockPanel = new PanelContainer
{
PanelOverride = previewBack,
CustomMinimumSize = blockSize * 6.5f,
CustomMinimumSize = BlockSize * 6.5f,
SizeFlagsHorizontal = SizeFlags.None,
SizeFlagsVertical = SizeFlags.None
};
@@ -623,7 +618,7 @@ namespace Content.Client.Arcade
_nextBlockGrid.AddChild(new PanelContainer
{
PanelOverride = new StyleBoxFlat {BackgroundColor = c},
CustomMinimumSize = blockSize,
CustomMinimumSize = BlockSize,
RectDrawClipMargin = 0
});
}
@@ -645,7 +640,7 @@ namespace Content.Client.Arcade
_holdBlockGrid.AddChild(new PanelContainer
{
PanelOverride = new StyleBoxFlat {BackgroundColor = c},
CustomMinimumSize = blockSize,
CustomMinimumSize = BlockSize,
RectDrawClipMargin = 0
});
}
@@ -663,7 +658,7 @@ namespace Content.Client.Arcade
_gameGrid.AddChild(new PanelContainer
{
PanelOverride = new StyleBoxFlat {BackgroundColor = c},
CustomMinimumSize = blockSize,
CustomMinimumSize = BlockSize,
RectDrawClipMargin = 0
});
}

View File

@@ -1,5 +1,4 @@
using System.Linq;
using Content.Client.GameObjects.Components.Arcade;
using Content.Client.GameObjects.Components.Arcade;
using Content.Shared.GameObjects.Components.Arcade;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
@@ -13,13 +12,13 @@ namespace Content.Client.Arcade
protected override Vector2? CustomSize => (400, 200);
public SpaceVillainArcadeBoundUserInterface Owner { get; set; }
private Label _enemyNameLabel;
private Label _playerInfoLabel;
private Label _enemyInfoLabel;
private Label _playerActionLabel;
private Label _enemyActionLabel;
private readonly Label _enemyNameLabel;
private readonly Label _playerInfoLabel;
private readonly Label _enemyInfoLabel;
private readonly Label _playerActionLabel;
private readonly Label _enemyActionLabel;
private Button[] _gameButtons = new Button[3]; //used to disable/enable all game buttons
private readonly Button[] _gameButtons = new Button[3]; //used to disable/enable all game buttons
public SpaceVillainArcadeMenu(SpaceVillainArcadeBoundUserInterface owner)
{
Title = Loc.GetString("Space Villain");
@@ -97,8 +96,8 @@ namespace Content.Client.Arcade
private class ActionButton : Button
{
private SpaceVillainArcadeBoundUserInterface _owner;
private SharedSpaceVillainArcadeComponent.PlayerAction _playerAction;
private readonly SpaceVillainArcadeBoundUserInterface _owner;
private readonly SharedSpaceVillainArcadeComponent.PlayerAction _playerAction;
public ActionButton(SpaceVillainArcadeBoundUserInterface owner,SharedSpaceVillainArcadeComponent.PlayerAction playerAction)
{