-
Notifications
You must be signed in to change notification settings - Fork 117
[GEN][ZH] Enable Chat for Observers #864
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
[GEN][ZH] Enable Chat for Observers #864
Conversation
|
Does this work, because i also came across this in commandbarobserver // if( controlID == buttonCommunicator && TheGameLogic->getGameMode() == GAME_INTERNET )
/*
{
popupCommunicatorLayout = TheWindowManager->winCreateLayout( AsciiString( "Menus/PopupCommunicator.wnd" ) );
popupCommunicatorLayout->runInit();
popupCommunicatorLayout->hide( FALSE );
popupCommunicatorLayout->bringForward();
}
*/That is commented out. It might just be that the communicator button is disabled without this. |
Communicator button is only used to view players and mute them. Chat is only available through enter or (for team players) backspace. |
|
GenTool touches 5 locations to properly unlock this. This change only touches 1. I suspect this change is incomplete. I could be wrong. |
@roossienb did test this with the game running on two different computers. |
|
I did work in-game and in the game-join menu. Can't remember if I checked the score-screen. Nobody every chats in that one. Will check again |
|
Nevermind, I confused this with the Control Bar toggle. |
|
GenTool enables these things:
|
|
This change is incomplete. After Surrender, it is not possible to Chat. It is also not possible to open the Diplomacy Screen (Tab button). GenTool also allows to chat with Backspace button as Observer. I cannot recall if this allows to chat to former team mates that are now Observer. Probably not. If it does not do anything other than ENTER chat, then its fine to keep Backspace disabled for Observers. I cannot remember what the "enable Observer HUD" is supposed to mean. I tested in GenTool and I do not see what that is supposed to do. |
3a6f054 to
b9e5cbf
Compare
|
I've updated the start post with the fixes. There are three locations that I needed to fix. As explained in the start post, I have not enabled backspace, because by design, an observer cannot send messages to active players. I don't know what |
Did you check if Observer Team chat would chat to former Allies that have also turned Observer? |
A player that gets killed gets kicked out of the team. The game does not remember past teams and does not recreate teams in observer mode. Team relationships are not present in observer mode, hence team chat doesn't work - even if the chat popup would be enabled. The message simply doesn't get send, because there are no players to send to. |
|
That makes sense. |
|
So I think this is ready for merging, or is there anything else that needs to be checked/done? |
Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGameChat.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
Outdated
Show resolved
Hide resolved
e7905a7 to
4aa71a2
Compare
Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGameChat.cpp
Outdated
Show resolved
Hide resolved
4aa71a2 to
3056ab9
Compare
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 very good.
The chat toggle function is blocked by a the
isActivePlayercheck, which checks if a player is either an observer or dead (note that an observer is also classified as a 'dead' player).I have not removed this check from team chat functionality (backspace), because observers are not in a team. Observer messages are never send to active players anyways. There is a safeguard for that further on in the chat logic.
An additional blocker prevented the observer chat to work after surrender. The player template is changed to observer and resets a number of data entries related to network information. This information is used to determine the value ofplayer->IsMultiplayer(), causing it to return false. The chat function uses this to check if chat can be enabled. This is resolved by adding an entry that checks if the player is dead