Skip to content

Commit cdb6355

Browse files
committed
Mute All and View Only All
1 parent 53f6d4d commit cdb6355

14 files changed

+209
-22
lines changed

Assets/Prefabs/PopUps/PopUpWindow_RoomOptions.prefab

+18-18
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ MonoBehaviour:
10501050
m_LocalVariables: []
10511051
m_DescriptionActivateSpeed: 12
10521052
m_DescriptionZScale: 1
1053-
m_ButtonTexture: {fileID: 2800000, guid: 464883c791528804496b8c8ef7126e52, type: 3}
1053+
m_ButtonTexture: {fileID: 2800000, guid: e5a95db3eceb2ac48bd574c538be1470, type: 3}
10541054
m_AtlasTexture: 1
10551055
m_ToggleButton: 0
10561056
m_LongPressReleaseButton: 0
@@ -1420,7 +1420,7 @@ MonoBehaviour:
14201420
m_LocalVariables: []
14211421
m_DescriptionActivateSpeed: 12
14221422
m_DescriptionZScale: 1
1423-
m_ButtonTexture: {fileID: 2800000, guid: 464883c791528804496b8c8ef7126e52, type: 3}
1423+
m_ButtonTexture: {fileID: 2800000, guid: 0141ac6bf9f578f4e95706cdd2117914, type: 3}
14241424
m_AtlasTexture: 1
14251425
m_ToggleButton: 1
14261426
m_LongPressReleaseButton: 0
@@ -1729,7 +1729,7 @@ MonoBehaviour:
17291729
m_FallbackState: 0
17301730
m_WaitForCompletion: 0
17311731
m_LocalVariables: []
1732-
m_ToggleOnTexture: {fileID: 0}
1732+
m_ToggleOnTexture: {fileID: 2800000, guid: 89c869f76d8c0474a8da08e71510f0f2, type: 3}
17331733
m_AllowUnavailable: 0
17341734
m_LinkedUIObject: {fileID: 0}
17351735
m_CommandIgnored: 0
@@ -1915,7 +1915,7 @@ MonoBehaviour:
19151915
m_FallbackState: 0
19161916
m_WaitForCompletion: 0
19171917
m_LocalVariables: []
1918-
m_ToggleOnTexture: {fileID: 2800000, guid: 97a84a57c58583a48a834c393578618d, type: 3}
1918+
m_ToggleOnTexture: {fileID: 2800000, guid: 0c91e975bed1cd948a150b672f3fec48, type: 3}
19191919
m_AllowUnavailable: 1
19201920
m_LinkedUIObject: {fileID: 0}
19211921
m_CommandIgnored: 0
@@ -1952,8 +1952,8 @@ Transform:
19521952
m_GameObject: {fileID: 8401036954015826580}
19531953
serializedVersion: 2
19541954
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
1955-
m_LocalPosition: {x: -0.648, y: 0.421, z: 0}
1956-
m_LocalScale: {x: 0.25, y: 0.25, z: 0.25}
1955+
m_LocalPosition: {x: -0.648, y: 0.404, z: 0}
1956+
m_LocalScale: {x: 0.33, y: 0.33, z: 0.33}
19571957
m_ConstrainProportionsScale: 0
19581958
m_Children: []
19591959
m_Father: {fileID: 461372}
@@ -2048,7 +2048,7 @@ MonoBehaviour:
20482048
m_TableReference:
20492049
m_TableCollectionName: GUID:c84355079ab3f3e4f8f3812258805f86
20502050
m_TableEntryReference:
2051-
m_KeyId: 326832067431559168
2051+
m_KeyId: 326871085665939456
20522052
m_Key:
20532053
m_FallbackState: 0
20542054
m_WaitForCompletion: 0
@@ -2065,7 +2065,7 @@ MonoBehaviour:
20652065
m_LocalVariables: []
20662066
m_DescriptionActivateSpeed: 12
20672067
m_DescriptionZScale: 1
2068-
m_ButtonTexture: {fileID: 2800000, guid: 464883c791528804496b8c8ef7126e52, type: 3}
2068+
m_ButtonTexture: {fileID: 2800000, guid: 97a84a57c58583a48a834c393578618d, type: 3}
20692069
m_AtlasTexture: 1
20702070
m_ToggleButton: 1
20712071
m_LongPressReleaseButton: 0
@@ -2075,7 +2075,7 @@ MonoBehaviour:
20752075
m_HoverScale: 1.1
20762076
m_HoverBoxColliderGrow: 0.2
20772077
m_AddOverlay: 0
2078-
m_Command: 1014
2078+
m_Command: 1017
20792079
m_CommandParam: -1
20802080
m_CommandParam2: -1
20812081
m_RequiresPopup: 0
@@ -2096,12 +2096,12 @@ MonoBehaviour:
20962096
m_TableReference:
20972097
m_TableCollectionName: GUID:c84355079ab3f3e4f8f3812258805f86
20982098
m_TableEntryReference:
2099-
m_KeyId: 326833306865168384
2099+
m_KeyId: 326871757446639616
21002100
m_Key:
21012101
m_FallbackState: 0
21022102
m_WaitForCompletion: 0
21032103
m_LocalVariables: []
2104-
m_ToggleOnTexture: {fileID: 2800000, guid: 97a84a57c58583a48a834c393578618d, type: 3}
2104+
m_ToggleOnTexture: {fileID: 2800000, guid: 0141ac6bf9f578f4e95706cdd2117914, type: 3}
21052105
m_AllowUnavailable: 1
21062106
m_LinkedUIObject: {fileID: 0}
21072107
m_CommandIgnored: 0
@@ -2309,8 +2309,8 @@ Transform:
23092309
m_GameObject: {fileID: 8947761366766059199}
23102310
serializedVersion: 2
23112311
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
2312-
m_LocalPosition: {x: -0.312, y: 0.421, z: 0}
2313-
m_LocalScale: {x: 0.25, y: 0.25, z: 0.25}
2312+
m_LocalPosition: {x: -0.221, y: 0.404, z: 0}
2313+
m_LocalScale: {x: 0.33, y: 0.33, z: 0.33}
23142314
m_ConstrainProportionsScale: 0
23152315
m_Children: []
23162316
m_Father: {fileID: 461372}
@@ -2405,7 +2405,7 @@ MonoBehaviour:
24052405
m_TableReference:
24062406
m_TableCollectionName: GUID:c84355079ab3f3e4f8f3812258805f86
24072407
m_TableEntryReference:
2408-
m_KeyId: 326832067431559168
2408+
m_KeyId: 326869993834082304
24092409
m_Key:
24102410
m_FallbackState: 0
24112411
m_WaitForCompletion: 0
@@ -2422,7 +2422,7 @@ MonoBehaviour:
24222422
m_LocalVariables: []
24232423
m_DescriptionActivateSpeed: 12
24242424
m_DescriptionZScale: 1
2425-
m_ButtonTexture: {fileID: 2800000, guid: 464883c791528804496b8c8ef7126e52, type: 3}
2425+
m_ButtonTexture: {fileID: 2800000, guid: 89c869f76d8c0474a8da08e71510f0f2, type: 3}
24262426
m_AtlasTexture: 1
24272427
m_ToggleButton: 1
24282428
m_LongPressReleaseButton: 0
@@ -2432,7 +2432,7 @@ MonoBehaviour:
24322432
m_HoverScale: 1.1
24332433
m_HoverBoxColliderGrow: 0.2
24342434
m_AddOverlay: 0
2435-
m_Command: 1014
2435+
m_Command: 1016
24362436
m_CommandParam: -1
24372437
m_CommandParam2: -1
24382438
m_RequiresPopup: 0
@@ -2453,12 +2453,12 @@ MonoBehaviour:
24532453
m_TableReference:
24542454
m_TableCollectionName: GUID:c84355079ab3f3e4f8f3812258805f86
24552455
m_TableEntryReference:
2456-
m_KeyId: 326833306865168384
2456+
m_KeyId: 326870578603945984
24572457
m_Key:
24582458
m_FallbackState: 0
24592459
m_WaitForCompletion: 0
24602460
m_LocalVariables: []
2461-
m_ToggleOnTexture: {fileID: 2800000, guid: 97a84a57c58583a48a834c393578618d, type: 3}
2461+
m_ToggleOnTexture: {fileID: 2800000, guid: 464883c791528804496b8c8ef7126e52, type: 3}
24622462
m_AllowUnavailable: 1
24632463
m_LinkedUIObject: {fileID: 0}
24642464
m_CommandIgnored: 0

