Skip to content
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

Add chat channel API #69

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add chat channel API #69

wants to merge 4 commits into from

Conversation

Geekid812
Copy link

Draft implementation of #65. Quite a lot of changes to break out the initial assumption of BC that only one message destination exists. The draft UI uses tab-like buttons to switch between different chat channels. For the most part, each channel should be isolated, which means some relevant structures have been moved to a ChatChannel class.

This is not completely ready, but I'm submitting it at this stage to get a review on what's been done so far. Implementation is mostly done apart from correctly handling Listeners.

@Geekid812
Copy link
Author

Note: formatting is weird for some reason. I'll have to update it.

@Geekid812
Copy link
Author

I've fixed the remaining showstoppers for the implementation. The gist of changes is:

  • Channels each have a seperate message history. The server channel is always present, custom channels can be created in the exported API. You can switch channels using the channel tab bar, which is only displayed if there are at least 2 active channels. Active channels are counted as all the custom channels, plus one if you are playing on a server.

  • All checks and functions related to the server chat can only target the server channel. Listeners are also only able to listen on the server channel for API compatibility. Commands can work anywhere however.

I have written a small script that can be used to test the new functionality: bc-channels.as. It's also an example of the expected usage of the API.

@Geekid812 Geekid812 marked this pull request as ready for review November 7, 2023 19:10
@codecat
Copy link
Owner

codecat commented Nov 7, 2023

Very nice! I will do my best to review this properly soon, but I'm very busy recently so no guarantees. Feel free to ping me in a week if I haven't checked it out yet.

Do you have some screenshots of what this looks like in-game?

@Geekid812
Copy link
Author

Geekid812 commented Nov 8, 2023

This is how the channel tab bar is displayed when active:
image

Just like the other controls, it is only visible when the Openplanet UI is shown.

@Geekid812
Copy link
Author

Hey, it's been a fair bit more than a week now, so just a reminder for you to check this out when you can. Thanks!

@Geekid812
Copy link
Author

Gently bumping this PR to get a review, I'm looking to use this API soon. Still looking at this @codecat?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants