Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Conversation

@RedFoxIV
Copy link
Contributor

@RedFoxIV RedFoxIV commented Mar 18, 2024

Описание PR

image

Скриншоты

mechcock.webm

Чек-лист:

  • Rechecked all my code

typo:

  • Feature
  • Fix
  • Tweak
  • Balance

Changelog
🆑

  • add: Любимый, родной, забагованный, небалансный, а главное - твой. Мехкомп: скрась свою тусклую смену телепортом прямиком в космос или посмеши своих коллег спамом из динамиков прямиком в радио.

Summary by CodeRabbit

  • Новые функции

    • Внедрена система диалогов с улучшенными параметрами конфигурации, позволяющая создавать более сложные элементы пользовательского интерфейса.
    • Добавлена комплексная система управления механическими компонентами, включая кнопки, калькуляторы и телепорты, что улучшает интерактивность и визуальное представление.
    • Реализован механизм отключения для сущностей при их разанкеровке, поддерживающий целостность связей устройств.
  • Исправления ошибок

    • Улучшена обработка и разбор записей диалогов, увеличивающие удобство использования и надежность структуры данных.
  • Документация

    • Обновлена документация по конструкторам классов и методам для повышения ясности и контекста.
  • Задачи

    • Добавлены комментарии и заметки для улучшения поддерживаемости в отношении использования констант по всему коду.

@RedFoxIV
Copy link
Contributor Author

RedFoxIV commented Mar 18, 2024

todo:
[ ] Переделать мехкомпконфиги, чтобы значения хранились в самих компонентах (для нормальной сериализации)
[ ] Добавить рецепты ко всем компонентам
[ ] Убедиться в том, что телепорт не будет пытаться телепортировать с карты на карту (не проверял, но вроде будет)
[ ] Заменить все строки на локстроки
[ ] Добавить поддержку локализации
[ ] Подумать над тем, куда ещё можно присунуть поддержку мехкока на станции: телепорты это, конечно, смешно, но пока что больше ничего функционального в мехкоке нет.

todo Фичи:
[ ] Добавить в инженерку и/или рнд автомат по продаже мехкомповских деталей (сделать рецепты более дорогими?)
[ ] Вкл-выкл-выстрел мехкомпом для эмиттеров

@Valtosin

This comment was marked as spam.

@coderabbitai
Copy link

coderabbitai bot commented Aug 19, 2024

Walkthrough

Обновления вносят значительные улучшения в систему управления диалогами и механическими компонентами, повышая возможности взаимодействия с пользователем. Ключевые особенности включают новый класс QDEntry для структурированных диалоговых опций, расширенную функциональность в DialogWindow для динамической настройки управления и введение MechCompDeviceSystem для управления различными механическими компонентами. Эти изменения в совокупности повышают гибкость, читаемость и общее качество пользовательского опыта.

Changes

File(s) Change Summary
Content.Client/UserInterface/Controls/DialogWindow.xaml.cs Улучшены диалоговые элементы управления с новыми параметрами для динамических настроек и добавлено управление различными типами ввода.
Content.Server/Administration/QuickDialogSystem.OpenDialog.cs
Content.Server/Administration/QuickDialogSystem.cs
Обновлена обработка записей диалога с помощью структурированных объектов QDEntry для повышения безопасности типов и ясности.
Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs Введено управление событиями для приема сигналов для динамического управления выдачей реагентов.
Content.Server/DeviceLinking/Events/DeviceLinkTryConnectingAttemptEvent.cs
Content.Server/DeviceLinking/NetworkPayloadHelper.cs
Content.Server/DeviceLinking/Systems/*.cs
Добавлено управление событиями для связывания устройств, улучшая коммуникацию и управление состоянием между устройствами.
Content.Server/_White/MechComp/Devices/*.cs Введены различные системы механических устройств (например, кнопки, калькуляторы) для повышения интерактивности и функциональности.
Content.Shared/Administration/QDEntry.cs
Content.Shared/Administration/QuickDialogOpenEvent.cs
Создана структурированная репрезентация диалоговых опций, улучшая способность системы диалогов обрабатывать сложные вводы.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DialogSystem
    participant DialogWindow
    participant QDEntry

    User->>DialogSystem: Открыть диалог
    DialogSystem->>DialogWindow: Инициализировать диалог
    DialogWindow->>QDEntry: Создать записи
    QDEntry->>DialogWindow: Вернуть записи
    DialogWindow->>User: Показать диалог
    User->>DialogWindow: Ввести ответ
    DialogWindow->>DialogSystem: Отправить ответ
    DialogSystem->>User: Обработать ответ
Loading

🐇 В мире, полном шестеренок и пружин,
Заяц прыгает, и радость приносит!
С кнопками для нажатия и яркими диалогами,
Наш код — это танец, чистое удовольствие!
Давайте отпразднуем каждое новое творение,
В этой стране кода — грандиозное ощущение! 🍃


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 729f1ce and 00a2d59.

⛔ Files ignored due to path filters (28)
  • Resources/Audio/White/MechComp/emitter2.ogg is excluded by !**/*.ogg
  • Resources/Audio/White/MechComp/generic_energy_dryfire.ogg is excluded by !**/*.ogg
  • Resources/Textures/White/MechComp/base.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/button.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/button.rsi/piss.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/button.rsi/pressed.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/comparer.rsi/anchored.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/comparer.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/math.rsi/anchored.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/math.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/mechcomptool.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/mechcomptool.rsi/inhand-left.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/mechcomptool.rsi/inhand-right.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/mechcomptool.rsi/open.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/pressurepad.rsi/anchored.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/pressurepad.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/speaker.rsi/anchored.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/speaker.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/speaker.rsi/speak.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/teleport.rsi/anchored.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/teleport.rsi/charging.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/teleport.rsi/firing.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/teleport.rsi/glow(unused).png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/teleport.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/teleport.rsi/ready.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/transeiver.rsi/anchored.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/transeiver.rsi/blink.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/transeiver.rsi/icon.png is excluded by !**/*.png
