Skip to content

Commit

Permalink
Port Chat from Outdated branch (RE-SS3D#1426)
Browse files Browse the repository at this point in the history
* Port chat from outdated version

RE-SS3D#89

* Make ChatRegister non-NetworkBehaviour and deattach from Human

* Unify ChatRegister and ChatWindow

* Fix NRE when dragging tabs in chat

* Fix ChatWindow missing script

* Remove unused ChatWindow2

* Remove AutoExpandGridLayoutGroup

* Fix can't move ChatWindow

* Clean ResizePanel.cs

* Clean TabCreator.cs

* Remove unused ToggleChat.cs

* Clean ChatChannel.cs

* Clean ChatChannels.cs

* Clean ChatTabData.cs

* Clean ChatFilterOption.cs

* Re-add multiple chats windows functionality

* Update ChatWindow.prefab

* Make ToggleChats work for all windows

* Clean ChatWindow + avoid some input while writing

* Undo ugly solution for blocking input while writing in chat

* Change chat input to ControlsOffInputText

* Add SendChatMessage input control

* Let players remove chat windows with one tab

* Move ChatChannels to ScriptableObjects

* Add role required to chat channels

* Add chat to lobby

* Undo Game.unity changes from port

* Fix can't drag ChatWindow in-game

* Add formattable channels

* Add distance-based chats

* Add prefix/suffix option for chat channels

* Add "hide sender name" option for chat channels

* Update HideSender values of some channels

* Split ChatWindow into Lobby and InGameChatWindow

* Fix duplicated client chat messages

* Add system to make chat channels depend on headset

Uses traits in the headset. For example, Security channel has the Security headset. Creating a headset and adding the Security trait will enable that channel

* Improve channels workflow

* Fix comparison between traits not working correctly

This is a weird issue that only happens on the client but not on the host. The type of the same two traits returns a different value, the first trait that is getting compared returns the general/main object type (Trait) while the second returns the specific type. For example, Security trait returns "Trait" object type for item 1 being compared, while the same trait returns "IDPermission" object type for item 2

* Add a simple log for the chat

It's really simple and unoptimized, but does the trick (for now). Chat log can be found with the rest of logs (Game > Logs)

* Add tabName to ChatChannels

* Add tooltips to ChatChannel ScriptableObject

* Improve a bit the visuals of the ChatWindows

* Block camera zoom when hovering a chat

* Fix available channels not syncing in client

* Fix nomenclature of fields

* Use ViewLocator in ToggleChats

* Remove ternary operator when getting tab name

* Fix wrong capitalization on AvailableChannels

* Add OnAvailableChannelsChanged method

* Rename ChatFilterOption Init to Setup

* Improve ChatFilterOptionToggleUI readability

* Rename ChatTab variables for readability

* Rename ChatTab Init to Setup

* Cache transforms in ChatTab

* Set correct name to new tab button in ChatTab

* Remove msg abbreviation in ChatWindow

* Convert ChatMessageSender to ChatSystem

* Add RegisteredChatChannels dictionary to ChatSystem

* Add ToString method to ChatMessage

* Convert ChatChannels to ScriptableSettings

* Remove unused var in ChatWindow

* Remove defaultChat var from InGameChatWindow

* Fix tabs in ResizePanel

* Remove UI responsibility of ChatSystem

* Fix missing references

* Clean ChatSystem code

* Fix new tabs not syncing available channels correctly

* Add NotImplementedException to ChatWindow GetCurrentChatChannel

* Fix controls enabled while writing tab name

* Add scroll to tabs row

* Add HeadsetSecurity (Left/Right)

* Update UI to match a bit more the UI design

https://ss3d.gitbook.io/design/basic-game-mechanics/user-interface/game/player-hud

* Move chat formatting to original client + tweaks to match design

Now chat formatting is done only by the original client who sents the message, so the rest of players receive the message already formatted
Also updated how text is displayed to match the UI design (https://ss3d.gitbook.io/design/basic-game-mechanics/user-interface/game/player-hud)

* Rename channel General to Local

* Add LOOC channel

* Add StationAlerts channel

* Add more options for ChatChannels

* Remove player joined message

* Add welcome to the ship message on round start

* Add character joined message for late joining

* Add General trait to headsets + required traits to channels

* Update ChatChannels list

* Fix late join message being sent by player

* Remove "Character" from in-game chat name

* Fix headset left floating on clients
  • Loading branch information
David-Goru authored Mar 5, 2024
1 parent 5a8c35b commit dc6f212
Show file tree
Hide file tree
Showing 113 changed files with 11,374 additions and 91 deletions.
Binary file modified Assets/Art/Models/Items/Clothing/ClothingTemporary.fbx
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/Content/Addressables/AssetGroups/Items.asset
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ MonoBehaviour:
m_Address: Assets/Content/WorldObjects/Items/Functional/Materials/ElectricalCable.prefab
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: 88d1ba1edb4ce5e4fa74c6a8d53e36e1
m_Address: Assets/Content/WorldObjects/Items/Clothing/HeadsetSecurityLeft.prefab
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: bc08055e4ec2e204f8f46a379b2b6603
m_Address: Assets/Content/WorldObjects/Items/Clothing/HeadsetSecurityRight.prefab
m_ReadOnly: 0
m_SerializedLabels: []
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: ddc57d0f5f9fb874e8a26db0c5b215e0, type: 2}
m_SchemaSet:
Expand Down
4 changes: 4 additions & 0 deletions Assets/Content/Data/Databases/Items.asset
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,8 @@ MonoBehaviour:
_value: {fileID: 7125681683583715523, guid: cc71128d4bcc0c548ac11481000ac424, type: 3}
- _key: ElectricalCable
_value: {fileID: 7125681683583715523, guid: 0e69918696f58e04f846e985ec7405fe, type: 3}
- _key: HeadsetSecurityLeft
_value: {fileID: 1529136833643899573, guid: 88d1ba1edb4ce5e4fa74c6a8d53e36e1, type: 3}
- _key: HeadsetSecurityRight
_value: {fileID: 2114292304283180005, guid: bc08055e4ec2e204f8f46a379b2b6603, type: 3}
_new:
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1dadffec94eb9a649b83c858cc4aa7d0, type: 3}
m_Name: HeadsetSecurity
m_EditorClassIdentifier:
NameKey: Security Headset
DescriptionKey: A headset for listenting to the security's comms.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 827764dff5251cd4ebdef8908d68f3dd, type: 3}
m_Name: HeadsetSecurityLeft
m_EditorClassIdentifier:
prefab: {fileID: 1529136833643899573, guid: 88d1ba1edb4ce5e4fa74c6a8d53e36e1, type: 3}
icon: {fileID: 0}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 827764dff5251cd4ebdef8908d68f3dd, type: 3}
m_Name: HeadsetSecurityRight
m_EditorClassIdentifier:
prefab: {fileID: 2114292304283180005, guid: bc08055e4ec2e204f8f46a379b2b6603, type: 3}
icon: {fileID: 0}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Content/Data/UI/Chat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/AI.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cd2d6eaeb9ae4b9f85a3ab7c93c2a1bb, type: 3}
m_Name: AI
m_EditorClassIdentifier:
Abbreviation:
TabName: A
Color: {r: 1, g: 0.33333334, b: 1, a: 1}
Hidable: 1
CodeOnlyChannel: 0
RoleRequiredToUse: 0
CanFormatText: 0
DistanceBased: 0
MaxDistance: 0
defaultVerb: says
TextPrefix:
TextSuffix:
UseCharacterName: 1
HideSenderName: 0
SurroundMessageWithQuotationMarks: 1
RequiredTraitInHeadset: {fileID: 11400000, guid: fb93106681974e74d8c3f654af725c05, type: 2}
8 changes: 8 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/AI.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/Binary.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cd2d6eaeb9ae4b9f85a3ab7c93c2a1bb, type: 3}
m_Name: Binary
m_EditorClassIdentifier:
Abbreviation:
TabName: B
Color: {r: 0, g: 0, b: 0, a: 1}
Hidable: 1
CodeOnlyChannel: 0
RoleRequiredToUse: 0
CanFormatText: 0
DistanceBased: 0
MaxDistance: 0
defaultVerb: says
TextPrefix:
TextSuffix:
UseCharacterName: 1
HideSenderName: 0
SurroundMessageWithQuotationMarks: 1
RequiredTraitInHeadset: {fileID: 11400000, guid: fb93106681974e74d8c3f654af725c05, type: 2}
8 changes: 8 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/Binary.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/Command.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cd2d6eaeb9ae4b9f85a3ab7c93c2a1bb, type: 3}
m_Name: Command
m_EditorClassIdentifier:
Abbreviation:
TabName: C
Color: {r: 0.5803922, g: 0.56078434, b: 0.101960786, a: 1}
Hidable: 1
CodeOnlyChannel: 0
RoleRequiredToUse: 0
CanFormatText: 0
DistanceBased: 0
MaxDistance: 0
defaultVerb: says
TextPrefix:
TextSuffix:
UseCharacterName: 1
HideSenderName: 0
SurroundMessageWithQuotationMarks: 1
RequiredTraitInHeadset: {fileID: 11400000, guid: fb93106681974e74d8c3f654af725c05, type: 2}
8 changes: 8 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/Command.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/Engineering.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cd2d6eaeb9ae4b9f85a3ab7c93c2a1bb, type: 3}
m_Name: Engineering
m_EditorClassIdentifier:
Abbreviation:
TabName: E
Color: {r: 0.9843137, g: 0.3372549, b: 0.07450981, a: 1}
Hidable: 1
CodeOnlyChannel: 0
RoleRequiredToUse: 0
CanFormatText: 0
DistanceBased: 0
MaxDistance: 0
defaultVerb: says
TextPrefix:
TextSuffix:
UseCharacterName: 1
HideSenderName: 0
SurroundMessageWithQuotationMarks: 1
RequiredTraitInHeadset: {fileID: 11400000, guid: fb93106681974e74d8c3f654af725c05, type: 2}
8 changes: 8 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/Engineering.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/InGameSystem.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cd2d6eaeb9ae4b9f85a3ab7c93c2a1bb, type: 3}
m_Name: InGameSystem
m_EditorClassIdentifier:
Abbreviation:
TabName: I
Color: {r: 1, g: 0, b: 0.019583702, a: 1}
Hidable: 0
CodeOnlyChannel: 1
RoleRequiredToUse: 0
CanFormatText: 1
DistanceBased: 0
MaxDistance: 0
defaultVerb:
TextPrefix:
TextSuffix:
HideSenderName: 1
RequiredTraitInHeadset: {fileID: 0}
8 changes: 8 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/InGameSystem.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/LOOC.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cd2d6eaeb9ae4b9f85a3ab7c93c2a1bb, type: 3}
m_Name: LOOC
m_EditorClassIdentifier:
Abbreviation: LOOC
TabName: L
Color: {r: 0.7137255, g: 0.6313726, b: 0.53333336, a: 1}
Hidable: 1
CodeOnlyChannel: 0
RoleRequiredToUse: 0
CanFormatText: 0
DistanceBased: 0
MaxDistance: 5
defaultVerb:
TextPrefix:
TextSuffix:
UseCharacterName: 0
HideSenderName: 0
SurroundMessageWithQuotationMarks: 1
RequiredTraitInHeadset: {fileID: 0}
8 changes: 8 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/LOOC.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/Local.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cd2d6eaeb9ae4b9f85a3ab7c93c2a1bb, type: 3}
m_Name: Local
m_EditorClassIdentifier:
Abbreviation:
TabName: L
Color: {r: 1, g: 1, b: 1, a: 1}
Hidable: 1
CodeOnlyChannel: 0
RoleRequiredToUse: 0
CanFormatText: 0
DistanceBased: 1
MaxDistance: 5
defaultVerb: says
TextPrefix:
TextSuffix:
UseCharacterName: 1
HideSenderName: 0
SurroundMessageWithQuotationMarks: 1
RequiredTraitInHeadset: {fileID: 0}
8 changes: 8 additions & 0 deletions Assets/Content/Data/UI/Chat/Channels/Local.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dc6f212

Please sign in to comment.