< Summary

Class:DCL.SettingsCommon.SettingsControllers.SpecificControllers.HideUIControlController
Assembly:SettingsControllers
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Settings/SettingsControllers/SpecificControllers/HideUIControlController.cs
Covered lines:11
Uncovered lines:3
Coverable lines:14
Total lines:38
Line coverage:78.5% (11 of 14)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Initialize()0%110100%
GetStoredValue()0%110100%
UpdateSetting(...)0%110100%
OnDestroy()0%2100%
AllUIHiddenChanged(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Settings/SettingsControllers/SpecificControllers/HideUIControlController.cs

#LineLine coverage
 1using DCL.SettingsCommon.SettingsControllers.BaseControllers;
 2using UnityEngine;
 3
 4namespace DCL.SettingsCommon.SettingsControllers.SpecificControllers
 5{
 6    [CreateAssetMenu(menuName = "Settings/Controllers/Controls/Hide UI", fileName = "HideUIControlController")]
 7    public class HideUIControlController : ToggleSettingsControlController
 8    {
 9        public override void Initialize()
 10        {
 211            base.Initialize();
 12
 213            CommonScriptableObjects.allUIHidden.OnChange += AllUIHiddenChanged;
 214            AllUIHiddenChanged(CommonScriptableObjects.allUIHidden.Get(), false);
 215        }
 16
 217        public override object GetStoredValue() { return currentGeneralSettings.hideUI; }
 18
 19        public override void UpdateSetting(object newValue)
 20        {
 221            currentGeneralSettings.hideUI = (bool)newValue;
 222            CommonScriptableObjects.allUIHidden.Set(currentGeneralSettings.hideUI);
 223        }
 24
 25        public override void OnDestroy()
 26        {
 027            base.OnDestroy();
 28
 029            CommonScriptableObjects.allUIHidden.OnChange -= AllUIHiddenChanged;
 030        }
 31
 32        private void AllUIHiddenChanged(bool current, bool previous)
 33        {
 1034            currentGeneralSettings.hideUI = current;
 1035            ApplySettings();
 1036        }
 37    }
 38}