-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Simple-Station/Einstein-E…
- Loading branch information
Showing
1,085 changed files
with
19,431 additions
and
8,418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ jobs: | |
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 9.0.100 | ||
dotnet-version: 9.0.x | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ jobs: | |
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 9.0.100 | ||
dotnet-version: 9.0.x | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ jobs: | |
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 9.0.100 | ||
dotnet-version: 9.0.x | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 9.0.100 | ||
dotnet-version: 9.0.x | ||
|
||
- name: Get Engine Tag | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ jobs: | |
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 9.0.100 | ||
dotnet-version: 9.0.x | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 9.0.100 | ||
dotnet-version: 9.0.x | ||
- name: Install dependencies | ||
run: dotnet restore | ||
- name: Build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
Content.Server/_Goobstation/Interaction/Components/UseOnStationOnlyComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Content.Server._Goobstation.Interaction.Components; | ||
|
||
/// <summary> | ||
/// Allows use item with component on stations only | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class UseOnStationOnlyComponent : Component | ||
{ | ||
} |
28 changes: 28 additions & 0 deletions
28
Content.Server/_Goobstation/Interaction/Systems/UseOnStationOnlySystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Content.Server._Goobstation.Interaction.Components; | ||
using Content.Server.Popups; | ||
using Content.Server.Station.Systems; | ||
using Content.Shared._Goobstation.Interaction; | ||
|
||
namespace Content.Server._Goobstation.Interaction.Systems; | ||
|
||
public sealed partial class UseOnStationOnlySystem : EntitySystem | ||
{ | ||
[Dependency] private readonly StationSystem _station = default!; | ||
[Dependency] private readonly PopupSystem _popup = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<UseOnStationOnlyComponent, UseInHandAttemptEvent>(OnUseAttempt); | ||
} | ||
|
||
private void OnUseAttempt(Entity<UseOnStationOnlyComponent> item, ref UseInHandAttemptEvent args) | ||
{ | ||
if (_station.GetOwningStation(args.User) is not null) | ||
return; | ||
|
||
_popup.PopupEntity(Loc.GetString("use-on-station-only-not-on-station"), args.User, args.User); | ||
args.Cancel(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Content.Server/_Goobstation/Spawn/Components/UniqueEntityCheckerComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Content.Server._Goobstation.Spawn.Components; | ||
|
||
/// <summary> | ||
/// Ensures that related entity will be on station (like NTR or BSO lockers) and will be not duplicate. | ||
/// If station have unique entity - item with this component will be deleted. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class UniqueEntityCheckerComponent : Component | ||
{ | ||
/// <summary> | ||
/// Name of marker in UniqueEntityMarker | ||
/// </summary> | ||
[DataField] | ||
public string? MarkerName; | ||
} |
21 changes: 21 additions & 0 deletions
21
Content.Server/_Goobstation/Spawn/Components/UniqueEntityMarkerComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace Content.Server._Goobstation.Spawn.Components; | ||
|
||
/// <summary> | ||
/// Component-marker for unique entity | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class UniqueEntityMarkerComponent : Component | ||
{ | ||
/// <summary> | ||
/// Marker name that would be used in check | ||
/// </summary> | ||
[DataField] | ||
public string? MarkerName; | ||
|
||
/// <summary> | ||
/// If true - marker will work on grids with StationDataComponent | ||
/// If false - marker will work globally | ||
/// </summary> | ||
[DataField] | ||
public bool StationOnly = true; | ||
} |
43 changes: 43 additions & 0 deletions
43
Content.Server/_Goobstation/Spawn/Systems/UniqueEntitySystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using Content.Server._Goobstation.Spawn.Components; | ||
using Content.Server.Station.Components; | ||
using Content.Server.Station.Systems; | ||
|
||
namespace Content.Server._Goobstation.Spawn.Systems; | ||
|
||
public sealed partial class UniqueEntitySystem : EntitySystem | ||
{ | ||
[Dependency] private readonly StationSystem _station = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<UniqueEntityCheckerComponent, ComponentInit>(OnComponentInit); | ||
} | ||
|
||
public void OnComponentInit(Entity<UniqueEntityCheckerComponent> checker, ref ComponentInit args) | ||
{ | ||
var comp = checker.Comp; | ||
|
||
if (string.IsNullOrEmpty(comp.MarkerName)) | ||
return; | ||
|
||
var query = EntityQueryEnumerator<UniqueEntityMarkerComponent, TransformComponent>(); | ||
|
||
while (query.MoveNext(out var uid, out var marker, out var xform)) | ||
{ | ||
if (string.IsNullOrEmpty(marker.MarkerName) | ||
|| marker.MarkerName != comp.MarkerName | ||
|| uid == checker.Owner) | ||
continue; | ||
|
||
// Check if marker on station | ||
if (marker.StationOnly && _station.GetOwningStation(uid, xform) is null) | ||
continue; | ||
|
||
// Delete it if found unique entity | ||
QueueDel(checker); | ||
return; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Content.Shared._Goobstation.Interaction; | ||
|
||
/// <summary> | ||
/// UseAttempt, but for item. | ||
/// </summary> | ||
public sealed class UseInHandAttemptEvent(EntityUid user) : CancellableEntityEventArgs | ||
{ | ||
public EntityUid User { get; } = user; | ||
} |
Oops, something went wrong.