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

@@ -607,7 +607,7 @@ namespace Content.Client.UserInterface.AdminMenu
GetValueFromData = (obj) => ((GasPrototype) obj).ID.ToString(),
};
private CommandUISpinBox _amount = new CommandUISpinBox
private readonly CommandUISpinBox _amount = new CommandUISpinBox
{
Name = "Amount"
};

View File

@@ -23,7 +23,7 @@ namespace Content.Client.UserInterface.Cargo
public event Action<BaseButton.ButtonEventArgs> OnOrderApproved;
public event Action<BaseButton.ButtonEventArgs> OnOrderCanceled;
private List<string> _categoryStrings = new List<string>();
private readonly List<string> _categoryStrings = new List<string>();
private Label _accountNameLabel { get; set; }
private Label _pointsLabel { get; set; }

View File

@@ -10,7 +10,7 @@ namespace Content.Client.UserInterface.Cargo
{
public class GalacticBankSelectionMenu : SS14Window
{
private ItemList _accounts;
private readonly ItemList _accounts;
private int _accountCount = 0;
private string[] _accountNames = new string[] { };
private int[] _accountIds = new int[] { };

View File

@@ -14,7 +14,7 @@ namespace Content.Client.UserInterface
[Dependency] private readonly IPrototypeManager _protoMan = default!;
private ShaderInstance _shader;
private readonly ShaderInstance _shader;
public CooldownGraphic()
{

View File

@@ -26,7 +26,7 @@ namespace Content.Client.UserInterface
public event Action<string> SelectedId;
private Dictionary<string, JobButton> JobButtons = new Dictionary<string, JobButton>();
private readonly Dictionary<string, JobButton> _jobButtons = new Dictionary<string, JobButton>();
public LateJoinGui()
{
@@ -95,7 +95,7 @@ namespace Content.Client.UserInterface
jobButton.Disabled = true;
}
JobButtons[job.ID] = jobButton;
_jobButtons[job.ID] = jobButton;
}
SelectedId += jobId =>
@@ -115,7 +115,7 @@ namespace Content.Client.UserInterface
private void JobsAvailableUpdated(IReadOnlyList<string> jobs)
{
foreach (var (id, button) in JobButtons)
foreach (var (id, button) in _jobButtons)
{
button.Disabled = !jobs.Contains(id);
}
@@ -128,7 +128,7 @@ namespace Content.Client.UserInterface
if (disposing)
{
_gameTicker.LobbyJobsAvailableUpdated -= JobsAvailableUpdated;
JobButtons.Clear();
_jobButtons.Clear();
}
}
}

View File

@@ -23,8 +23,8 @@ namespace Content.Client.UserInterface
private readonly IClientPreferencesManager _preferencesManager;
private IEntity _previewDummy;
private readonly Label _summaryLabel;
private VBoxContainer _loaded;
private Label _unloaded;
private readonly VBoxContainer _loaded;
private readonly Label _unloaded;
public LobbyCharacterPreviewPanel(IEntityManager entityManager,
IClientPreferencesManager preferencesManager)

View File

@@ -258,8 +258,8 @@ namespace Content.Client.UserInterface
public class LobbyPlayerList : Control
{
private ScrollContainer _scroll;
private VBoxContainer _vBox;
private readonly ScrollContainer _scroll;
private readonly VBoxContainer _vBox;
public LobbyPlayerList()
{

View File

@@ -24,7 +24,7 @@ namespace Content.Client.ParticleAccelerator
{
public sealed class ParticleAcceleratorControlMenu : BaseWindow
{
private ShaderInstance _greyScaleShader;
private readonly ShaderInstance _greyScaleShader;
private readonly ParticleAcceleratorBoundUserInterface Owner;