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

@@ -134,12 +134,12 @@ namespace Content.Client.GameObjects.Components.Storage
private class StorageWindow : SS14Window
{
private Control VSplitContainer;
private VBoxContainer EntityList;
private Label Information;
private readonly VBoxContainer _entityList;
private readonly Label _information;
public ClientStorageComponent StorageEntity;
private StyleBoxFlat _HoveredBox = new StyleBoxFlat { BackgroundColor = Color.Black.WithAlpha(0.35f) };
private StyleBoxFlat _unHoveredBox = new StyleBoxFlat { BackgroundColor = Color.Black.WithAlpha(0.0f) };
private readonly StyleBoxFlat _hoveredBox = new StyleBoxFlat { BackgroundColor = Color.Black.WithAlpha(0.35f) };
private readonly StyleBoxFlat _unHoveredBox = new StyleBoxFlat { BackgroundColor = Color.Black.WithAlpha(0.0f) };
protected override Vector2? CustomSize => (180, 320);
@@ -179,12 +179,12 @@ namespace Content.Client.GameObjects.Components.Storage
MouseFilter = MouseFilterMode.Ignore,
};
containerButton.AddChild(VSplitContainer);
Information = new Label
_information = new Label
{
Text = "Items: 0 Volume: 0/0 Stuff",
SizeFlagsVertical = SizeFlags.ShrinkCenter
};
VSplitContainer.AddChild(Information);
VSplitContainer.AddChild(_information);
var listScrollContainer = new ScrollContainer
{
@@ -193,18 +193,18 @@ namespace Content.Client.GameObjects.Components.Storage
HScrollEnabled = true,
VScrollEnabled = true,
};
EntityList = new VBoxContainer
_entityList = new VBoxContainer
{
SizeFlagsHorizontal = SizeFlags.FillExpand
};
listScrollContainer.AddChild(EntityList);
listScrollContainer.AddChild(_entityList);
VSplitContainer.AddChild(listScrollContainer);
Contents.AddChild(containerButton);
listScrollContainer.OnMouseEntered += args =>
{
innerContainerButton.PanelOverride = _HoveredBox;
innerContainerButton.PanelOverride = _hoveredBox;
};
listScrollContainer.OnMouseExited += args =>
@@ -224,7 +224,7 @@ namespace Content.Client.GameObjects.Components.Storage
/// </summary>
public void BuildEntityList()
{
EntityList.DisposeAllChildren();
_entityList.DisposeAllChildren();
var storageList = StorageEntity.StoredEntities;
@@ -254,18 +254,18 @@ namespace Content.Client.GameObjects.Components.Storage
button.EntitySpriteView.Sprite = sprite;
}
EntityList.AddChild(button);
_entityList.AddChild(button);
}
//Sets information about entire storage container current capacity
if (StorageEntity.StorageCapacityMax != 0)
{
Information.Text = String.Format("Items: {0}, Stored: {1}/{2}", storageList.Count,
_information.Text = String.Format("Items: {0}, Stored: {1}/{2}", storageList.Count,
StorageEntity.StorageSizeUsed, StorageEntity.StorageCapacityMax);
}
else
{
Information.Text = String.Format("Items: {0}", storageList.Count);
_information.Text = String.Format("Items: {0}", storageList.Count);
}
}