Closed David-Goru closed 4 months ago
Code fine, needs runtime testing.
Found a UI concept of how the chat should be (https://ss3d.gitbook.io/design/basic-game-mechanics/user-interface/game/player-hud) and decided to update both the UI visuals and how text is formatted to match a bit more that design
got some trouble with floating headset on clients but that's a minor issue we can make a small issue for it.
got some trouble with floating headset on clients but that's a minor issue we can make a small issue for it.
Should be fixed in my last commit!
Summary
This PR aims to have the chat from the outdated branch (https://github.com/RE-SS3D/SS3D/pull/89) working. It also adds some more functionality, trying to replicate some of the mechanics of SS13
Currently, lobby and in-game chats (should) work. You can add new channels or modify existing ones at Content > Data > UI > Chat > Channels (Create > SS3D > UI > Chat > Chat Channel for a new channel). The Channels list (in Content > Data > UI > Chat) should be updated if removing/adding new channels
As on the original chat, channels can have abbreviations, colors and whether if they can be excluded from tabs or not (hidable). Messages sent to non-hidable channels will be always present in all chats/tabs. Currently the only non-hidable channel is System
On top of porting the original chat, this PR also adds the chat to the lobby and roles required to channels. Only players with same or higher role will be able to use specific channels, like System, which requires Administrator role or higher
Some things that are
notdoneyet, but I'd like to include if possible (no promises, though):PR checklist
Pictures/Videos
https://github.com/RE-SS3D/SS3D/assets/50799541/3786c413-8e81-4891-ae20-69b6bf02716f
https://github.com/RE-SS3D/SS3D/assets/50799541/e3dca258-85ac-4af5-99b2-2760e03f6fb8
Testing
Open several clients with different roles, and use the chat in the lobby and in-game. When in-game, use different channels
Networking checklist
Changes
I decided to remove the "ChatRegister" from the original chat to make things easier. I'm using broadcasts messages for the chat. First time working with multiplayer on this level, so I may have done something really wrong - would appreciate if someone could check I'm not doing anything too silly
I've also modified Trait.cs to fix a bug where two equal traits were returning non-equal due to GetType() methods returning the base type for the first trait being compared, and the second trait was returning the specific type (for example, Security trait was returining Trait as type for the first object, and IDPermission (which inherits from Trait) for the second object, although they were exactly the same)
Related issues/PRs
Closes #1286