Skip to content
Open
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
15 changes: 15 additions & 0 deletions Content.Client/_Rat/Overwatch/OverwatchWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ public OverwatchWindow()
StopWatchingButton.OnPressed += _ =>
{
_ui?.StopWatching();

foreach (var row in _memberRows.Values)
{
row.SetWatching(false);
}

_watchingStateCache.Clear();
StopWatchingButton.Visible = false;
};

Expand Down Expand Up @@ -140,8 +147,11 @@ private void OnMemberStartWatching(OverwatchMemberRow selectedRow)
if (row != selectedRow)
{
row.SetWatching(false);
_watchingStateCache[row.Member] = false;
}
}

StopWatchingButton.Visible = true;
}

/// <summary>
Expand Down Expand Up @@ -551,6 +561,11 @@ public sealed class OverwatchMemberRow : BoxContainer
/// </summary>
public bool IsWatching { get; private set; }

/// <summary>
/// Сущность участника.
/// </summary>
public NetEntity Member => _member;

/// <summary>
/// Селектор отрядов для назначения участника.
/// </summary>
Expand Down
46 changes: 0 additions & 46 deletions Content.Server/_Rat/Overwatch/OverwatchSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,6 @@ private void OnUIOpenAttempt(Entity<OverwatchConsoleComponent> ent, ref Activata
{
if (args.User is not { Valid: true } user)
return;

var userFaction = GetUserFaction(user);
if (string.IsNullOrEmpty(userFaction) || userFaction != ent.Comp.Faction)
{
args.Cancel();
return;
}
}

/// <summary>
Expand Down Expand Up @@ -310,10 +303,6 @@ private void OnCreateSquad(Entity<OverwatchConsoleComponent> ent, ref OverwatchC
if (args.Actor is not { Valid: true } actor)
return;

var userFaction = GetUserFaction(actor);
if (string.IsNullOrEmpty(userFaction) || userFaction != ent.Comp.Faction)
return;

var created = _squadSystem.CreateSquad(ent.Comp.Faction, args.SquadName);
if (created)
{
Expand All @@ -329,10 +318,6 @@ private void OnDeleteSquad(Entity<OverwatchConsoleComponent> ent, ref OverwatchD
if (args.Actor is not { Valid: true } actor)
return;

var userFaction = GetUserFaction(actor);
if (string.IsNullOrEmpty(userFaction) || userFaction != ent.Comp.Faction)
return;

if (_squadSystem.RemoveSquad(ent.Comp.Faction, args.SquadId))
{
RefreshData(ent);
Expand All @@ -347,10 +332,6 @@ private void OnAssignSquad(Entity<OverwatchConsoleComponent> ent, ref OverwatchA
if (args.Actor is not { Valid: true } actor)
return;

var userFaction = GetUserFaction(actor);
if (string.IsNullOrEmpty(userFaction) || userFaction != ent.Comp.Faction)
return;

var player = GetEntity(args.Player);
if (!player.Valid)
return;
Expand All @@ -373,10 +354,6 @@ private void OnRemoveSquadMember(Entity<OverwatchConsoleComponent> ent, ref Over
if (args.Actor is not { Valid: true } actor)
return;

var userFaction = GetUserFaction(actor);
if (string.IsNullOrEmpty(userFaction) || userFaction != ent.Comp.Faction)
return;

var player = GetEntity(args.Player);
if (!player.Valid)
return;
Expand All @@ -397,10 +374,6 @@ private void OnSendAnnouncement(Entity<OverwatchConsoleComponent> ent, ref Overw
if (args.Actor is not { Valid: true } actor)
return;

var userFaction = GetUserFaction(actor);
if (string.IsNullOrEmpty(userFaction) || userFaction != ent.Comp.Faction)
return;

if (string.IsNullOrEmpty(args.Message))
return;

Expand Down Expand Up @@ -474,10 +447,6 @@ private void OnViewCamera(Entity<OverwatchConsoleComponent> ent, ref OverwatchVi
if (args.Actor is not { Valid: true } actor)
return;

var userFaction = GetUserFaction(actor);
if (string.IsNullOrEmpty(userFaction) || userFaction != ent.Comp.Faction)
return;

var target = GetEntity(args.Target);
if (!TryComp<HullrotFactionComponent>(target, out var factionComp) ||
factionComp.Faction != ent.Comp.Faction ||
Expand Down Expand Up @@ -530,10 +499,6 @@ private void OnStopWatching(Entity<OverwatchConsoleComponent> ent, ref Overwatch
if (args.Actor is not { Valid: true } actor)
return;

var userFaction = GetUserFaction(actor);
if (string.IsNullOrEmpty(userFaction) || userFaction != ent.Comp.Faction)
return;

if (TryComp<RatOverwatchWatchingComponent>(actor, out var watchingComp) && watchingComp.Watching.HasValue)
{
StopWatching(actor, watchingComp);
Expand Down Expand Up @@ -716,17 +681,6 @@ public override void Update(float frameTime)
_cacheInvalidationTimer = 0;
}

/// <summary>
/// Получает фракцию игрока.
/// </summary>
private string? GetUserFaction(EntityUid user)
{
if (!TryComp<HullrotFactionComponent>(user, out var factionComp))
return null;

return factionComp.Faction;
}

/// <summary>
/// Получает кэшированный список членов фракции.
/// </summary>
Expand Down
23 changes: 22 additions & 1 deletion Resources/Locale/ru-RU/_Rat/overwatch.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ overwatch-member-status-alive = Жив
overwatch-member-status-ssd = SSD
overwatch-member-status-dead = Мёртв
overwatch-member-status-unknown = Неизвестно
overwatch-member-coordinates = ({ $x }, { $y })
overwatch-member-coordinates = ({ $x }; { $y })
overwatch-member-coordinates-none = —

overwatch-stop-watching-button = Остановить наблюдение
Expand Down Expand Up @@ -79,3 +79,24 @@ ent-GSCOverwatchComputer = консоль overwatch «ЧЕРНАЯ СЕТЬ»
.desc = Консоль системы наблюдения «ЧЕРНАЯ СЕТЬ» GSC. Децентрализованная сеть наблюдения для независимых операторов.
ent-CDOverwatchComputer = консоль overwatch «ЧЕРНАЯ СЕТЬ»
.desc = Консоль системы наблюдения «ЧЕРНАЯ СЕТЬ» CD. Децентрализованная сеть наблюдения для независимых операторов.

ent-BaseOverwatchClipboard = цифровой планшет overwatch
.desc = Громоздкий цифровой планшет, содержащий информацию о членах фракции. При таком количестве компрометирующих документов его следует беречь.
ent-DSMOverwatchClipboard = цифровой планшет overwatch «ОКО КАЙЗЕРА»
.desc = { ent-BaseOverwatchClipboard.desc }
ent-NCWLOverwatchClipboard = цифровой планшет overwatch «ДОЗОРНЫЙ»
.desc = { ent-BaseOverwatchClipboard.desc }
ent-SHIOverwatchClipboard = цифровой планшет overwatch «C.A.S.S.I.E.»
.desc = { ent-BaseOverwatchClipboard.desc }
ent-TAPOverwatchClipboard = цифровой планшет overwatch «ЗВЕЗДНЫЙ ШЁПОТ»
.desc = { ent-BaseOverwatchClipboard.desc }
ent-IPMOverwatchClipboard = цифровой планшет overwatch «ЧЕРНАЯ СЕТЬ»
.desc = { ent-BaseOverwatchClipboard.desc }
ent-SAWOverwatchClipboard = цифровой планшет overwatch «ЧЕРНАЯ СЕТЬ»
.desc = { ent-BaseOverwatchClipboard.desc }
ent-GSCOverwatchClipboard = цифровой планшет overwatch «ЧЕРНАЯ СЕТЬ»
.desc = { ent-BaseOverwatchClipboard.desc }
ent-CDOverwatchClipboard = цифровой планшет overwatch «ЧЕРНАЯ СЕТЬ»
.desc = { ent-BaseOverwatchClipboard.desc }

overwatch-clipboard-computer-verb-text = Переключить меню overwatch
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- type: entity
parent: BaseComputer
abstract: true
id: BaseComputerOverwatch
name: overwatch console
description: A computer console used to track faction members via wearable cameras.
Expand Down Expand Up @@ -225,3 +226,141 @@
# layers:
# - map: ["computerLayerScreen"]
# state: tsp

- type: entity
parent: BoxFolderBase
abstract: true
id: BaseOverwatchClipboard
name: overwatc digi-board
description: A bulky electric clipboard, filled with shipping orders and financing details. With so many compromising documents, you ought to keep this safe.
Comment on lines +234 to +235
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Опечатка в имени и несоответствие описания функциональности.

  1. Строка 234: overwatc — пропущена буква 'h', должно быть overwatch.
  2. Строка 235: Описание про "shipping orders and financing details" не соответствует функциональности Overwatch-консоли — это описание QM-планшета.
Предлагаемое исправление
-  name: overwatc digi-board
-  description: A bulky electric clipboard, filled with shipping orders and financing details. With so many compromising documents, you ought to keep this safe.
+  name: overwatch digi-board
+  description: A bulky digital clipboard used to track faction members via wearable cameras. Keep this safe.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
name: overwatc digi-board
description: A bulky electric clipboard, filled with shipping orders and financing details. With so many compromising documents, you ought to keep this safe.
name: overwatch digi-board
description: A bulky digital clipboard used to track faction members via wearable cameras. Keep this safe.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@Resources/Prototypes/_Rat/Entities/Structures/Machines/Computers/overwatch.yml`
around lines 234 - 235, Поле name содержит опечатку: заменить значение ключа
name `overwatc digi-board` на `overwatch digi-board`; поле description описывает
QM-планшет и не соответствует назначению Overwatch-консоли — обновить значение
ключа description в том же YAML-блоке, дав краткое корректное описание
функциональности Overwatch (мониторинг, безопасность, логи, управление
охраной/системами), чтобы оно отражало роль консоли Overwatch.

components:
- type: Sprite
sprite: Objects/Misc/qm_clipboard.rsi
layers:
- state: qm_clipboard
- state: qm_clipboard_paper
map: ["qm_clipboard_paper"]
visible: false
- state: qm_clipboard_pen
map: ["qm_clipboard_pen"]
visible: false
- state: qm_clipboard_over
- type: ContainerContainer
containers:
storagebase: !type:Container
ents: []
pen_slot: !type:ContainerSlot {}
- type: ItemSlots
slots:
pen_slot:
name: clipboard-slot-component-slot-name-pen
whitelist:
tags:
- Write
insertOnInteract: true
- type: Item
sprite: Objects/Misc/qm_clipboard.rsi
size: Small
- type: Clothing
slots: [belt]
quickEquip: false
sprite: Objects/Misc/qm_clipboard.rsi
- type: Storage
grid:
- 0,0,4,3
quickInsert: true
whitelist:
tags:
- Document
- type: StorageFill
contents: []
- type: ItemMapper
mapLayers:
qm_clipboard_paper:
whitelist:
tags:
- Document
qm_clipboard_pen:
whitelist:
tags:
- Write
- type: CargoOrderConsole
- type: BankClient
Comment on lines +287 to +288
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Лишние компоненты CargoOrderConsole и BankClient.

Компоненты CargoOrderConsole и BankClient не имеют отношения к функциональности Overwatch и, вероятно, были скопированы из QM-планшета по ошибке. Эти компоненты могут вызвать нежелательное поведение или конфликты UI.

Предлагаемое исправление — удалить лишние компоненты
       tags:
         - Write
-  - type: CargoOrderConsole
-  - type: BankClient
   - type: ActivatableUI
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- type: CargoOrderConsole
- type: BankClient
tags:
- Write
- type: ActivatableUI
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@Resources/Prototypes/_Rat/Entities/Structures/Machines/Computers/overwatch.yml`
around lines 287 - 288, В сущности Overwatch в файле overwatch.yml удалить
лишние компоненты: remove the entries "CargoOrderConsole" и "BankClient" из
списка компонентов (они находятся в блоке компонентов для Overwatch), чтобы
вернуть конфигурацию к назначенной функциональности и избежать конфликтов UI;
просто удалить эти два type-поля и сохранить YAML.

- type: ActivatableUI
verbText: overwatch-clipboard-computer-verb-text
key: enum.OverwatchUiKey.Key
- type: UserInterface
interfaces:
enum.OverwatchUiKey.Key:
type: Content.Client._Rat.Overwatch.OverwatchBoundUserInterface
enum.StorageUiKey.Key:
type: StorageBoundUserInterface
- type: MeleeWeapon
wideAnimationRotation: 180
damage:
types:
Blunt: 10

- type: entity
parent: BaseOverwatchClipboard
id: DSMOverwatchClipboard
name: overwatch console DSM
components:
- type: OverwatchConsole
faction: DSM

- type: entity
parent: BaseOverwatchClipboard
id: NCWLOverwatchClipboard
name: overwatch console NCWL
components:
- type: OverwatchConsole
faction: NCWL

- type: entity
parent: BaseOverwatchClipboard
id: SHIOverwatchClipboard
name: overwatch console SHI
components:
- type: OverwatchConsole
faction: SHI

- type: entity
parent: BaseOverwatchClipboard
id: TAPOverwatchClipboard
name: overwatch console TAP
components:
- type: OverwatchConsole
faction: TAP

- type: entity
parent: BaseOverwatchClipboard
id: IPMOverwatchClipboard
name: overwatch console IPM
components:
- type: OverwatchConsole
faction: IPM

- type: entity
parent: BaseOverwatchClipboard
id: SAWOverwatchClipboard
name: overwatch console SAW
components:
- type: OverwatchConsole
faction: SAW

- type: entity
parent: BaseOverwatchClipboard
id: GSCOverwatchClipboard
name: overwatch clipboard GSC
components:
- type: OverwatchConsole
faction: GSC
Comment on lines +352 to +358
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Несогласованность именования.

GSCOverwatchClipboard использует name: overwatch clipboard GSC, тогда как все остальные варианты используют name: overwatch console <Faction>. Это нарушает единообразие.

Предлагаемое исправление
 - type: entity
   parent: BaseOverwatchClipboard
   id: GSCOverwatchClipboard
-  name: overwatch clipboard GSC
+  name: overwatch console GSC
   components:
   - type: OverwatchConsole
     faction: GSC
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- type: entity
parent: BaseOverwatchClipboard
id: GSCOverwatchClipboard
name: overwatch clipboard GSC
components:
- type: OverwatchConsole
faction: GSC
- type: entity
parent: BaseOverwatchClipboard
id: GSCOverwatchClipboard
name: overwatch console GSC
components:
- type: OverwatchConsole
faction: GSC
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@Resources/Prototypes/_Rat/Entities/Structures/Machines/Computers/overwatch.yml`
around lines 352 - 358, Замените несоответствующее значение name для сущности с
id GSCOverwatchClipboard: текущий name "overwatch clipboard GSC" нужно
переименовать в "overwatch console GSC" чтобы соответствовать остальным
вариантам (см. другие сущности, использующие шаблон "overwatch console
<Faction>"). Проверьте запись компонента OverwatchConsole и наследование от
BaseOverwatchClipboard, чтобы имя стало единообразным с остальными записями.


- type: entity
parent: BaseOverwatchClipboard
id: CDOverwatchClipboard
name: overwatch console CD
components:
- type: OverwatchConsole
faction: CD
Loading