-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'auto_cl_update_v2' of https://github.com/themanyfacedde…
…mon/space_station_ADT into auto_cl_update_v2
- Loading branch information
Showing
9 changed files
with
99 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Content.Server.ADT.CustomAiLawBoard; | ||
|
||
[RegisterComponent] | ||
public sealed partial class CustomAiLawBoardComponent : Component | ||
{ | ||
|
||
} |
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,41 @@ | ||
using Content.Shared.Interaction; | ||
using Content.Shared.Tools.Systems; | ||
using Content.Server.Silicons.Laws; | ||
using Content.Shared.Silicons.Laws.Components; | ||
using Content.Server.Administration.Managers; | ||
using Content.Server.EUI; | ||
using Robust.Server.Player; | ||
|
||
namespace Content.Server.ADT.CustomAiLawBoard; | ||
|
||
public sealed class CustomAiLawBoardSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedToolSystem _toolSystem = default!; | ||
[Dependency] private readonly IPlayerManager _playerManager = default!; | ||
[Dependency] private readonly SiliconLawSystem _siliconLawSystem = default!; | ||
[Dependency] private readonly IAdminManager _adminManager = default!; | ||
[Dependency] private readonly EuiManager _euiManager = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<CustomAiLawBoardComponent, InteractUsingEvent>(OnInteractUsing); | ||
} | ||
private void OnInteractUsing(EntityUid uid, CustomAiLawBoardComponent comp, InteractUsingEvent args) | ||
{ | ||
if (args.Handled) | ||
return; | ||
|
||
if (!_toolSystem.HasQuality(args.Used, SharedToolSystem.PulseQuality)) | ||
return; | ||
|
||
if (!TryComp<SiliconLawBoundComponent>(uid, out var lawBoundComponent)) | ||
return; | ||
var ui = new SiliconLawEui(_siliconLawSystem, EntityManager, _adminManager); | ||
if (!_playerManager.TryGetSessionByEntity(args.User, out var session)) | ||
{ | ||
return; | ||
} | ||
_euiManager.OpenEui(ui, session); | ||
ui.UpdateLaws(lawBoundComponent, args.Target); | ||
} | ||
} |
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
2 changes: 2 additions & 0 deletions
2
Resources/Locale/ru-RU/ADT/prototypes/Entities/Objects/Device/Circuitboards/aicustomlaw.ftl
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,2 @@ | ||
ent-ADTCustomLawCircuitBoard = плата смены законов ИИ | ||
.desc = Модификация обычный платы законов, позволяющая полностью переписать их при помощи мультитула. |
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
13 changes: 13 additions & 0 deletions
13
Resources/Prototypes/ADT/Entities/Objects/Devices/Circuitboards/aicustomlaw.yml
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,13 @@ | ||
- type: entity | ||
id: ADTCustomLawCircuitBoard | ||
parent: BaseElectronics | ||
name: custom ai law circuit board | ||
description: An electronics board containing a lawset. | ||
components: | ||
- type: Sprite | ||
sprite: Objects/Misc/module.rsi | ||
state: cpuboard_adv | ||
- type: SiliconLawBound | ||
- type: CustomAiLawBoard | ||
- type: SiliconLawProvider | ||
laws: NTDefault |
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