Assets/Scripts/GUI/MultiplayerRoomOptionsPanelButton.cs

+6
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,11 @@ override protected void OnButtonPressed()
4242
Debug.Assert(popup != null);
4343
popup.OnMultiplayerRoomOptionsPopUpWindowButtonPressed(this);
4444
}
45+
46+
public void SetToggleState(bool isActive)
47+
{
48+
m_ToggleActive = isActive;
49+
UpdateVisuals();
50+
}
4551
}
4652
} // namespace TiltBrush

Assets/Scripts/GUI/MultiplayerRoomOptionsPopUpWindow.cs

+34-1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,19 @@ private void ClearGuiPrefabsList()
158158
m_instantiatedGuiPrefabs.Clear();
159159
}
160160

161+
private PlayerListItemPrefab GetGameobjectWithPlayerId(int playerID)
162+
{
163+
foreach (GameObject playerGui in m_instantiatedGuiPrefabs)
164+
{
165+
PlayerListItemPrefab playerComponent = playerGui.GetComponent<PlayerListItemPrefab>();
166+
if (playerComponent != null && playerComponent.remotePlayer.PlayerId == playerID)
167+
return playerComponent;
168+
}
169+
170+
return null;
171+
}
172+
173+
161174
public void OnMultiplayerRoomOptionsPopUpWindowButtonPressed(MultiplayerRoomOptionsPanelButton button)
162175
{
163176
switch (button.m_Command)
@@ -170,11 +183,31 @@ public void OnMultiplayerRoomOptionsPopUpWindowButtonPressed(MultiplayerRoomOpti
170183
case SketchControlsScript.GlobalCommands.MultiplayerTransferRoomOwnership:
171184
MultiplayerManager.m_Instance.RoomOwnershipTransferedToUser(button.playerId);
172185
break;
173-
case SketchControlsScript.GlobalCommands.MultiplayerToggleUserStrokeGeneration:
186+
case SketchControlsScript.GlobalCommands.MultiplayerToggleUserViewEditMode:
174187
MultiplayerManager.m_Instance.ToggleUserViewOnlyMode(button.IsButtonActive(), button.playerId);
175188
break;
176189
case SketchControlsScript.GlobalCommands.MultiplayerKickPlayerOut:
177190
MultiplayerManager.m_Instance.KickPlayerOut(button.playerId);
191+
break;
192+
case SketchControlsScript.GlobalCommands.MultiplayerToggleAllUserAudio:
193+
194+
foreach (var remotePlayer in m_RemotePlayers.List)
195+
{
196+
MultiplayerAudioSourcesManager.m_Instance.ToggleAudioMuteForPlayer(button.IsButtonActive(), remotePlayer.PlayerId);
197+
PlayerListItemPrefab playerComponent = GetGameobjectWithPlayerId(remotePlayer.PlayerId);
198+
if (playerComponent) playerComponent.SetAudioToggleState(button.IsButtonActive());
199+
}
200+
201+
break;
202+
case SketchControlsScript.GlobalCommands.MultiplayerToggleAllUserViewEditMode:
203+
204+
foreach (var remotePlayer in m_RemotePlayers.List)
205+
{
206+
MultiplayerManager.m_Instance.ToggleUserViewOnlyMode(button.IsButtonActive(), remotePlayer.PlayerId);
207+
PlayerListItemPrefab playerComponent = GetGameobjectWithPlayerId(remotePlayer.PlayerId);
208+
if (playerComponent) playerComponent.SetViewOnlyToggleState(button.IsButtonActive());
209+
}
210+
178211
break;
179212
}
180213
}

