1
0

AdminNotesEuiState.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using Content.Shared.Database;
  2. using Content.Shared.Eui;
  3. using Robust.Shared.Serialization;
  4. namespace Content.Shared.Administration.Notes;
  5. [Serializable, NetSerializable]
  6. public sealed class AdminNotesEuiState : EuiStateBase
  7. {
  8. public AdminNotesEuiState(string notedPlayerName, Dictionary<(int, NoteType), SharedAdminNote> notes, bool canCreate, bool canDelete, bool canEdit)
  9. {
  10. NotedPlayerName = notedPlayerName;
  11. Notes = notes;
  12. CanCreate = canCreate;
  13. CanDelete = canDelete;
  14. CanEdit = canEdit;
  15. }
  16. public string NotedPlayerName { get; }
  17. public Dictionary<(int noteId, NoteType noteType), SharedAdminNote> Notes { get; }
  18. public bool CanCreate { get; }
  19. public bool CanDelete { get; }
  20. public bool CanEdit { get; }
  21. }
  22. public static class AdminNoteEuiMsg
  23. {
  24. [Serializable, NetSerializable]
  25. public sealed class CreateNoteRequest : EuiMessageBase
  26. {
  27. public CreateNoteRequest(NoteType type, string message, NoteSeverity? severity, bool secret, DateTime? expiryTime)
  28. {
  29. NoteType = type;
  30. Message = message;
  31. NoteSeverity = severity;
  32. Secret = secret;
  33. ExpiryTime = expiryTime;
  34. }
  35. public NoteType NoteType { get; set; }
  36. public string Message { get; set; }
  37. public NoteSeverity? NoteSeverity { get; set; }
  38. public bool Secret { get; set; }
  39. public DateTime? ExpiryTime { get; set; }
  40. }
  41. [Serializable, NetSerializable]
  42. public sealed class DeleteNoteRequest : EuiMessageBase
  43. {
  44. public DeleteNoteRequest(int id, NoteType type)
  45. {
  46. Id = id;
  47. Type = type;
  48. }
  49. public int Id { get; set; }
  50. public NoteType Type { get; set; }
  51. }
  52. [Serializable, NetSerializable]
  53. public sealed class EditNoteRequest : EuiMessageBase
  54. {
  55. public EditNoteRequest(int id, NoteType type, string message, NoteSeverity? severity, bool secret, DateTime? expiryTime)
  56. {
  57. Id = id;
  58. Type = type;
  59. Message = message;
  60. NoteSeverity = severity;
  61. Secret = secret;
  62. ExpiryTime = expiryTime;
  63. }
  64. public int Id { get; set; }
  65. public NoteType Type { get; set; }
  66. public string Message { get; set; }
  67. public NoteSeverity? NoteSeverity { get; set; }
  68. public bool Secret { get; set; }
  69. public DateTime? ExpiryTime { get; set; }
  70. }
  71. }