2021-02-27 04:12:09 +01:00
|
|
|
#nullable enable
|
2018-11-21 20:58:11 +01:00
|
|
|
using System;
|
2020-08-13 14:40:27 +02:00
|
|
|
using Content.Shared.GameObjects.Verbs;
|
2019-04-15 21:11:38 -06:00
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using Robust.Shared.Serialization;
|
2020-05-23 03:09:44 +02:00
|
|
|
using Robust.Shared.Utility;
|
2018-11-21 20:58:11 +01:00
|
|
|
|
|
|
|
|
namespace Content.Shared.GameObjects.EntitySystemMessages
|
|
|
|
|
{
|
|
|
|
|
public static class VerbSystemMessages
|
|
|
|
|
{
|
|
|
|
|
[Serializable, NetSerializable]
|
2021-03-09 11:22:48 -08:00
|
|
|
public class RequestVerbsMessage : EntityEventArgs
|
2018-11-21 20:58:11 +01:00
|
|
|
{
|
|
|
|
|
public readonly EntityUid EntityUid;
|
|
|
|
|
|
|
|
|
|
public RequestVerbsMessage(EntityUid entityUid)
|
|
|
|
|
{
|
|
|
|
|
EntityUid = entityUid;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2021-03-09 11:22:48 -08:00
|
|
|
public class VerbsResponseMessage : EntityEventArgs
|
2018-11-21 20:58:11 +01:00
|
|
|
{
|
2020-05-23 03:09:44 +02:00
|
|
|
public readonly NetVerbData[] Verbs;
|
2018-11-21 20:58:11 +01:00
|
|
|
public readonly EntityUid Entity;
|
|
|
|
|
|
2020-05-23 03:09:44 +02:00
|
|
|
public VerbsResponseMessage(NetVerbData[] verbs, EntityUid entity)
|
2018-11-21 20:58:11 +01:00
|
|
|
{
|
|
|
|
|
Verbs = verbs;
|
|
|
|
|
Entity = entity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2020-05-23 03:09:44 +02:00
|
|
|
public readonly struct NetVerbData
|
2018-11-21 20:58:11 +01:00
|
|
|
{
|
|
|
|
|
public readonly string Text;
|
|
|
|
|
public readonly string Key;
|
2020-03-06 20:11:24 +01:00
|
|
|
public readonly string Category;
|
2021-02-27 20:27:54 +01:00
|
|
|
public readonly SpriteSpecifier? Icon;
|
2021-02-27 04:12:09 +01:00
|
|
|
public readonly SpriteSpecifier? CategoryIcon;
|
2018-11-21 20:58:11 +01:00
|
|
|
public readonly bool Available;
|
|
|
|
|
|
2020-05-23 03:09:44 +02:00
|
|
|
public NetVerbData(VerbData data, string key)
|
2018-11-21 20:58:11 +01:00
|
|
|
{
|
2020-05-23 03:09:44 +02:00
|
|
|
Text = data.Text;
|
2018-11-21 20:58:11 +01:00
|
|
|
Key = key;
|
2020-05-23 03:09:44 +02:00
|
|
|
Category = data.Category;
|
|
|
|
|
CategoryIcon = data.CategoryIcon;
|
|
|
|
|
Icon = data.Icon;
|
|
|
|
|
Available = data.Visibility == VerbVisibility.Visible;
|
2018-11-21 20:58:11 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2021-03-09 11:22:48 -08:00
|
|
|
public class UseVerbMessage : EntityEventArgs
|
2018-11-21 20:58:11 +01:00
|
|
|
{
|
|
|
|
|
public readonly EntityUid EntityUid;
|
|
|
|
|
public readonly string VerbKey;
|
|
|
|
|
|
|
|
|
|
public UseVerbMessage(EntityUid entityUid, string verbKey)
|
|
|
|
|
{
|
|
|
|
|
EntityUid = entityUid;
|
|
|
|
|
VerbKey = verbKey;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|