Files
crystall-punk-14/Content.Shared/GameObjects/Verbs/VerbData.cs
Visne 9b94d5c195 Added nullable to most Content.Shared files (#3238)
* Add nullable to some Content.Shared files.

* Use [NotNullWhen(true)]

* Undo adding now redundant !'s

* Forgot one

* Add a ton more nullable

* You can guess

* Fix some issues

* It actually compiles now

* Auto stash before merge of "null2" and "origin/master"

* I lied

* enable annotations -> enable

* Revert ActionBlockerSystem.cs to original

* Fix ActionBlockerSystem.cs

* More nullable

* Undo some added exclamation marks

* Fix issues

* Update Content.Shared/Maps/ContentTileDefinition.cs

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* Resolve some issues

* Remove unused method

* Fix more issues

* Fix more issues

* Fix more issues

* Fix more issues

* Fix issue, rollback SharedGhostComponent.cs

* Update submodule

* Fix issue, invert some if-statements to reduce nesting

* Revert RobustToolbox

* FIx things broken by merge

* Some fixes

- Replaced with string.Empty
- Remove some exclamation marks
- Revert file

* Some fixes

* Trivial #nullable enable

* Fix null ables

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
2021-02-27 14:12:09 +11:00

67 lines
2.2 KiB
C#

#nullable enable
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Utility;
namespace Content.Shared.GameObjects.Verbs
{
/// <summary>
/// Stores visual data for a verb.
/// </summary>
/// <remarks>
/// An instance of this class gets instantiated by the verb system and should be filled in by implementations of
/// <see cref="Verb.GetData(IEntity, IComponent, VerbData)"/>.
/// </remarks>
public sealed class VerbData
{
/// <summary>
/// The text that the user sees on the verb button.
/// </summary>
public string Text { get; set; } = string.Empty;
/// <summary>
/// Sprite of the icon that the user sees on the verb button.
/// </summary>
public SpriteSpecifier Icon { get; set; } = SpriteSpecifier.Invalid;
/// <summary>
/// Name of the category this button is under.
/// </summary>
public string Category { get; set; } = "";
/// <summary>
/// Sprite of the icon that the user sees on the verb button.
/// </summary>
public SpriteSpecifier? CategoryIcon { get; set; } = SpriteSpecifier.Invalid;
/// <summary>
/// Whether this verb is visible, disabled (greyed out) or hidden.
/// </summary>
public VerbVisibility Visibility { get; set; } = VerbVisibility.Visible;
public bool IsInvisible => Visibility == VerbVisibility.Invisible;
public bool IsDisabled => Visibility == VerbVisibility.Disabled;
/// <summary>
/// Convenience property to set verb category and icon at once.
/// </summary>
[ValueProvider("Content.Shared.GameObjects.VerbCategories")]
public VerbCategoryData CategoryData
{
set
{
Category = value.Name;
CategoryIcon = value.Icon;
}
}
/// <summary>
/// Convenience property to set <see cref="Icon"/> to a raw texture path.
/// </summary>
public string IconTexture
{
set => Icon = new SpriteSpecifier.Texture(new ResourcePath(value));
}
}
}