Merge branch 'master' into 2020-08-31-click-attack
This commit is contained in:
12
Content.Shared/GameObjects/Components/ExtinguisherCabinet.cs
Normal file
12
Content.Shared/GameObjects/Components/ExtinguisherCabinet.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public enum ExtinguisherCabinetVisuals
|
||||
{
|
||||
IsOpen,
|
||||
ContainsExtinguisher
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Components.UserInterface;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.Medical
|
||||
{
|
||||
|
||||
public class SharedCloningPodComponent : Component
|
||||
{
|
||||
public override string Name => "CloningPod";
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class CloningPodBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
public readonly Dictionary<int, string> MindIdName;
|
||||
public readonly float Progress;
|
||||
public readonly bool MindPresent;
|
||||
|
||||
public CloningPodBoundUserInterfaceState(Dictionary<int, string> mindIdName, float progress, bool mindPresent)
|
||||
{
|
||||
MindIdName = mindIdName;
|
||||
Progress = progress;
|
||||
MindPresent = mindPresent;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum CloningPodUIKey
|
||||
{
|
||||
Key
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum CloningPodVisuals
|
||||
{
|
||||
Status
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum CloningPodStatus
|
||||
{
|
||||
Idle,
|
||||
Cloning,
|
||||
Gore,
|
||||
NoMind
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum UiButton
|
||||
{
|
||||
Clone,
|
||||
Eject
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class CloningPodUiButtonPressedMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly UiButton Button;
|
||||
public readonly int? ScanId;
|
||||
|
||||
public CloningPodUiButtonPressedMessage(UiButton button, int? scanId)
|
||||
{
|
||||
Button = button;
|
||||
ScanId = scanId;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -35,4 +35,11 @@ namespace Content.Shared.GameObjects.Components.Observer
|
||||
{
|
||||
public ReturnToBodyComponentMessage() => Directed = true;
|
||||
}
|
||||
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class ReturnToCloneComponentMessage : ComponentMessage
|
||||
{
|
||||
public ReturnToCloneComponentMessage() => Directed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Components.UserInterface;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components
|
||||
{
|
||||
public class SharedAcceptCloningComponent : Component
|
||||
{
|
||||
public override string Name => "AcceptCloning";
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum AcceptCloningUiKey
|
||||
{
|
||||
Key
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum UiButton
|
||||
{
|
||||
Accept
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class UiButtonPressedMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly UiButton Button;
|
||||
|
||||
public UiButtonPressedMessage(UiButton button)
|
||||
{
|
||||
Button = button;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -188,7 +188,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
if (!inRange && popup)
|
||||
{
|
||||
var message = Loc.GetString("You can't reach there!");
|
||||
origin.PopupMessage(origin, message);
|
||||
origin.PopupMessage(message);
|
||||
}
|
||||
|
||||
return inRange;
|
||||
@@ -244,7 +244,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
if (!inRange && popup)
|
||||
{
|
||||
var message = Loc.GetString("You can't reach there!");
|
||||
origin.PopupMessage(origin, message);
|
||||
origin.PopupMessage(message);
|
||||
}
|
||||
|
||||
return inRange;
|
||||
@@ -300,7 +300,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
if (!inRange && popup)
|
||||
{
|
||||
var message = Loc.GetString("You can't reach there!");
|
||||
origin.PopupMessage(origin, message);
|
||||
origin.PopupMessage(message);
|
||||
}
|
||||
|
||||
return inRange;
|
||||
@@ -355,7 +355,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
if (!inRange && popup)
|
||||
{
|
||||
var message = Loc.GetString("You can't reach there!");
|
||||
origin.PopupMessage(origin, message);
|
||||
origin.PopupMessage(message);
|
||||
}
|
||||
|
||||
return inRange;
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.GameObjects.Verbs
|
||||
@@ -16,6 +17,8 @@ namespace Content.Shared.GameObjects.Verbs
|
||||
// This works for now though.
|
||||
public static IEnumerable<(IComponent, Verb)> GetVerbs(IEntity entity)
|
||||
{
|
||||
var typeFactory = IoCManager.Resolve<IDynamicTypeFactory>();
|
||||
|
||||
foreach (var component in entity.GetAllComponents())
|
||||
{
|
||||
var type = component.GetType();
|
||||
@@ -26,7 +29,7 @@ namespace Content.Shared.GameObjects.Verbs
|
||||
continue;
|
||||
}
|
||||
|
||||
var verb = (Verb)Activator.CreateInstance(nestedType);
|
||||
var verb = typeFactory.CreateInstance<Verb>(nestedType);
|
||||
yield return (component, verb);
|
||||
}
|
||||
}
|
||||
@@ -38,6 +41,8 @@ namespace Content.Shared.GameObjects.Verbs
|
||||
/// <param name="assembly">The assembly to search for global verbs in.</param>
|
||||
public static IEnumerable<GlobalVerb> GetGlobalVerbs(Assembly assembly)
|
||||
{
|
||||
var typeFactory = IoCManager.Resolve<IDynamicTypeFactory>();
|
||||
|
||||
foreach (Type type in assembly.GetTypes())
|
||||
{
|
||||
if (Attribute.IsDefined(type, typeof(GlobalVerbAttribute)))
|
||||
@@ -46,7 +51,7 @@ namespace Content.Shared.GameObjects.Verbs
|
||||
{
|
||||
continue;
|
||||
}
|
||||
yield return (GlobalVerb)Activator.CreateInstance(type);
|
||||
yield return typeFactory.CreateInstance<GlobalVerb>(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user