Assets/Scripts/GUI/PlayerListItemPrefab.cs

+11
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,16 @@ public void SetPlayerId()
4444
if (ToggleViewOnly) ToggleViewOnly.playerId = remotePlayer.PlayerId;
4545
if (KickPlayerOut) KickPlayerOut.playerId = remotePlayer.PlayerId;
4646
}
47+
48+
public void SetAudioToggleState(bool isActive)
49+
{
50+
if (MuteButton) MuteButton.SetToggleState(isActive);
51+
}
52+
53+
public void SetViewOnlyToggleState(bool isActive)
54+
{
55+
if (ToggleViewOnly) ToggleViewOnly.SetToggleState(isActive);
56+
}
57+
4758
}
4859
}

Assets/Scripts/Multiplayer/MultiplayerAudioSourcesManager.cs

+1
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,6 @@ public void ToggleAudioMuteForPlayer(bool value, int playerId)
106106
source.mute = value;
107107
}
108108
}
109+
109110
}
110111
}

Assets/Scripts/SketchControlsScript.cs

+9-3
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@ public enum GlobalCommands
160160
ToggleUserVoiceInMultiplayer = 1011,
161161
EditMultiplayerRoomMaxPlayers = 1012,
162162
MultiplayerTransferRoomOwnership = 1013,
163-
MultiplayerToggleUserStrokeGeneration = 1014,
163+
MultiplayerToggleUserViewEditMode = 1014,
164164
MultiplayerKickPlayerOut = 1015,
165+
MultiplayerToggleAllUserAudio = 1016,
166+
MultiplayerToggleAllUserViewEditMode = 1017,
165167

