VerbCategory.cs 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using Robust.Shared.Serialization;
  2. using Robust.Shared.Utility;
  3. namespace Content.Shared.Verbs
  4. {
  5. /// <summary>
  6. /// Contains combined name and icon information for a verb category.
  7. /// </summary>
  8. [Serializable, NetSerializable]
  9. public sealed class VerbCategory
  10. {
  11. public readonly string Text;
  12. public readonly SpriteSpecifier? Icon;
  13. /// <summary>
  14. /// Columns for the grid layout that shows the verbs in this category. If <see cref="IconsOnly"/> is false,
  15. /// this should very likely be set to 1.
  16. /// </summary>
  17. public int Columns = 1;
  18. /// <summary>
  19. /// If true, the members of this verb category will be shown in the context menu as a row of icons without
  20. /// any text.
  21. /// </summary>
  22. /// <remarks>
  23. /// For example, the 'Rotate' category simply shows two icons for rotating left and right.
  24. /// </remarks>
  25. public readonly bool IconsOnly;
  26. public VerbCategory(string text, string? icon, bool iconsOnly = false)
  27. {
  28. Text = Loc.GetString(text);
  29. Icon = icon == null ? null : new SpriteSpecifier.Texture(new(icon));
  30. IconsOnly = iconsOnly;
  31. }
  32. public static readonly VerbCategory Admin =
  33. new("verb-categories-admin", "/Textures/Interface/character.svg.192dpi.png");
  34. public static readonly VerbCategory Antag =
  35. new("verb-categories-antag", "/Textures/Interface/VerbIcons/antag-e_sword-temp.192dpi.png", iconsOnly: true) { Columns = 5 };
  36. public static readonly VerbCategory Examine =
  37. new("verb-categories-examine", "/Textures/Interface/VerbIcons/examine.svg.192dpi.png");
  38. public static readonly VerbCategory Debug =
  39. new("verb-categories-debug", "/Textures/Interface/VerbIcons/debug.svg.192dpi.png");
  40. public static readonly VerbCategory Eject =
  41. new("verb-categories-eject", "/Textures/Interface/VerbIcons/eject.svg.192dpi.png");
  42. public static readonly VerbCategory Insert =
  43. new("verb-categories-insert", "/Textures/Interface/VerbIcons/insert.svg.192dpi.png");
  44. public static readonly VerbCategory Buckle =
  45. new("verb-categories-buckle", "/Textures/Interface/VerbIcons/buckle.svg.192dpi.png");
  46. public static readonly VerbCategory Unbuckle =
  47. new("verb-categories-unbuckle", "/Textures/Interface/VerbIcons/unbuckle.svg.192dpi.png");
  48. public static readonly VerbCategory Rotate =
  49. new("verb-categories-rotate", "/Textures/Interface/VerbIcons/refresh.svg.192dpi.png", iconsOnly: true) { Columns = 5 };
  50. public static readonly VerbCategory Smite =
  51. new("verb-categories-smite", "/Textures/Interface/VerbIcons/smite.svg.192dpi.png", iconsOnly: true) { Columns = 6 };
  52. public static readonly VerbCategory Tricks =
  53. new("verb-categories-tricks", "/Textures/Interface/AdminActions/tricks.png", iconsOnly: true) { Columns = 5 };
  54. public static readonly VerbCategory SetTransferAmount =
  55. new("verb-categories-transfer", "/Textures/Interface/VerbIcons/spill.svg.192dpi.png");
  56. public static readonly VerbCategory Split =
  57. new("verb-categories-split", null);
  58. public static readonly VerbCategory InstrumentStyle =
  59. new("verb-categories-instrument-style", null);
  60. public static readonly VerbCategory ChannelSelect = new("verb-categories-channel-select", null);
  61. public static readonly VerbCategory SetSensor = new("verb-categories-set-sensor", null);
  62. public static readonly VerbCategory Lever = new("verb-categories-lever", null);
  63. public static readonly VerbCategory SelectType = new("verb-categories-select-type", null);
  64. public static readonly VerbCategory PowerLevel = new("verb-categories-power-level", null);
  65. }
  66. }