Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Автоматические доступы, что выдаются в зависимости от кода станции #1004

Merged
merged 13 commits into from
Jan 6, 2025
15 changes: 15 additions & 0 deletions Content.Shared/Access/AccessLevelPrototype.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Robust.Shared.Prototypes;
using Content.Shared._Sunrise.AlertAccess;

namespace Content.Shared.Access
{
Expand All @@ -18,6 +19,20 @@ public sealed partial class AccessLevelPrototype : IPrototype
[DataField("name")]
public string? Name { get; set; }

[DataField]
public string CurrentAlertLevel;

[DataField("redAlertAccesses")]
public ProtoId<AlertAccessesPrototype> RedAlertAccesses;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что это за пиздец, зачем сколько переменных здесь, создай просто Dict<уровень, доступы> и прописывай его через прототипы.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поправлю

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ready


[DataField("yellowAlertAccesses")]
public ProtoId<AlertAccessesPrototype> YellowAlertAccesses;

[DataField("gammaAlertAccesses")]
public ProtoId<AlertAccessesPrototype> GammaAlertAccesses;

[DataField("blueAlertAccesses")]
public ProtoId<AlertAccessesPrototype> BlueAlertAccesses;
public string GetAccessLevelName()
{
if (Name is { } name)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Robust.Shared.Prototypes;
using Content.Shared.Access;

namespace Content.Shared._Sunrise.AlertAccess
{
/// <summary>
/// Defines a single access level that can be stored on ID cards and checked for.
/// </summary>
[Prototype("alertAccessesPrototype")]
public sealed partial class AlertAccessesPrototype : IPrototype
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем делать отдельный прототип.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

удалил

{
[ViewVariables]
[IdDataField]
public string ID { get; private set; } = default!;

[DataField("access")]
public List<ProtoId<AccessLevelPrototype>> Access = new();

}
}
1 change: 1 addition & 0 deletions Resources/Prototypes/Access/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- type: accessLevel
id: Security
name: id-card-access-level-security
redAlertAccesses: SecurityRedAlertAccesses

- type: accessLevel
id: Armory
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- type: alertAccesses
id: SecurityRedAlertAccesses
access:
- Engineer
- Command
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему так мало доступов расширяется? РНД? Медбей? Карго которое уже заказало 20 ящиков пушек?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это для теста пока, потом дополню

- Maintance
Loading