166168

167169
RenameSketch = 5200,
@@ -4887,7 +4889,9 @@ public void IssueGlobalCommand(GlobalCommands rEnum, int iParam1 = -1,
48874889
case GlobalCommands.MultiplayerDisconnect:
48884890
case GlobalCommands.ToggleUserVoiceInMultiplayer:
48894891
case GlobalCommands.MultiplayerTransferRoomOwnership:
4890-
case GlobalCommands.MultiplayerToggleUserStrokeGeneration:
4892+
case GlobalCommands.MultiplayerToggleUserViewEditMode:
4893+
case GlobalCommands.MultiplayerToggleAllUserAudio:
4894+
case GlobalCommands.MultiplayerToggleAllUserViewEditMode:
48914895
case GlobalCommands.MultiplayerKickPlayerOut:
48924896
case GlobalCommands.WhatIsNew:
48934897
break;// Intentionally blank.
@@ -5120,10 +5124,12 @@ public bool IsCommandAvailable(GlobalCommands rEnum, int iParam = -1)
51205124
case GlobalCommands.EditMultiplayerNickName:
51215125
case GlobalCommands.EditMultiplayerRoomName:
51225126
case GlobalCommands.EditMultiplayerRoomMaxPlayers:
5127+
case GlobalCommands.MultiplayerToggleAllUserAudio:
51235128
return !(MultiplayerManager.m_Instance.State == ConnectionState.IN_ROOM);
51245129
case GlobalCommands.MultiplayerTransferRoomOwnership:
5125-
case GlobalCommands.MultiplayerToggleUserStrokeGeneration:
5130+
case GlobalCommands.MultiplayerToggleUserViewEditMode:
51265131
case GlobalCommands.MultiplayerKickPlayerOut:
5132+
case GlobalCommands.MultiplayerToggleAllUserViewEditMode:
51275133
return (MultiplayerManager.m_Instance.State == ConnectionState.IN_ROOM && MultiplayerManager.m_Instance.IsUserRoomOwner());
51285134
case GlobalCommands.WhatIsNew:
51295135
return false;

Assets/Settings/Localization/Strings/Strings Shared Data.asset

+16
Original file line numberDiff line numberDiff line change
@@ -3487,6 +3487,22 @@ MonoBehaviour:
34873487
m_Key: MULTIPLAYER_KICK_OUT_USER
34883488
m_Metadata:
34893489
m_Items: []
3490+
- m_Id: 326869993834082304
3491+
m_Key: MULTIPLAYER_MUTE_ALL_USER_BUTTON
3492+
m_Metadata:
3493+
m_Items: []
3494+
- m_Id: 326870578603945984
3495+
m_Key: MULTIPLAYER_UNMUTE_ALL_PLAYERS_BUTTON
3496+
m_Metadata:
3497+
m_Items: []
3498+
- m_Id: 326871085665939456
3499+
m_Key: MULTIPLAYER_SET_ALL_PLAYERS_TO_VIEWONLY
3500+
m_Metadata:
3501+
m_Items: []
3502+
- m_Id: 326871757446639616
3503+
m_Key: MULTIPLAYER_UNSET_ALL_PLAYERS_TO_VIEWONLY
3504+
m_Metadata:
3505+
m_Items: []
34903506
m_Metadata:
34913507
m_Items: []
34923508
m_KeyGenerator:

Assets/Settings/Localization/Strings/Strings_de.asset

+16
Original file line numberDiff line numberDiff line change
@@ -3686,6 +3686,22 @@ MonoBehaviour:
36863686
m_Localized: Spieler entfernen
36873687
m_Metadata:
36883688
m_Items: []
3689+
- m_Id: 326869993834082304
3690+
m_Localized: Alle Spieler stummschalten
3691+
m_Metadata:
3692+
m_Items: []
3693+
- m_Id: 326870578603945984
3694+
m_Localized: Alle Spieler stumm schalten aufheben
3695+
m_Metadata:
3696+
m_Items: []
3697+
- m_Id: 326871085665939456
3698+
m_Localized: Alle Spieler auf Nur-Ansicht setzen
3699+
m_Metadata:
3700+
m_Items: []
3701+
- m_Id: 326871757446639616
3702+
m_Localized: Allen Spielern das Bearbeiten erlauben
3703+
m_Metadata:
3704+
m_Items: []
36893705
references:
36903706
version: 2
36913707
RefIds: []

Assets/Settings/Localization/Strings/Strings_en.asset

+16
Original file line numberDiff line numberDiff line change
@@ -3656,6 +3656,22 @@ MonoBehaviour:
36563656
m_Localized: Kick User Out
36573657
m_Metadata:
36583658
m_Items: []
3659+
- m_Id: 326869993834082304
3660+
m_Localized: Mute all players
3661+
m_Metadata:
3662+
m_Items: []
3663+
- m_Id: 326870578603945984
3664+
m_Localized: Unmute all players
3665+
m_Metadata:
3666+
m_Items: []
3667+
- m_Id: 326871085665939456
3668+
m_Localized: Set all players to view only
3669+
m_Metadata:
3670+
m_Items: []
3671+
- m_Id: 326871757446639616
3672+
m_Localized: Allow all players to edit
3673+
m_Metadata:
3674+
m_Items: []
36593675
references:
36603676
version: 2
36613677
RefIds: []

Assets/Settings/Localization/Strings/Strings_es.asset

+16
Original file line numberDiff line numberDiff line change
@@ -3656,6 +3656,22 @@ MonoBehaviour:
36563656
m_Localized: Expulsar al jugador
36573657
m_Metadata:
36583658
m_Items: []
3659+
- m_Id: 326869993834082304
3660+
m_Localized: Silenciar a todos los jugadores
3661+
m_Metadata:
3662+
m_Items: []
3663+
- m_Id: 326870578603945984
3664+
m_Localized: Activar el sonido de todos los jugadores
3665+
m_Metadata:
3666+
m_Items: []
3667+
- m_Id: 326871085665939456
3668+
m_Localized: "Configurar a todos los jugadores en modo solo visualizaci\xF3n"
3669+
m_Metadata:
3670+
m_Items: []
3671+
- m_Id: 326871757446639616
3672+
m_Localized: Permitir que todos los jugadores editen
3673+
m_Metadata:
3674+
m_Items: []
36593675
references:
36603676
version: 2
36613677
RefIds: []

Assets/Settings/Localization/Strings/Strings_fr.asset

+16
Original file line numberDiff line numberDiff line change
@@ -3626,6 +3626,22 @@ MonoBehaviour:
36263626
m_Localized: Expulser le joueur
36273627
m_Metadata:
36283628
m_Items: []
3629+
- m_Id: 326869993834082304
3630+
m_Localized: Mettre tous les joueurs en sourdine
3631+
m_Metadata:
3632+
m_Items: []
3633+
- m_Id: 326870578603945984
3634+
m_Localized: "R\xE9activer le son de tous les joueurs"
3635+
m_Metadata:
3636+
m_Items: []
3637+
- m_Id: 326871085665939456
3638+
m_Localized: Mettre tous les joueurs en mode visualisation uniquement
3639+
m_Metadata:
3640+
m_Items: []
3641+
- m_Id: 326871757446639616
3642+
m_Localized: "Permettre \xE0 tous les joueurs de modifier"
3643+
m_Metadata:
3644+
m_Items: []
36293645
references:
36303646
version: 2
36313647
RefIds: []

0 commit comments

Comments
 (0)