< Summary

Class:HUDBridge
Assembly:HUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/HUDBridge.cs
Covered lines:0
Uncovered lines:29
Coverable lines:29
Total lines:77
Line coverage:0% (0 of 29)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ConfigureHUDElement(...)0%2100%
TriggerSelfUserExpression(...)0%2100%
AirdroppingRequest(...)0%2100%
ShowTermsOfServices(...)0%6200%
SetPlayerTalking(...)0%6200%
SetVoiceChatEnabledByScene(...)0%6200%
SetUserTalking(...)0%6200%
SetUsersMuted(...)0%6200%
RequestTeleport(...)0%6200%
UpdateBalanceOfMANA(...)0%6200%
ShowAvatarEditorInSignUp()0%12300%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/HUDBridge.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using DCL;
 4using UnityEngine;
 5
 6public class HUDBridge : MonoBehaviour
 7{
 8    #region MessagesFromKernel
 9
 10    [System.Serializable]
 11    class ConfigureHUDElementMessage
 12    {
 13        public HUDElementID hudElementId;
 14        public HUDConfiguration configuration;
 15        public string extraPayload;
 16    }
 17
 18    public void ConfigureHUDElement(string payload)
 19    {
 020        ConfigureHUDElementMessage message = JsonUtility.FromJson<ConfigureHUDElementMessage>(payload);
 21
 022        HUDElementID id = message.hudElementId;
 023        HUDConfiguration configuration = message.configuration;
 024        string extraPayload = message.extraPayload;
 25
 026        HUDController.i.ConfigureHUDElement(id, configuration, extraPayload);
 027    }
 28
 029    public void TriggerSelfUserExpression(string id) { UserProfile.GetOwnUserProfile().SetAvatarExpression(id); }
 30
 31    public void AirdroppingRequest(string payload)
 32    {
 033        var model = JsonUtility.FromJson<AirdroppingHUDController.Model>(payload);
 034        HUDController.i.airdroppingHud.AirdroppingRequested(model);
 035    }
 36
 37    public void ShowTermsOfServices(string payload)
 38    {
 039        var model = JsonUtility.FromJson<TermsOfServiceHUDController.Model>(payload);
 040        HUDController.i.termsOfServiceHud?.ShowTermsOfService(model);
 041    }
 42
 043    public void SetPlayerTalking(string talking) { HUDController.i.taskbarHud?.SetVoiceChatRecording("true".Equals(talki
 44
 45    public void SetVoiceChatEnabledByScene(int enabledPayload)
 46    {
 047        bool isEnabled = enabledPayload != 0;
 048        HUDController.i.taskbarHud?.SetVoiceChatEnabledByScene(isEnabled);
 049    }
 50
 51    public void SetUserTalking(string payload)
 52    {
 053        var model = JsonUtility.FromJson<UserTalkingModel>(payload);
 054        HUDController.i.usersAroundListHud?.SetUserRecording(model.userId, model.talking);
 055    }
 56
 57    public void SetUsersMuted(string payload)
 58    {
 059        var model = JsonUtility.FromJson<UserMutedModel>(payload);
 060        HUDController.i.usersAroundListHud?.SetUsersMuted(model.usersId, model.muted);
 061    }
 62
 063    public void RequestTeleport(string teleportDataJson) { HUDController.i.teleportHud?.RequestTeleport(teleportDataJson
 64
 065    public void UpdateBalanceOfMANA(string balance) { HUDController.i.profileHud?.SetManaBalance(balance); }
 66
 67    public void ShowAvatarEditorInSignUp()
 68    {
 069        if (HUDController.i.avatarEditorHud != null)
 70        {
 071            DataStore.i.common.isSignUpFlow.Set(true);
 072            HUDController.i.avatarEditorHud?.SetVisibility(true);
 73        }
 074    }
 75
 76    #endregion
 77}