Merge branch 'master' into 2020-08-19-firelocks

This commit is contained in:
Víctor Aguilera Puerto
2020-09-07 12:47:52 +02:00
28 changed files with 979 additions and 289 deletions

View File

@@ -1,5 +1,4 @@

using System;
using System;
using System.Collections.Generic;
using Robust.Client.GameObjects;
using Robust.Shared.Animations;
@@ -13,8 +12,6 @@ using Robust.Shared.Log;
using Robust.Shared.Maths;
using Robust.Shared.Interfaces.Serialization;
using Robust.Client.Animations;
using Robust.Shared.Interfaces.GameObjects;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Robust.Client.GameObjects.Components.Animations;
using System.Linq;
@@ -43,7 +40,7 @@ namespace Content.Client.GameObjects.Components
protected IRobustRandom RobustRandom = default;
private float _maxTime = default;
public virtual void ExposeData(ObjectSerializer serializer)
{
serializer.DataField(this, x => x.ID, "id", string.Empty);
@@ -83,7 +80,7 @@ namespace Content.Client.GameObjects.Components
MaxTime = MaxDuration;
}
owner.Length = TimeSpan.FromSeconds(MaxTime);
owner.Length = TimeSpan.FromSeconds(MaxTime);
}
public override (int KeyFrameIndex, float FramePlayingTime) InitPlayback()
@@ -344,7 +341,7 @@ namespace Content.Client.GameObjects.Components
/// A component which applies a specific behaviour to a PointLightComponent on its owner.
/// </summary>
[RegisterComponent]
public class LightBehaviourComponent : SharedLightBehaviourComponent
public class LightBehaviourComponent : SharedLightBehaviourComponent
{
private const string KeyPrefix = nameof(LightBehaviourComponent);
@@ -387,7 +384,7 @@ namespace Content.Client.GameObjects.Components
container.LightBehaviour.Initialize(_lightComponent);
}
// we need to initialize all behaviours before starting any
// we need to initialize all behaviours before starting any
foreach (var container in _animations)
{
if (container.LightBehaviour.Enabled)

View File

@@ -34,7 +34,7 @@ namespace Content.Client.GameObjects.Components.Storage
base.OnAdd();
Window = new StorageWindow()
{StorageEntity = this, Title = Owner.Name};
{ StorageEntity = this, Title = Owner.Name };
}
public override void OnRemove()
@@ -55,7 +55,7 @@ namespace Content.Client.GameObjects.Components.Storage
break;
//Opens the UI
case OpenStorageUIMessage _:
OpenUI();
ToggleUI();
break;
case CloseStorageUIMessage _:
CloseUI();
@@ -76,11 +76,14 @@ namespace Content.Client.GameObjects.Components.Storage
}
/// <summary>
/// Opens the storage UI
/// Opens the storage UI if closed. Closes it if opened.
/// </summary>
private void OpenUI()
private void ToggleUI()
{
Window.Open();
if (Window.IsOpen)
Window.Close();
else
Window.Open();
}
private void CloseUI()
@@ -107,8 +110,8 @@ namespace Content.Client.GameObjects.Components.Storage
private 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 StyleBoxFlat _HoveredBox = new StyleBoxFlat { BackgroundColor = Color.Black.WithAlpha(0.35f) };
private StyleBoxFlat _unHoveredBox = new StyleBoxFlat { BackgroundColor = Color.Black.WithAlpha(0.0f) };
protected override Vector2? CustomSize => (180, 320);