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

Sp update & fix #26

Merged
merged 7 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
"Спрайты":
"Changes: Sprites":
- changed-files:
- any-glob-to-any-file: '**/*.rsi/*.png'

"Маппинг":
"Changes: Map":
- changed-files:
- any-glob-to-any-file:
- 'Resources/Maps/*.yml'
- 'Resources/Prototypes/Maps/*.yml'

"Прототипы":
- changed-files:
- any-glob-to-any-file: '**/*.yml*'

"UI":
"Changes: UI":
- changed-files:
- any-glob-to-any-file: '**/*.xaml*'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/conflict-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
- name: Check for Merge Conflicts
uses: eps1lon/[email protected]
with:
dirtyLabel: "PR: Конфликты"
dirtyLabel: "Merge Conflict"
repoToken: "${{ secrets.GITHUB_TOKEN }}"
commentOnDirty: "This pull request has conflicts, please resolve those before we can evaluate the pull request."
4 changes: 2 additions & 2 deletions .github/workflows/labeler-needsreview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: "PR: Нужна проверка"
labels: "Status: Needs Review"
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: "PR: Нужны изменения"
labels: "Status: Awaiting Changes"
2 changes: 1 addition & 1 deletion Content.Server/Station/Systems/StationSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public Filter GetInOwningStation(EntityUid source, float range = 32f)
/// <summary>
/// Retrieves a filter for everything in a particular station or near its member grids.
/// </summary>
public Filter GetInStation(StationDataComponent dataComponent, float range = 32f)
public Filter GetInStation(StationDataComponent dataComponent, float range = 256f) // Stories. Маппил, а оказалось, что консоль связи должна быть не дальше 32. Увеличим.
{
// Could also use circles if you wanted.
var bounds = new ValueList<Box2>(dataComponent.Grids.Count);
Expand Down
17 changes: 17 additions & 0 deletions Content.Server/Stories/Prison/Components/PrisonComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace Content.Server.Stories.Prison;

[RegisterComponent]
public sealed partial class PrisonComponent : Component
{
/// <summary>
/// Станция, к которой приписана тюрьма.
/// </summary>
[DataField]
public EntityUid? Station;

/// <summary>
/// Тюремные шаттлы.
/// </summary>
[DataField]
public List<EntityUid> Shuttles = new();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Content.Server.Stories.Prison;

[RegisterComponent]
public sealed partial class PrisonShuttleComponent : Component
{
/// <summary>
/// Тюрьма, которой принадлежит шаттл.
/// </summary>
[DataField]
public EntityUid? Prison;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Content.Server.Maps;
using Robust.Shared.Prototypes;

namespace Content.Server.Stories.Prison;

[RegisterComponent]
public sealed partial class StationPrisonComponent : Component
{
[DataField]
public ProtoId<GameMapPrototype> GameMap = "StoriesPrison";

/// <summary>
/// Тюрьма, приписанная к станции.
/// </summary>
[DataField]
public EntityUid? Prison;
}
7 changes: 0 additions & 7 deletions Content.Server/Stories/Prison/PrisonShuttleComponent.cs

This file was deleted.

55 changes: 55 additions & 0 deletions Content.Server/Stories/Prison/PrisonSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using Content.Server.GameTicking;
using Content.Server.Station.Systems;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;

namespace Content.Server.Stories.Prison;

public sealed partial class PrisonSystem : EntitySystem
{
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly MapSystem _map = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly StationSystem _station = default!;
private ISawmill _sawmill = default!;

public override void Initialize()
{
_sawmill = Logger.GetSawmill("prison");
SubscribeLocalEvent<StationPrisonComponent, MapInitEvent>(OnStationInit);
}

private void OnStationInit(EntityUid uid, StationPrisonComponent component, MapInitEvent args)
{
var prototype = _prototypeManager.Index(component.GameMap);

_map.CreateMap(out var mapId, false);
_gameTicker.LoadGameMap(prototype, mapId, null);

var prison = _station.GetStationInMap(mapId);

if (prison == null)
{
_mapManager.DeleteMap(mapId);
_sawmill.Error("Failed to find prison station");
return;
}

var prisonComp = EnsureComp<PrisonComponent>(prison.Value);
prisonComp.Station = uid;
component.Prison = prison;

// Тюремные шаттлы могут быть на карте.
foreach (var grid in _mapManager.GetAllGrids(mapId))
if (TryComp<PrisonShuttleComponent>(grid.Owner, out var shuttle))
{
_station.AddGridToStation(prison.Value, grid.Owner);
shuttle.Prison = component.Prison;
prisonComp.Shuttles.Add(grid.Owner);
}

_mapManager.DoMapInitialize(mapId);
}
}
15 changes: 0 additions & 15 deletions Content.Server/Stories/Prison/StationPrisonComponent.cs

This file was deleted.

33 changes: 0 additions & 33 deletions Content.Server/Stories/Prison/StationPrisonSystem.cs

This file was deleted.

Loading
Loading