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

Adds option to disable in-game chat #30

Merged
merged 2 commits into from
Aug 15, 2024
Merged

Adds option to disable in-game chat #30

merged 2 commits into from
Aug 15, 2024

Conversation

shmocz
Copy link
Member

@shmocz shmocz commented Jul 30, 2024

Addresses issue #7

Adds option to disable in-game chat. If DisableChat=True, the player cannot send or receive messages from others. The option can be set in spawn.ini (under "Settings" section) and RA2MD.ini (under "Options" section). Enabling the option in spawn.ini overrides the setting in RA2MD.ini even if explicitly set to False.

Comment on lines +46 to +56
if (DisableChat)
{
for (int i = 0; i < countof(SessionClass_ChatEnabled); i++)
{
SessionClass_ChatEnabled[i] = false;
}
}
Copy link
Member

@Rampastring Rampastring Aug 13, 2024

Choose a reason for hiding this comment

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

Is it necessary to re-assign these each frame? If not, a place other than the main loop would be more suitable.

Otherwise the code looks good.

Copy link
Member Author

@shmocz shmocz Aug 14, 2024

Choose a reason for hiding this comment

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

This is a "quick and dirty" solution to prevent user from re-enabling the chat from alliances menu. A TODO could be added for future reference about a better implementation, i.e. hooking the function that handles the chat toggle or the function called when exiting the alliances menu.

@Rampastring Rampastring merged commit ac3be24 into main Aug 15, 2024
1 check passed
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.

2 participants