StarLight Import: Modular computer sprites#25
StarLight Import: Modular computer sprites#25ESphagnum wants to merge 2 commits intoss14-art:masterfrom
Conversation
|
RSI Diff Bot; head commit a06ed0a merging into 60d454b Resources/Textures/_StarLight/Structures/Machines/computers.rsi
|
📝 WalkthroughОбзорДобавлена новая система Изменения
Оценка трудозатрат на код-ревью🎯 3 (Средняя сложность) | ⏱️ ~25 минут Рекомендуемые метки
Поэма
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Resources/Prototypes/Entities/Structures/Machines/Computers/frame.yml (1)
75-92:⚠️ Potential issue | 🟠 MajorОтсутствует слой
computerLayerBodyв компоненте Sprite.
GenericVisualizerссылается на слойcomputerLayerBody(строка 87), но компонентSprite(строки 75-78) определяет только простое состояниеstate: brokenбез карты слоёв. Визуализатор не сможет обновить спрайт.🐛 Предлагаемое исправление
- type: Sprite sprite: Structures/Machines/computers.rsi drawdepth: Objects - state: broken + layers: + - map: ["computerLayerBody"] + state: broken # Starlight Start - type: EdgeConnection connectionKey: computers allowedDirections: East, West - type: Appearance - type: GenericVisualizer visuals: enum.EdgeConnectionVisuals.ConnectionMask: computerLayerBody: None: { state: broken, sprite: Structures/Machines/computers.rsi } - West: { state: computer_r-broken, sprite: _Starlight/Structures/Machines/computers.rsi } - East: { state: computer_l-broken, sprite: _Starlight/Structures/Machines/computers.rsi } - East, West: { state: computer_l_r-broken, sprite: _Starlight/Structures/Machines/computers.rsi } + West: { state: computer_r-broken, sprite: _StarLight/Structures/Machines/computers.rsi } + East: { state: computer_l-broken, sprite: _StarLight/Structures/Machines/computers.rsi } + East, West: { state: computer_l_r-broken, sprite: _StarLight/Structures/Machines/computers.rsi } # Starlight End🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Resources/Prototypes/Entities/Structures/Machines/Computers/frame.yml` around lines 75 - 92, GenericVisualizer references the layer key computerLayerBody but the Sprite component only declares a simple state (state: broken), so the visualizer cannot update that layer; update the Sprite entry used by this entity (the Sprite block with sprite: Structures/Machines/computers.rsi and state: broken) to declare a layer mapping for computerLayerBody that exposes the same states referenced by GenericVisualizer (broken, computer_r-broken, computer_l-broken, computer_l_r-broken) and point the appropriate sprite paths (Structures/Machines/computers.rsi and _Starlight/Structures/Machines/computers.rsi) so GenericVisualizer can switch that layer at runtime.
🧹 Nitpick comments (2)
Content.Shared/_StarLight/EdgeConnection/EdgeConnectionComponent.cs (1)
3-3: Несоответствие регистра: namespace vs путь к папке.Та же проблема, что и в
EdgeConnectionVisuals.cs— namespace_Starlightне соответствует папке_StarLight.♻️ Предлагаемое исправление
-namespace Content.Shared._Starlight.EdgeConnection; +namespace Content.Shared._StarLight.EdgeConnection;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Shared/_StarLight/EdgeConnection/EdgeConnectionComponent.cs` at line 3, В файле EdgeConnectionComponent.cs (и аналогично в EdgeConnectionVisuals.cs) исправьте регистр пространства имён: текущая строка namespace Content.Shared._Starlight.EdgeConnection; должна соответствовать папке `_StarLight` — замените `_Starlight` на `_StarLight` (т.е. namespace Content.Shared._StarLight.EdgeConnection) или, если вы предпочитаете менять имя папки, приведите имя папки к `_starlight`/`_Starlight` так, чтобы регистрация в namespace и путь к папке совпадали по регистру во всём проекте.Content.Shared/_StarLight/EdgeConnection/EdgeConnectionVisuals.cs (1)
3-3: Несоответствие регистра: namespace vs путь к папке.Папка называется
_StarLight, но namespace использует_Starlight. Для консистентности рекомендуется привести в соответствие.♻️ Предлагаемое исправление
-namespace Content.Shared._Starlight.EdgeConnection; +namespace Content.Shared._StarLight.EdgeConnection;Либо переименуйте папку в
_Starlightдля соответствия namespace.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Shared/_StarLight/EdgeConnection/EdgeConnectionVisuals.cs` at line 3, В файле EdgeConnectionVisuals.cs текущая декларация namespace использует "Content.Shared._Starlight.EdgeConnection", что не соответствует имени папки "_StarLight"; исправьте несоответствие либо изменив namespace в EdgeConnectionVisuals.cs на "Content.Shared._StarLight.EdgeConnection" (исправить строку с namespace), либо переименовав папку "_StarLight" → "_Starlight" так, чтобы имя папки и namespace совпадали; используйте существующий символ namespace в файле для поиска и приведения в соответствие во всех связанных файлах.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Content.Server/_StarLight/EdgeConnection/EdgeConnectionSystem.cs`:
- Around line 39-43: OnShutdown currently only calls UpdateNeighbors, leaving
the old ConnectionMask in the entity's Appearance when the
EdgeConnectionComponent is removed; update OnShutdown (or add a helper called
from it) to also clear/reset the Appearance connection state for that entity so
the visualizer stops drawing the removed edge — specifically, when handling
ComponentShutdown for EdgeConnectionComponent, write/update the entity's
Appearance data (the ConnectionMask/appearance key used by the connector
visualizer) to a zero/none value using the same Appearance API used elsewhere in
EdgeConnectionSystem so the old mask isn't preserved.
- Around line 117-133: The rotation is getting inverted twice:
RotateDirectionsInverse() passes clockwise: false but RotateDirectionsImpl()
then also flips quarterTurns with (4 - quarterTurns), producing the wrong
direction for 90°/270° cases. Fix by applying the clockwise inversion to the
input angle instead of flipping quarterTurns later: in RotateDirectionsImpl use
a signed angle (e.g., if !clockwise, negate degrees or compute degrees = (360 -
degrees) % 360) and then compute quarterTurns = (int)Math.Round(degrees / 90.0)
% 4, removing the subsequent "if (!clockwise) quarterTurns = (4 - quarterTurns)
% 4" line; this preserves the intended behavior for RotateDirectionsInverse and
RotateDirectionsImpl consistently.
In
`@Resources/Prototypes/Entities/Structures/Machines/Computers/base_structurecomputers.yml`:
- Around line 59-66: В блоке enum.EdgeConnectionVisuals.ConnectionMask для
computerLayerBody значения sprite используют неправильно написанный путь
"_Starlight/Structures/Machines/computers.rsi" — нужно заменить на корректный
регистр "_StarLight/Structures/Machines/computers.rsi" для всех перечисленных
состояний (West, East, East, West) чтобы совпадать с реальным каталогом;
отредактируйте строки в именно этом enum (computerLayerBody) и обновите все
соответствующие sprite значения.
In `@Resources/Prototypes/Entities/Structures/Machines/Computers/computers.yml`:
- Around line 41-48: В enum.EdgeConnectionVisuals.ConnectionMask (symbols:
computerLayerBody, states computer_r/computer_l/computer_l_r) исправьте регистр
в путях к спрайтам: заменить все вхождения
"_Starlight/Structures/Machines/computers.rsi" на точно соответствующее имя
каталога в репозитории "_StarLight/Structures/Machines/computers.rsi" чтобы
избежать ошибок загрузки на регистрозависимых ФС.
---
Outside diff comments:
In `@Resources/Prototypes/Entities/Structures/Machines/Computers/frame.yml`:
- Around line 75-92: GenericVisualizer references the layer key
computerLayerBody but the Sprite component only declares a simple state (state:
broken), so the visualizer cannot update that layer; update the Sprite entry
used by this entity (the Sprite block with sprite:
Structures/Machines/computers.rsi and state: broken) to declare a layer mapping
for computerLayerBody that exposes the same states referenced by
GenericVisualizer (broken, computer_r-broken, computer_l-broken,
computer_l_r-broken) and point the appropriate sprite paths
(Structures/Machines/computers.rsi and
_Starlight/Structures/Machines/computers.rsi) so GenericVisualizer can switch
that layer at runtime.
---
Nitpick comments:
In `@Content.Shared/_StarLight/EdgeConnection/EdgeConnectionComponent.cs`:
- Line 3: В файле EdgeConnectionComponent.cs (и аналогично в
EdgeConnectionVisuals.cs) исправьте регистр пространства имён: текущая строка
namespace Content.Shared._Starlight.EdgeConnection; должна соответствовать папке
`_StarLight` — замените `_Starlight` на `_StarLight` (т.е. namespace
Content.Shared._StarLight.EdgeConnection) или, если вы предпочитаете менять имя
папки, приведите имя папки к `_starlight`/`_Starlight` так, чтобы регистрация в
namespace и путь к папке совпадали по регистру во всём проекте.
In `@Content.Shared/_StarLight/EdgeConnection/EdgeConnectionVisuals.cs`:
- Line 3: В файле EdgeConnectionVisuals.cs текущая декларация namespace
использует "Content.Shared._Starlight.EdgeConnection", что не соответствует
имени папки "_StarLight"; исправьте несоответствие либо изменив namespace в
EdgeConnectionVisuals.cs на "Content.Shared._StarLight.EdgeConnection"
(исправить строку с namespace), либо переименовав папку "_StarLight" →
"_Starlight" так, чтобы имя папки и namespace совпадали; используйте
существующий символ namespace в файле для поиска и приведения в соответствие во
всех связанных файлах.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 522495bb-93a7-421b-9555-8a86d815ed50
⛔ Files ignored due to path filters (13)
Resources/Textures/_StarLight/Structures/Machines/computers.rsi/computer_l-broken.pngis excluded by!**/*.pngResources/Textures/_StarLight/Structures/Machines/computers.rsi/computer_l.pngis excluded by!**/*.pngResources/Textures/_StarLight/Structures/Machines/computers.rsi/computer_l_r-broken.pngis excluded by!**/*.pngResources/Textures/_StarLight/Structures/Machines/computers.rsi/computer_l_r.pngis excluded by!**/*.pngResources/Textures/_StarLight/Structures/Machines/computers.rsi/computer_r-broken.pngis excluded by!**/*.pngResources/Textures/_StarLight/Structures/Machines/computers.rsi/computer_r.pngis excluded by!**/*.pngResources/Textures/_StarLight/Structures/Machines/computers.rsi/shuttle-cargo.pngis excluded by!**/*.pngResources/Textures/_StarLight/Structures/Machines/computers.rsi/shuttle-mining.pngis excluded by!**/*.pngResources/Textures/_StarLight/Structures/Machines/computers.rsi/shuttle-salvage.pngis excluded by!**/*.pngResources/Textures/_StarLight/Structures/Machines/computers.rsi/shuttle-security.pngis excluded by!**/*.pngResources/Textures/_StarLight/Structures/Machines/computers.rsi/universal_id.pngis excluded by!**/*.pngResources/Textures/_StarLight/Structures/Machines/computers.rsi/universal_id_key.pngis excluded by!**/*.pngResources/Textures/_StarLight/Structures/Machines/computers.rsi/universal_id_key_off.pngis excluded by!**/*.png
📒 Files selected for processing (9)
Content.Server/_StarLight/EdgeConnection/EdgeConnectionSystem.csContent.Shared/_StarLight/EdgeConnection/EdgeConnectionComponent.csContent.Shared/_StarLight/EdgeConnection/EdgeConnectionVisuals.csResources/Prototypes/Entities/Structures/Machines/Computers/arcades.ymlResources/Prototypes/Entities/Structures/Machines/Computers/base_structurecomputers.ymlResources/Prototypes/Entities/Structures/Machines/Computers/computers.ymlResources/Prototypes/Entities/Structures/Machines/Computers/frame.ymlResources/Prototypes/Entities/Structures/Machines/Computers/techdiskterminal.ymlResources/Textures/_StarLight/Structures/Machines/computers.rsi/meta.json
| private EdgeConnectionFlags RotateDirectionsInverse(EdgeConnectionFlags flags, Angle rotation) | ||
| { | ||
| return RotateDirectionsImpl(flags, rotation, clockwise: false); | ||
| } | ||
|
|
||
| private EdgeConnectionFlags RotateDirectionsImpl(EdgeConnectionFlags flags, Angle rotation, bool clockwise) | ||
| { | ||
| // Normalize angle to 0-360 | ||
| var degrees = (int)Math.Round(rotation.Degrees) % 360; | ||
| if (degrees < 0) degrees += 360; | ||
|
|
||
| // Round to nearest 90 degrees | ||
| var quarterTurns = (int)Math.Round(degrees / 90.0) % 4; | ||
|
|
||
| // Invert if counterclockwise | ||
| if (!clockwise) | ||
| quarterTurns = (4 - quarterTurns) % 4; |
There was a problem hiding this comment.
Обратный поворот инвертируется дважды.
RotateDirectionsInverse() уже выбирает обратное направление через clockwise: false, но в RotateDirectionsImpl() число шагов дополнительно разворачивается как 4 - quarterTurns. Для 90°/270° это даёт поворот в ту же сторону, а не обратный, поэтому локальный ConnectionMask на повернутых сущностях будет неверным.
Предлагаемое исправление
private EdgeConnectionFlags RotateDirectionsImpl(EdgeConnectionFlags flags, Angle rotation, bool clockwise)
{
// Normalize angle to 0-360
var degrees = (int)Math.Round(rotation.Degrees) % 360;
if (degrees < 0) degrees += 360;
// Round to nearest 90 degrees
var quarterTurns = (int)Math.Round(degrees / 90.0) % 4;
-
- // Invert if counterclockwise
- if (!clockwise)
- quarterTurns = (4 - quarterTurns) % 4;
if (quarterTurns == 0)
return flags;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Content.Server/_StarLight/EdgeConnection/EdgeConnectionSystem.cs` around
lines 117 - 133, The rotation is getting inverted twice:
RotateDirectionsInverse() passes clockwise: false but RotateDirectionsImpl()
then also flips quarterTurns with (4 - quarterTurns), producing the wrong
direction for 90°/270° cases. Fix by applying the clockwise inversion to the
input angle instead of flipping quarterTurns later: in RotateDirectionsImpl use
a signed angle (e.g., if !clockwise, negate degrees or compute degrees = (360 -
degrees) % 360) and then compute quarterTurns = (int)Math.Round(degrees / 90.0)
% 4, removing the subsequent "if (!clockwise) quarterTurns = (4 - quarterTurns)
% 4" line; this preserves the intended behavior for RotateDirectionsInverse and
RotateDirectionsImpl consistently.
| # Starlight Start | ||
| enum.EdgeConnectionVisuals.ConnectionMask: | ||
| computerLayerBody: | ||
| None: { state: computer, sprite: Structures/Machines/computers.rsi } | ||
| West: { state: computer_r, sprite: _Starlight/Structures/Machines/computers.rsi } | ||
| East: { state: computer_l, sprite: _Starlight/Structures/Machines/computers.rsi } | ||
| East, West: { state: computer_l_r, sprite: _Starlight/Structures/Machines/computers.rsi } | ||
| # Starlight End |
There was a problem hiding this comment.
Несоответствие регистра в пути к спрайтам.
Та же проблема, что и в computers.yml — путь _Starlight не соответствует реальному пути _StarLight.
🐛 Предлагаемое исправление
# Starlight Start
enum.EdgeConnectionVisuals.ConnectionMask:
computerLayerBody:
None: { state: computer, sprite: Structures/Machines/computers.rsi }
- West: { state: computer_r, sprite: _Starlight/Structures/Machines/computers.rsi }
- East: { state: computer_l, sprite: _Starlight/Structures/Machines/computers.rsi }
- East, West: { state: computer_l_r, sprite: _Starlight/Structures/Machines/computers.rsi }
+ West: { state: computer_r, sprite: _StarLight/Structures/Machines/computers.rsi }
+ East: { state: computer_l, sprite: _StarLight/Structures/Machines/computers.rsi }
+ East, West: { state: computer_l_r, sprite: _StarLight/Structures/Machines/computers.rsi }
# Starlight End📝 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.
| # Starlight Start | |
| enum.EdgeConnectionVisuals.ConnectionMask: | |
| computerLayerBody: | |
| None: { state: computer, sprite: Structures/Machines/computers.rsi } | |
| West: { state: computer_r, sprite: _Starlight/Structures/Machines/computers.rsi } | |
| East: { state: computer_l, sprite: _Starlight/Structures/Machines/computers.rsi } | |
| East, West: { state: computer_l_r, sprite: _Starlight/Structures/Machines/computers.rsi } | |
| # Starlight End | |
| # Starlight Start | |
| enum.EdgeConnectionVisuals.ConnectionMask: | |
| computerLayerBody: | |
| None: { state: computer, sprite: Structures/Machines/computers.rsi } | |
| West: { state: computer_r, sprite: _StarLight/Structures/Machines/computers.rsi } | |
| East: { state: computer_l, sprite: _StarLight/Structures/Machines/computers.rsi } | |
| East, West: { state: computer_l_r, sprite: _StarLight/Structures/Machines/computers.rsi } | |
| # Starlight End |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@Resources/Prototypes/Entities/Structures/Machines/Computers/base_structurecomputers.yml`
around lines 59 - 66, В блоке enum.EdgeConnectionVisuals.ConnectionMask для
computerLayerBody значения sprite используют неправильно написанный путь
"_Starlight/Structures/Machines/computers.rsi" — нужно заменить на корректный
регистр "_StarLight/Structures/Machines/computers.rsi" для всех перечисленных
состояний (West, East, East, West) чтобы совпадать с реальным каталогом;
отредактируйте строки в именно этом enum (computerLayerBody) и обновите все
соответствующие sprite значения.
| # Starlight Start | ||
| enum.EdgeConnectionVisuals.ConnectionMask: | ||
| computerLayerBody: | ||
| None: { state: computer, sprite: Structures/Machines/computers.rsi } | ||
| West: { state: computer_r, sprite: _Starlight/Structures/Machines/computers.rsi } | ||
| East: { state: computer_l, sprite: _Starlight/Structures/Machines/computers.rsi } | ||
| East, West: { state: computer_l_r, sprite: _Starlight/Structures/Machines/computers.rsi } | ||
| # Starlight End |
There was a problem hiding this comment.
Критическая ошибка: несоответствие регистра в пути к спрайтам.
Путь к файлу в репозитории: _StarLight/Structures/Machines/computers.rsi, но здесь используется _Starlight (строчная 'l'). На файловых системах с учётом регистра (Linux) это приведёт к ошибке загрузки спрайтов.
🐛 Предлагаемое исправление
# Starlight Start
enum.EdgeConnectionVisuals.ConnectionMask:
computerLayerBody:
None: { state: computer, sprite: Structures/Machines/computers.rsi }
- West: { state: computer_r, sprite: _Starlight/Structures/Machines/computers.rsi }
- East: { state: computer_l, sprite: _Starlight/Structures/Machines/computers.rsi }
- East, West: { state: computer_l_r, sprite: _Starlight/Structures/Machines/computers.rsi }
+ West: { state: computer_r, sprite: _StarLight/Structures/Machines/computers.rsi }
+ East: { state: computer_l, sprite: _StarLight/Structures/Machines/computers.rsi }
+ East, West: { state: computer_l_r, sprite: _StarLight/Structures/Machines/computers.rsi }
# Starlight End📝 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.
| # Starlight Start | |
| enum.EdgeConnectionVisuals.ConnectionMask: | |
| computerLayerBody: | |
| None: { state: computer, sprite: Structures/Machines/computers.rsi } | |
| West: { state: computer_r, sprite: _Starlight/Structures/Machines/computers.rsi } | |
| East: { state: computer_l, sprite: _Starlight/Structures/Machines/computers.rsi } | |
| East, West: { state: computer_l_r, sprite: _Starlight/Structures/Machines/computers.rsi } | |
| # Starlight End | |
| # Starlight Start | |
| enum.EdgeConnectionVisuals.ConnectionMask: | |
| computerLayerBody: | |
| None: { state: computer, sprite: Structures/Machines/computers.rsi } | |
| West: { state: computer_r, sprite: _StarLight/Structures/Machines/computers.rsi } | |
| East: { state: computer_l, sprite: _StarLight/Structures/Machines/computers.rsi } | |
| East, West: { state: computer_l_r, sprite: _StarLight/Structures/Machines/computers.rsi } | |
| # Starlight End |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Resources/Prototypes/Entities/Structures/Machines/Computers/computers.yml`
around lines 41 - 48, В enum.EdgeConnectionVisuals.ConnectionMask (symbols:
computerLayerBody, states computer_r/computer_l/computer_l_r) исправьте регистр
в путях к спрайтам: заменить все вхождения
"_Starlight/Structures/Machines/computers.rsi" на точно соответствующее имя
каталога в репозитории "_StarLight/Structures/Machines/computers.rsi" чтобы
избежать ошибок загрузки на регистрозависимых ФС.
ReWAFFlution
left a comment
There was a problem hiding this comment.
Вот это вот починить, потом уже буду смотреть ПР в игре.
CLIENT: 8,125s [ERRO] go.comp.sprite: Unable to load layer RSI '/Textures/_Starlight/Structures/Machines/computers.rsi'.













Краткое описание
ss14Starlight/space-station-14#3121
Почему мы должны добавить это?
Медиа (Видео/Скриншоты)
Проверочный пункт
Changelog
Summary by CodeRabbit
Примечания к выпуску