📒 Files selected for processing (39)
  • Content.Client/UserInterface/Controls/DialogWindow.xaml.cs (7 hunks)
  • Content.Client/_White/MechComp/MechCompSystem.cs (1 hunks)
  • Content.Server/Administration/QuickDialogSystem.OpenDialog.cs (2 hunks)
  • Content.Server/Administration/QuickDialogSystem.cs (8 hunks)
  • Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs (4 hunks)
  • Content.Server/DeviceLinking/Events/DeviceLinkTryConnectingAttemptEvent.cs (1 hunks)
  • Content.Server/DeviceLinking/NetworkPayloadHelper.cs (1 hunks)
  • Content.Server/DeviceLinking/Systems/DeviceLinkSystem.cs (1 hunks)
  • Content.Server/DeviceLinking/Systems/DoorSignalControlSystem.cs (1 hunks)
  • Content.Server/DeviceLinking/Systems/EdgeDetectorSystem.cs (1 hunks)
  • Content.Server/DeviceLinking/Systems/LogicGateSystem.cs (1 hunks)
  • Content.Server/DeviceNetwork/DeviceNetworkConstants.cs (1 hunks)
  • Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs (2 hunks)
  • Content.Server/Entry/IgnoredComponents.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/Button.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/Calculator.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/Comparer.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/PressurePad.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/Speaker.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/Teleporter.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/Transeiver.cs (1 hunks)
  • Content.Server/_White/MechComp/DisconnectOnUnanchor.cs (1 hunks)
  • Content.Server/_White/MechComp/MechCompDeviceSystem.cs (1 hunks)
  • Content.Shared/Administration/QDEntry.cs (1 hunks)
  • Content.Shared/Administration/QuickDialogOpenEvent.cs (2 hunks)
  • Content.Shared/DeviceLinking/SharedDeviceLinkSystem.cs (1 hunks)
  • Content.Shared/_White/MechComp/MechComp.cs (1 hunks)
  • Resources/Prototypes/Entities/Objects/Devices/MechComp/generic_ports.yml (1 hunks)
  • Resources/Prototypes/Entities/Objects/Devices/MechComp/ports.yml (1 hunks)
  • Resources/Prototypes/Entities/Objects/Devices/MechComp/some.yml (1 hunks)
  • Resources/Textures/White/MechComp/base.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/button.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/comparer.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/math.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/mechcomptool.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/pressurepad.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/speaker.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/teleport.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/transeiver.rsi/meta.json (1 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

Outside diff range, codebase verification and nitpick comments (14)
Resources/Prototypes/Entities/Objects/Devices/MechComp/ports.yml (2)

16-16: Remove trailing spaces.

Trailing spaces are present on these lines. Removing them will improve the file's formatting.

-   
+ 

Also applies to: 48-48, 50-51

Tools
yamllint

[error] 16-16: trailing spaces

(trailing-spaces)


23-23: Reduce excessive blank lines.

There are too many blank lines here. Reducing them to two will improve readability.

- 
Tools
yamllint

[warning] 23-23: too many blank lines

(3 > 2) (empty-lines)

Content.Server/DeviceLinking/NetworkPayloadHelper.cs (1)

19-19: Remove unprofessional language from comments.

The comments contain unprofessional language. Consider rephrasing to maintain a professional tone.

- // DeviceNetworkConstants is in Content.Server, which cannot be accessed from shared. Fuck you whoever designed this.
+ // DeviceNetworkConstants is in Content.Server and cannot be accessed from shared. This design choice limits access.

Also applies to: 24-24

Content.Shared/Administration/QDEntry.cs (1)

11-12: Consider rephrasing the warning comment.

The comment in the class documentation uses strong language. Consider rephrasing it to maintain a professional tone while still conveying the importance of not passing null values incorrectly.

/// Avoid passing <see langword="null"/> to Value unless the type is <see langword="null"/>, typeof(void), or typeof(VoidOption). Incorrect usage may lead to errors.
Resources/Prototypes/Entities/Objects/Devices/MechComp/some.yml (6)

30-30: Reduce the number of blank lines.

There are too many blank lines here. Consider reducing them to improve readability.

- 
Tools
yamllint

[warning] 30-30: too many blank lines

(3 > 2) (empty-lines)


83-83: Remove trailing spaces.

Trailing spaces are present on this line. Removing them can improve the file's cleanliness.

- 
Tools
yamllint

[error] 83-83: trailing spaces

(trailing-spaces)


106-106: Remove trailing spaces.

Trailing spaces are present on this line. Removing them can improve the file's cleanliness.

- 
Tools
yamllint

[error] 106-106: trailing spaces

(trailing-spaces)


139-139: Correct indentation.

The indentation is incorrect. It should be 12 spaces instead of 10.

-          layer:
+            layer:
Tools
yamllint

[warning] 139-139: wrong indentation: expected 12 but found 10

(indentation)


147-147: Correct indentation.

The indentation is incorrect. It should be 12 spaces instead of 10.

-          mask:
+            mask:
Tools
yamllint

[warning] 147-147: wrong indentation: expected 12 but found 10

(indentation)


167-167: Add a newline at the end of the file.

A newline at the end of the file is missing. Adding it improves compatibility with various tools.

-
Tools
yamllint

[error] 167-167: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/Entities/Objects/Devices/MechComp/generic_ports.yml (4)

145-148: Remove excessive blank lines.

There are too many blank lines here. Consider reducing them to improve readability.

- 

146-146: Remove excessive blank lines.

There are too many blank lines here. Consider reducing them to improve readability.

- 

147-147: Remove excessive blank lines.

There are too many blank lines here. Consider reducing them to improve readability.

- 

148-148: Remove excessive blank lines.

There are too many blank lines here. Consider reducing them to improve readability.

- 
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 729f1ce and 00a2d59.

Files ignored due to path filters (28)
  • Resources/Audio/White/MechComp/emitter2.ogg is excluded by !**/*.ogg
  • Resources/Audio/White/MechComp/generic_energy_dryfire.ogg is excluded by !**/*.ogg
  • Resources/Textures/White/MechComp/base.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/button.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/button.rsi/piss.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/button.rsi/pressed.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/comparer.rsi/anchored.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/comparer.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/math.rsi/anchored.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/math.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/mechcomptool.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/mechcomptool.rsi/inhand-left.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/mechcomptool.rsi/inhand-right.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/mechcomptool.rsi/open.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/pressurepad.rsi/anchored.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/pressurepad.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/speaker.rsi/anchored.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/speaker.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/speaker.rsi/speak.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/teleport.rsi/anchored.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/teleport.rsi/charging.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/teleport.rsi/firing.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/teleport.rsi/glow(unused).png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/teleport.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/teleport.rsi/ready.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/transeiver.rsi/anchored.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/transeiver.rsi/blink.png is excluded by !**/*.png
  • Resources/Textures/White/MechComp/transeiver.rsi/icon.png is excluded by !**/*.png
Files selected for processing (39)
  • Content.Client/UserInterface/Controls/DialogWindow.xaml.cs (7 hunks)
  • Content.Client/_White/MechComp/MechCompSystem.cs (1 hunks)
  • Content.Server/Administration/QuickDialogSystem.OpenDialog.cs (2 hunks)
  • Content.Server/Administration/QuickDialogSystem.cs (8 hunks)
  • Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs (4 hunks)
  • Content.Server/DeviceLinking/Events/DeviceLinkTryConnectingAttemptEvent.cs (1 hunks)
  • Content.Server/DeviceLinking/NetworkPayloadHelper.cs (1 hunks)
  • Content.Server/DeviceLinking/Systems/DeviceLinkSystem.cs (1 hunks)
  • Content.Server/DeviceLinking/Systems/DoorSignalControlSystem.cs (1 hunks)
  • Content.Server/DeviceLinking/Systems/EdgeDetectorSystem.cs (1 hunks)
  • Content.Server/DeviceLinking/Systems/LogicGateSystem.cs (1 hunks)
  • Content.Server/DeviceNetwork/DeviceNetworkConstants.cs (1 hunks)
  • Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs (2 hunks)
  • Content.Server/Entry/IgnoredComponents.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/Button.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/Calculator.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/Comparer.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/PressurePad.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/Speaker.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/Teleporter.cs (1 hunks)
  • Content.Server/_White/MechComp/Devices/Transeiver.cs (1 hunks)
  • Content.Server/_White/MechComp/DisconnectOnUnanchor.cs (1 hunks)
  • Content.Server/_White/MechComp/MechCompDeviceSystem.cs (1 hunks)
  • Content.Shared/Administration/QDEntry.cs (1 hunks)
  • Content.Shared/Administration/QuickDialogOpenEvent.cs (2 hunks)
  • Content.Shared/DeviceLinking/SharedDeviceLinkSystem.cs (1 hunks)
  • Content.Shared/_White/MechComp/MechComp.cs (1 hunks)
  • Resources/Prototypes/Entities/Objects/Devices/MechComp/generic_ports.yml (1 hunks)
  • Resources/Prototypes/Entities/Objects/Devices/MechComp/ports.yml (1 hunks)
  • Resources/Prototypes/Entities/Objects/Devices/MechComp/some.yml (1 hunks)
  • Resources/Textures/White/MechComp/base.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/button.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/comparer.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/math.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/mechcomptool.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/pressurepad.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/speaker.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/teleport.rsi/meta.json (1 hunks)
  • Resources/Textures/White/MechComp/transeiver.rsi/meta.json (1 hunks)
Files skipped from review due to trivial changes (7)
  • Content.Server/DeviceNetwork/DeviceNetworkConstants.cs
  • Content.Server/Entry/IgnoredComponents.cs
  • Resources/Textures/White/MechComp/base.rsi/meta.json
  • Resources/Textures/White/MechComp/button.rsi/meta.json
  • Resources/Textures/White/MechComp/comparer.rsi/meta.json
  • Resources/Textures/White/MechComp/math.rsi/meta.json
  • Resources/Textures/White/MechComp/pressurepad.rsi/meta.json
Additional context used
yamllint
Resources/Prototypes/Entities/Objects/Devices/MechComp/ports.yml

[error] 16-16: trailing spaces

(trailing-spaces)


[warning] 23-23: too many blank lines

(3 > 2) (empty-lines)


[error] 48-48: trailing spaces

(trailing-spaces)


[error] 50-50: trailing spaces

(trailing-spaces)


[error] 51-51: trailing spaces

(trailing-spaces)

Resources/Prototypes/Entities/Objects/Devices/MechComp/some.yml

[warning] 30-30: too many blank lines

(3 > 2) (empty-lines)


[error] 83-83: trailing spaces

(trailing-spaces)


[error] 106-106: trailing spaces

(trailing-spaces)


[warning] 139-139: wrong indentation: expected 12 but found 10

(indentation)


[warning] 147-147: wrong indentation: expected 12 but found 10

(indentation)


[error] 167-167: no new line character at the end of file

(new-line-at-end-of-file)

Additional comments not posted (59)
Resources/Textures/White/MechComp/transeiver.rsi/meta.json (1)

1-28: LGTM!

The JSON structure is valid and the animation states are well-defined.

Resources/Textures/White/MechComp/speaker.rsi/meta.json (1)

1-30: LGTM!

The JSON structure is valid and the animation states are well-defined.

Resources/Textures/White/MechComp/teleport.rsi/meta.json (1)

1-47: LGTM!

The JSON structure is valid and the animation states are well-defined.

Resources/Textures/White/MechComp/mechcomptool.rsi/meta.json (1)

1-41: LGTM!

The JSON structure is valid and the animation states are well-defined.

Content.Server/DeviceLinking/Events/DeviceLinkTryConnectingAttemptEvent.cs (1)

1-22: LGTM! Consider adding cancellation reasons.

The class is well-structured. Consider implementing the commented-out cancellation reason for enhanced functionality.

Content.Server/_White/MechComp/DisconnectOnUnanchor.cs (1)

11-33: Clarify the purpose of commented-out code.

The entire code is commented out. If this is a placeholder or deprecated code, consider removing it. If it's intended for future use, add a comment explaining its purpose and any pending tasks.

Content.Server/DeviceLinking/Systems/EdgeDetectorSystem.cs (1)

30-30: LGTM! Verify usage of TryGetState.

The change to use TryGetState enhances readability. Ensure that all relevant parts of the codebase are updated to use this new method.

Verification successful

Verify consistent usage of TryGetState across the codebase

The TryGetState method is used consistently across multiple files in the codebase. Here are some key locations where it appears:

  • Content.Server/DeviceLinking/Systems/EdgeDetectorSystem.cs
  • Content.Server/DeviceLinking/Systems/DoorSignalControlSystem.cs
  • Content.Server/DeviceLinking/Systems/LogicGateSystem.cs
  • Content.Client/_Ohio/UI/AnimatedBackgroundControl.cs
  • Content.Client/SprayPainter/SprayPainterSystem.cs

Ensure that all usages align with the intended logic and functionality of the TryGetState method.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify usage of the `TryGetState` method across the codebase.

# Test: Search for the method usage. Expect: Consistent usage across the codebase.
rg --type-add 'cs' --type 'cs' -w 'TryGetState'

Length of output: 103


Script:

#!/bin/bash
# Description: Verify usage of the `TryGetState` method across the codebase.

# Test: Search for the method usage. Expect: Consistent usage across the codebase.
rg -t cs -w 'TryGetState'

Length of output: 2605

Content.Server/_White/MechComp/Devices/PressurePad.cs (1)

11-18: Ensure all event handlers are necessary.

The InitPressurePad method subscribes to multiple events. Ensure that each event handler is required for the functionality of the pressure pad. Unused or unnecessary event handlers should be removed to avoid potential performance issues.

Content.Server/_White/MechComp/Devices/Speaker.cs (2)

23-28: Ensure default values are set appropriately.

In OnSpeakerInit, ensure that the default name is set correctly and that _link.EnsureSinkPorts is called with the correct parameters. This helps avoid issues with uninitialized or incorrectly initialized components.


42-56: Review signal handling logic for potential improvements.

The OnSpeakerSignal method handles signals and sends messages. Ensure that the cooldown logic is correctly implemented and that the message sending logic adheres to the expected behavior. Consider refactoring the message sending logic into a separate method for clarity.

Content.Server/_White/MechComp/Devices/Transeiver.cs (2)

26-30: Ensure ID assignment logic is robust.

In OnTranseiverInit, ensure that the ID assignment logic is robust and handles edge cases. Consider logging or handling cases where the ID is outside the expected range.


42-54: Review signal propagation logic.

The OnTranseiverSignalReceived method propagates signals to other components. Ensure that the logic correctly identifies and activates the target components. Consider adding logging for signal propagation events for easier debugging.

Content.Server/_White/MechComp/Devices/Calculator.cs (1)

34-35: Ensure default mode is valid.

In OnMathInit, ensure that the default mode is valid and corresponds to a key in _mathFuncs. Consider logging a warning if the mode is not found and a default is assigned.

Content.Shared/_White/MechComp/MechComp.cs (8)

15-17: LGTM!

The SharedMechCompDeviceSystem class is appropriately defined as an abstract class, ready for future expansion.


19-24: LGTM!

The BaseMechCompComponent class is simple and correctly configured with a DataField.


30-39: LGTM!

The MechCompButtonComponent class is well-defined with appropriate fields for sound and signal configuration.


41-49: LGTM!

The MechCompSpeakerComponent class is correctly configured with fields for animation and radio settings.


52-62: LGTM! Consider verifying teleport ID uniqueness.

The MechCompTeleportComponent class is well-structured, but ensure teleport IDs are unique across instances to prevent conflicts.


84-92: LGTM! Ensure mode synchronization.

The MechCompMathComponent class is correctly defined. Verify that the mode is synchronized with server-side operations.


96-103: LGTM!

The MechCompPressurePadComponent class is straightforward and correctly configured.


106-118: LGTM! Ensure mode synchronization.

The MechCompComparerComponent class is well-structured. Verify that the mode is synchronized with server-side operations.

Content.Server/DeviceLinking/Systems/DoorSignalControlSystem.cs (1)

40-40: Simplified state retrieval with TryGetState.

The change to use TryGetState improves readability and maintainability. Ensure that TryGetState is correctly implemented and used across the system.

Verification successful

TryGetState is correctly implemented and used across the system.

The method TryGetState is implemented in Content.Server/DeviceLinking/NetworkPayloadHelper.cs and is used in various places across the codebase, supporting the review comment's assertion about its readability and maintainability improvements.

  • Implementation found in Content.Server/DeviceLinking/NetworkPayloadHelper.cs.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation of `TryGetState`.

# Test: Search for the implementation of `TryGetState`. Expect: A method definition.
rg --type python 'def TryGetState'

Length of output: 67


Script:

#!/bin/bash
# Description: Verify the implementation of `TryGetState` in C# files.

# Test: Search for the implementation of `TryGetState`. Expect: A method definition.
rg 'TryGetState' --type cs -A 5

Length of output: 10205

Content.Shared/Administration/QuickDialogOpenEvent.cs (2)

155-157: New OptionList entry type added.

The addition of OptionList to QuickDialogEntryType broadens dialog capabilities. Ensure this type is supported in dialog implementations.


96-111: Enhanced dialog entry with Info property.

The addition of the Info property allows for more complex dialog controls. Ensure that this property is used correctly in dialog implementations.

Verification successful

Info property usage verified in dialog implementations.

The Info property is being utilized in dialog-related code, confirming its integration for enhancing dialog entries with additional information. Notable usages include:

  • Content.Server/Administration/QuickDialogSystem.cs
  • Content.Client/UserInterface/Controls/DialogWindow.xaml.cs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the `Info` property in dialog implementations.

# Test: Search for the usage of `Info` in dialog-related code. Expect: Instances where `Info` is utilized.
rg --type python '\.Info'

Length of output: 58


Script:

#!/bin/bash
# Description: Verify the usage of the `Info` property in dialog-related code within C# files.

# Test: Search for the usage of `Info` in C# files. Expect: Instances where `Info` is utilized.
rg --type cs '\.Info'

Length of output: 23990

Content.Server/_White/MechComp/Devices/Teleporter.cs (4)

11-17: LGTM!

The InitTeleport method correctly initializes event subscriptions for teleportation components.


20-25: LGTM! Consider verifying teleport ID uniqueness.

The OnTeleportInit method is well-implemented. Ensure teleport IDs are unique across instances to prevent conflicts.


27-31: LGTM!

The OnTeleportConfigAttempt method correctly adds configuration entries for teleport components.


37-103: Verify signal handling and teleportation logic.

The OnTeleportSignal method is complex and handles various aspects of teleportation. Ensure correctness in signal parsing, target validation, and cooldown management.

Content.Server/_White/MechComp/Devices/Comparer.cs (4)

11-17: LGTM!

The InitComparer method correctly initializes event subscriptions for comparer components.


19-27: LGTM! Verify completeness of comparison modes.

The _compareFuncs dictionary is well-defined. Ensure all necessary comparison modes are included for the system's requirements.


48-57: LGTM!

The OnComparerConfigAttempt method correctly adds configuration entries for comparer components.


69-102: Verify signal handling and comparison evaluation.

The OnComparerSignal method processes signals and evaluates comparisons. Ensure correctness in signal handling and comparison logic.

Content.Server/DeviceLinking/Systems/LogicGateSystem.cs (1)

101-101: Ensure TryGetState method handles all expected cases.

The change to use TryGetState instead of a constant-based retrieval simplifies the code. Verify that TryGetState can handle all expected signal states correctly.

Verification successful

Verification Successful: TryGetState Handles Expected Signal States

The TryGetState method in Content.Server/DeviceLinking/NetworkPayloadHelper.cs is implemented to manage different signal states by checking for both "logic_state" and "mechcomp_data". This ensures it handles expected cases appropriately.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify that `TryGetState` is implemented to handle all expected signal states.

# Test: Search for the `TryGetState` implementation. Expect: The method should handle various signal states.
ast-grep --lang csharp --pattern 'TryGetState(out $_)'

Length of output: 56


Script:

#!/bin/bash
# Search for the definition of the `TryGetState` method to verify its implementation.
rg 'TryGetState' -A 10 --glob='*.cs'

Length of output: 17137

Content.Server/DeviceLinking/Systems/DeviceLinkSystem.cs (1)

85-85: Confirm the usage of the new data parameter in SignalReceivedEvent.

The addition of the data parameter enriches the event payload. Ensure that all listeners of SignalReceivedEvent are updated to handle this new information.

Content.Client/UserInterface/Controls/DialogWindow.xaml.cs (6)

39-39: Update the ControlConstructor delegate.

The addition of the info parameter allows for more flexible control setups. Ensure that all usages of this delegate are updated accordingly.


66-66: Ensure info is correctly utilized in control setups.

The info parameter is extracted from QuickDialogEntry. Verify that this information is used effectively in control setups.


89-89: Add SetupRadio for OptionList entries.

The new SetupRadio method supports OptionList entries, enhancing dialog flexibility. Ensure this method is complete and handles all necessary cases.


96-99: Review usage of setup method.

The setup method now includes the info parameter. Confirm that this parameter is used appropriately in all control setup methods.


Line range hint 170-217: Review changes to setup methods.

The setup methods now include an additional parameter. Ensure that this parameter is used effectively and does not introduce any issues.


219-228: Ensure SetupRadio method is complete.

The SetupRadio method is introduced to handle radio button setups. Verify that it correctly processes the info parameter and populates options.

Content.Server/Administration/QuickDialogSystem.cs (3)

121-123: LGTM!

The use of the info parameter to handle OptionList entry types in TryParseQuickDialogList is appropriate and improves functionality.


202-214: LGTM!

The implementation for the OptionList entry type correctly utilizes the info parameter to validate input, enhancing the method's flexibility.


241-242: LGTM!

Recognizing List<string> as OptionList in TypeToEntryType is a necessary and well-implemented change to support the new entry type.

Content.Client/_White/MechComp/MechCompSystem.cs (6)

30-33: LGTM!

The GetMode method correctly uses the appearance system to retrieve the mode of a mechcomp device.


34-48: LGTM!

The _prepFlickAnim method is well-structured and effectively sets up an animation with the specified parameters.


51-64: LGTM!

The event subscriptions in the Initialize method are appropriate for setting up the mechcomp system.


70-75: LGTM!

The OnButtonAppearanceChange method correctly handles appearance changes and plays the appropriate animation.


98-122: LGTM!

The OnTeleportAppearanceChange method is well-implemented, handling different modes and playing animations appropriately.


201-216: LGTM!

The SafePlayExt.SafePlay method is a useful addition for safely managing animations without conflicts.

Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs (1)

59-59: LGTM!

Subscribing to SignalReceivedEvent in the Initialize method is a logical extension for handling signals related to reagent dispensing.

Content.Server/_White/MechComp/MechCompDeviceSystem.cs (6)

69-83: LGTM!

The event subscriptions in the Initialize method are appropriate for setting up the mechcomp system.


91-121: LGTM!

The OpenMechCompConfigDialog method is well-structured and effectively uses the dialog system to open configuration dialogs.


144-156: LGTM!

The Cooldown method is correctly implemented, providing a convenient way to manage cooldowns for mechcomp devices.


196-208: LGTM!

The SendMechCompSignal method is well-implemented, ensuring signals are sent with the correct payload using the device link system.


267-274: LGTM!

The OnConnectUIAttempt method correctly checks if the component is anchored before allowing connections, ensuring proper functionality.


287-297: LGTM!

The OnAnchorStateChanged method is well-implemented, managing device links based on the anchor state of mechcomp components.

Content.Shared/DeviceLinking/SharedDeviceLinkSystem.cs (1)

368-378: LGTM!

The RemoveAllFromSource method is well-implemented, providing useful functionality for managing device links by removing all links from a given source entity.

Content.Server/Administration/QuickDialogSystem.OpenDialog.cs (1)

575-582: LGTM! Verify the usage of the new QDEntry type.

The transition from tuples to QDEntry objects enhances readability and type safety. Ensure that all usages of this method and the QDEntry type are updated accordingly across the codebase.

Verification successful

Verification Successful: Consistent Usage of OpenDialog and QDEntry

The transition to using the QDEntry type in the OpenDialog method has been consistently applied across the codebase. The implicit operators in QDEntry ensure backward compatibility and ease of use. All instances of OpenDialog reflect the new method signature. No further action is required.

  • QDEntry is defined and used consistently in Content.Shared/Administration/QDEntry.cs.
  • OpenDialog usages in various files align with the new method signature.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of the `OpenDialog` method and `QDEntry` type in the codebase.

# Test: Search for the `OpenDialog` method usage. Expect: Only occurrences with the new signature.
rg --type cs 'OpenDialog\('

# Test: Search for the `QDEntry` type usage. Expect: Consistent usage across the codebase.
rg --type cs 'QDEntry'

Length of output: 3719

Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs (1)

166-172: LGTM! Verify the event handling logic.

The addition of DeviceLinkTryConnectingAttemptEvent provides a robust mechanism for controlling device linking attempts. Ensure that the event is handled appropriately in all relevant parts of the codebase.

Verification successful

Event Handling Logic Verified

The OnConnectUIAttempt method effectively handles the DeviceLinkTryConnectingAttemptEvent by ensuring that only anchored components can proceed with linking. This implementation aligns with the intended functionality of the event, providing robust control over the linking process. No further action is required.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the handling of `DeviceLinkTryConnectingAttemptEvent` across the codebase.

# Test: Search for the event handling. Expect: Proper handling logic in relevant event subscribers.
rg --type cs 'DeviceLinkTryConnectingAttemptEvent'

Length of output: 941


Script:

#!/bin/bash
# Description: Retrieve the implementation of the OnConnectUIAttempt method to verify the handling of the DeviceLinkTryConnectingAttemptEvent.
ast-grep --lang cs --pattern 'private void OnConnectUIAttempt($_, $_, DeviceLinkTryConnectingAttemptEvent $_) { $$$ }'

Length of output: 120


Script:

#!/bin/bash
# Description: Search for the implementation of the OnConnectUIAttempt method using rg.
rg --type cs 'OnConnectUIAttempt'

Length of output: 436


Script:

#!/bin/bash
# Description: Extract the implementation of the OnConnectUIAttempt method with context lines.
rg --type cs 'private void OnConnectUIAttempt' -A 20

Length of output: 2180


private void OnButtonInit(EntityUid uid, MechCompButtonComponent comp, ComponentInit args)
{
_link.EnsureSourcePorts(uid, "MechCompStandardOutput");
Copy link

Choose a reason for hiding this comment

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

Use constants for signal strings.

Consider using constants for signal strings like "MechCompStandardOutput" to improve maintainability and reduce the risk of typos.

private const string MechCompStandardOutputSignal = "MechCompStandardOutput";

// Usage
_link.EnsureSourcePorts(uid, MechCompStandardOutputSignal);
SendMechCompSignal(uid, MechCompStandardOutputSignal, comp.outSignal);

Also applies to: 45-45

Comment on lines +24 to +28
public void OnPressurePadConfigAttempt(EntityUid uid, MechCompPressurePadComponent comp, MechCompConfigAttemptEvent args)
{
args.entries.Add((typeof(bool), "Реагировать на существ", comp.reactToMobs));
args.entries.Add((typeof(bool), "Реагировать на предметы", comp.reactToItems));
}
Copy link

Choose a reason for hiding this comment

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

Consider localization for configuration entries.

The configuration entries for the pressure pad use hardcoded strings in Russian. Consider using a localization system to support multiple languages and improve accessibility.

args.entries.Add((typeof(bool), Loc.GetString("react-to-mobs"), comp.reactToMobs));
args.entries.Add((typeof(bool), Loc.GetString("react-to-items"), comp.reactToItems));

Comment on lines +42 to +51
if (HasComp<MobStateComponent>(args.Tripper) && comp.reactToMobs)
{
SendMechCompSignal(uid, "MechCompStandardOutput", Comp<MetaDataComponent>(args.Tripper).EntityName);
return;
}
if (HasComp<ItemComponent>(args.Tripper) && comp.reactToItems)
{
SendMechCompSignal(uid, "MechCompStandardOutput", Comp<MetaDataComponent>(args.Tripper).EntityName);
return;
}
Copy link

Choose a reason for hiding this comment

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

Refactor duplicate logic in step handling.

The logic for sending a mechcomp signal is duplicated for both mobs and items. Consider refactoring this into a helper method to improve maintainability and reduce code duplication.

private void HandleStep(EntityUid uid, MechCompPressurePadComponent comp, EntityUid tripper, bool condition)
{
    if (condition)
    {
        SendMechCompSignal(uid, "MechCompStandardOutput", Comp<MetaDataComponent>(tripper).EntityName);
    }
}

// Usage
if (HasComp<MobStateComponent>(args.Tripper))
{
    HandleStep(uid, comp, args.Tripper, comp.reactToMobs);
}
else if (HasComp<ItemComponent>(args.Tripper))
{
    HandleStep(uid, comp, args.Tripper, comp.reactToItems);
}

Comment on lines +32 to +34
args.entries.Add((typeof(bool), "Голосить в радио (;)", comp.inRadio));
args.entries.Add((typeof(string), "Имя", comp.name));
}
Copy link

Choose a reason for hiding this comment

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

Consider localization for configuration entries.

The configuration entries for the speaker use hardcoded strings in Russian. Consider using a localization system to support multiple languages and improve accessibility.

args.entries.Add((typeof(bool), Loc.GetString("speak-in-radio"), comp.inRadio));
args.entries.Add((typeof(string), Loc.GetString("name"), comp.name));

Comment on lines +40 to +46
public QDEntry(Type? type, string description, object? Value = null, object? info = null)
{
this.type = type;
this.description = description;
this.Value = Value;
this.info = info;
}
Copy link

Choose a reason for hiding this comment

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

Validate constructor parameters.

Consider adding validation for the constructor parameters to ensure that type, description, and Value are set to appropriate values. This can prevent potential errors when using the QDEntry class.

public QDEntry(Type? type, string description, object? Value = null, object? info = null)
{
    if (type == null && Value != null)
        throw new ArgumentException("Value must be null if type is null.", nameof(Value));

    this.type = type;
    this.description = description;
    this.Value = Value;
    this.info = info;
}

Comment on lines +12 to +23
private Dictionary<string, Func<float, float, float?>> _mathFuncs = new()
{
["A+B"] = (a, b) => { return a + b; },
["A-B"] = (a, b) => { return a - b; },
["A*B"] = (a, b) => { return a * b; },
["A/B"] = (a, b) => { if (b == 0) return null; return a / b; },
["A^B"] = (a, b) => { return MathF.Pow(a, b); },
["A//B"] = (a, b) => { return (float) (int) (a / b); },
["A%B"] = (a, b) => { return a % b; },
["sin(A)^B"] = (a, b) => { return MathF.Pow(MathF.Sin(a), b); },
["cos(A)^B"] = (a, b) => { return MathF.Pow(MathF.Cos(a), b); }
};
Copy link

Choose a reason for hiding this comment

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

Consider handling division by zero more gracefully.

In the _mathFuncs dictionary, the division operation returns null for division by zero. Consider logging a warning or providing a default value to prevent potential issues.

["A/B"] = (a, b) => { if (b == 0) { Log.Warning("Division by zero."); return 0; } return a / b; },

Comment on lines +58 to +80
string sig; float num; // hurr durr
switch (args.Port)
{
case "MechCompNumericInputA":
if(TryGetMechCompSignal(args.Data, out sig) && float.TryParse(sig, out num))
{
comp.A = num;
}
break;
case "MechCompNumericInputB":
if (TryGetMechCompSignal(args.Data, out sig) && float.TryParse(sig, out num))
{
comp.B = num;
}
break;
case "Trigger":
float? result = _mathFuncs[comp.mode](comp.A, comp.B);
if (result != null)
{
SendMechCompSignal(uid, "MechCompNumericOutput", result.ToString()!);
}
break;
}
Copy link

Choose a reason for hiding this comment

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

Refactor signal handling logic for clarity.

The OnMathSignal method handles different signal ports. Consider refactoring the logic into separate methods for each port to improve clarity and maintainability.

private void HandleNumericInputA(EntityUid uid, MechCompMathComponent comp, string data)
{
    if (float.TryParse(data, out var num))
    {
        comp.A = num;
    }
}

private void HandleNumericInputB(EntityUid uid, MechCompMathComponent comp, string data)
{
    if (float.TryParse(data, out var num))
    {
        comp.B = num;
    }
}

private void HandleTrigger(EntityUid uid, MechCompMathComponent comp)
{
    float? result = _mathFuncs[comp.mode](comp.A, comp.B);
    if (result != null)
    {
        SendMechCompSignal(uid, "MechCompNumericOutput", result.ToString()!);
    }
}

// Usage
switch (args.Port)
{
    case "MechCompNumericInputA":
        if (TryGetMechCompSignal(args.Data, out var sig))
            HandleNumericInputA(uid, comp, sig);
        break;
    case "MechCompNumericInputB":
        if (TryGetMechCompSignal(args.Data, out var sig))
            HandleNumericInputB(uid, comp, sig);
        break;
    case "Trigger":
        HandleTrigger(uid, comp);
        break;
}

Comment on lines +99 to +109
private void OnSignalReceived(EntityUid uid, ReagentDispenserComponent component, ref SignalReceivedEvent args)
{
//if (args.Data != null && args.Data.TryGetValue("mechcomp_data", out string? signal))
//{
// string[] arr = signal!.Split('='); // expecting signal of format reagentname=volume
// if (arr.Length != 2) return;
// if (!GetInventory((uid, component)).Contains(arr[0])) return;
// if (!int.TryParse(arr[1], out var num) || num <= 0) return;
// // todo: how the fuck do i make it piss out potassium???
//}
}
Copy link

Choose a reason for hiding this comment

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

Consider implementing the signal handling logic.

The OnSignalReceived method is currently commented out. Implementing this logic will enable dynamic reagent management based on incoming signals.

@ThereDrD0
Copy link
Contributor

@coderabbitai configuration

@coderabbitai
Copy link

coderabbitai bot commented Oct 2, 2024

CodeRabbit configuration
language: en-US
tone_instructions: ''
early_access: false
enable_free_tier: true
reviews:
  profile: chill
  request_changes_workflow: false
  high_level_summary: true
  high_level_summary_placeholder: '@coderabbitai summary'
  auto_title_placeholder: '@coderabbitai'
  review_status: true
  poem: true
  collapse_walkthrough: false
  sequence_diagrams: true
  changed_files_summary: true
  labeling_instructions: []
  path_filters: []
  path_instructions: []
  abort_on_close: true
  auto_review:
    enabled: true
    auto_incremental_review: true
    ignore_title_keywords: []
    labels: []
    drafts: false
    base_branches: []
  tools:
    shellcheck:
      enabled: true
    ruff:
      enabled: true
    markdownlint:
      enabled: true
    github-checks:
      enabled: true
      timeout_ms: 90000
    languagetool:
      enabled: true
      enabled_only: false
      level: default
    biome:
      enabled: true
    hadolint:
      enabled: true
    swiftlint:
      enabled: true
    phpstan:
      enabled: true
      level: default
    golangci-lint:
      enabled: true
    yamllint:
      enabled: true
    gitleaks:
      enabled: true
    checkov:
      enabled: true
    detekt:
      enabled: true
    eslint:
      enabled: true
    rubocop:
      enabled: true
    buf:
      enabled: true
    regal:
      enabled: true
    actionlint:
      enabled: true
    pmd:
      enabled: true
    cppcheck:
      enabled: true
    semgrep:
      enabled: true
    circleci:
      enabled: true
chat:
  auto_reply: true
knowledge_base:
  opt_out: false
  learnings:
    scope: auto
  issues:
    scope: auto
  jira:
    project_keys: []
  linear:
    team_keys: []
  pull_requests:
    scope: auto

@github-actions
Copy link

github-actions bot commented Feb 9, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants