Brain Blip's back#16
Open
vsixst wants to merge 1 commit into
Open
Conversation
Основные: - Добавлена OutOfContainerSystem, добавляющая компоненты на ентити, если та находится вне контейнеров (т.е. на полу) - Возвращены блипы на мозг, с условием что мозг: а) Вне грида; б) Смотрящий в радиусе 512м. Чисто по приколу: - Обновлена/Возвращена логика в ComponentTogglerSystem на логику визденов. - Исправлена глупая ошибка с предиктом в ClothingGrantingSystem
Pcolik505
requested changes
Jul 3, 2026
Pcolik505
left a comment
Collaborator
There was a problem hiding this comment.
По комментам плюс-минус вот так.
Comment on lines
+32
to
+37
|
|
||
| // <summary> | ||
| // It holds the entity that the component gave the component to, so it can remove from it even if it changes parent. | ||
| // </summary> | ||
| [DataField] | ||
| public EntityUid? Target; |
Collaborator
There was a problem hiding this comment.
Suggested change
| // <summary> | |
| // It holds the entity that the component gave the component to, so it can remove from it even if it changes parent. | |
| // </summary> | |
| [DataField] | |
| public EntityUid? Target; | |
| // LuaM-start: | |
| // <summary> | |
| // It holds the entity that the component gave the component to, so it can remove from it even if it changes parent. | |
| // </summary> | |
| [DataField] | |
| public EntityUid? Target; | |
| // LuaM-end. |
| @@ -1,12 +1,15 @@ | |||
| using Content.Shared.Item.ItemToggle.Components; | |||
| using Robust.Shared.Timing; | |||
Collaborator
There was a problem hiding this comment.
Suggested change
| using Robust.Shared.Timing; | |
| using Robust.Shared.Timing; // LuaM |
| /// Handles <see cref="ComponentTogglerComponent"/> component manipulation. | ||
| /// </summary> | ||
| public sealed class ComponentTogglerSystem : EntitySystem | ||
| public sealed partial class ComponentTogglerSystem : EntitySystem |
Collaborator
There was a problem hiding this comment.
Suggested change
| public sealed partial class ComponentTogglerSystem : EntitySystem | |
| public sealed partial class ComponentTogglerSystem : EntitySystem // LuaM: public sealed class > public sealed partial class |
| public void ToggleComponent(EntityUid uid, bool activate) | ||
| { | ||
| if (!TryComp<ComponentTogglerComponent>(uid, out var component)) | ||
| if (!_timing.IsFirstTimePredicted) // LuaM: predict err fix |
Collaborator
There was a problem hiding this comment.
Suggested change
| if (!_timing.IsFirstTimePredicted) // LuaM: predict err fix | |
| if (!_timing.IsFirstTimePredicted) // LuaM: !TryComp<ComponentTogglerComponent>(uid, out var component) > _timing.IsFirstTimePredicted |
| EntityManager.AddComponents(target, component.Components); | ||
| } | ||
| else | ||
| EntityManager.RemoveComponents(target, component.RemoveComponents ?? component.Components); |
Collaborator
There was a problem hiding this comment.
Закомментить, а не удалить.
| if (!_timing.IsFirstTimePredicted) // LuaM: predict err fix | ||
| return; | ||
|
|
||
| var target = component.Parent ? Transform(uid).ParentUid : uid; |
Collaborator
There was a problem hiding this comment.
Закомментить, а не удалить.
| return; | ||
|
|
||
| var target = component.Parent ? Transform(uid).ParentUid : uid; | ||
| if (!TryComp<ComponentTogglerComponent>(uid, out var component)) |
Collaborator
There was a problem hiding this comment.
Suggested change
| if (!TryComp<ComponentTogglerComponent>(uid, out var component)) | |
| if (!TryComp<ComponentTogglerComponent>(uid, out var component)) // LuaM |
| components: | ||
| - type: RadarBlip | ||
| radarColor: "#E0FFFF" | ||
| scale: 3 |
Collaborator
There was a problem hiding this comment.
Suggested change
| scale: 3 | |
| scale: 3 // LuaM: 6 > 3 |
Comment on lines
+106
to
+107
| maxDistance: 512 | ||
| requireNoGrid: true |
Collaborator
There was a problem hiding this comment.
Suggested change
| maxDistance: 512 | |
| requireNoGrid: true | |
| # LuaM-start: | |
| maxDistance: 512 | |
| requireNoGrid: true | |
| # LuaM-end. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
О пулл-реквесте
Добавлена
OutOfContainerSystem, добавляющая компоненты на сущность пока он вне контейнера (т.е. на полу, в космосе.. зачем я это уточняю в который раз?) и отбирающая их когда сущность в контейнере (в руках, в сумке, итд.).С этой системой возвращён блип на мозге, но с двумя добавлениями:
Из дополнительного:
Возвращение к логике визардов в
ComponentTogglerSystemи исправление ошибки связанной с предиктом вClothingGrantingSystemОбоснование / Баланс
Хотели сделать блипы на мозге? В целом, ситуация с отображением в теле исправлена.
Технические детали
OutOfContainerSystemпо сути просто переносClothingGrantingSystem(_Goobstation.Clothing.Systems) с использованием других ивентов (EntGotInsertedIntoContainerMessageиEntGotRemovedIntoContainerMessage) и проверкиIsEntityInContainer. Комментарии к методам я думаю излишни, логика коротка и понятна.Проблема с
ComponentTogglerSystemдостаточно тупая, но существует. Если компонентComponentTogglerComponentвисит на шлеме, который добавляется через скафандр - то при снятии скафандра с куклы другой куклы, компоненты не снимаются корректно. Т.к. я не знаю почему губы вынесли эту логику изOnToggledвToggleComponentя, соотв., решил аналогично изменить логику вToggleComponent, а не полностью вернуть систему к визденам. (У визденов нету методаToggleComponent- вся логика находится вOnToggledметоде).Как протестировать
Медиа
Требования
Критические изменения
Вроде я не насрал
Журнал изменений
🆑 vsixst
Примечание
Я кстати жду похвалу за такую роспись, чёт я много расписал для такого мелкого реквеста.