-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds Handheld Radio/Listener system #1457
Conversation
@Bright0 check out my suggestions above |
Alright so I think things make a lot more sense now. ChatManager only checks if the listener is within the voice range and passes the distance to the listening component so that it can compare with its individual IListen interfaces. I didn't need a GetListenRange method on the listening component so I deleted it, the interface's GetListenRange method now works as intended since the listening component iterates through all of the attached relevant components and checks their individual listen ranges. @RemieRichards Everything should be good if you wanna check it out again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. It's possible to simplify and use the existing EntitySystem EntityQuery instead of subscribing and unsubscribing. The same thing can probably done for the listener.
@Bright0 I personally wouldn't have removed the GetListenRange, as it would have allowed listeners to hear wider than voice range (which, while probably rare for balance reasons, could have been useful) but it's fine I suppose. cross that bridge if we come to it. |
|
||
public override string Name => "Listening"; | ||
|
||
private ListeningSystem _listeningSystem = default!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove _listeningSystem reference here and do what was done for RadioComponent to replace the subscribe unsubscribe.
{ | ||
base.Initialize(); | ||
|
||
_radioSystem = _entitySystemManager.GetEntitySystem<RadioSystem>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna need @PJB3005's feedback on this. Should the RadioSystem
be saved like this or should it just be fetched every time on line 56.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you do this, as I think Remie said before, it's possible to remove the ListeningComponent completely.
listener.GetComponent<ListeningComponent>() | ||
.PassSpeechData(message, source, dist); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
listener.GetComponent<ListeningComponent>() | |
.PassSpeechData(message, source, dist); | |
foreach (var listener in entity.GetAllComponents<IListen>()) | |
{ | |
if (dist > listener.GetListenRange()) | |
{ | |
continue; | |
} | |
listener.HeardSpeech(message, source); | |
} |
…n-join Restore crew's clothing on spawn
…AbusePatch Upstream Bug Patch
episode 2 bc gitkraken obliterated my older PR with nonsense