< Summary

Class:DCL.Backpack.BackpackEditorV2Plugin
Assembly:BackpackEditorHUDV2
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/BackpackEditorV2Plugin.cs
Covered lines:0
Uncovered lines:25
Coverable lines:25
Total lines:112
Line coverage:0% (0 of 25)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:3
Method coverage:0% (0 of 3)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
BackpackEditorV2Plugin()0%2100%
Initialize()0%12300%
Dispose()0%2100%

File(s)

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

#LineLine coverage
 1using Cysharp.Threading.Tasks;
 2using DCL.Browser;
 3using DCL.Providers;
 4using DCLServices.CustomNftCollection;
 5using DCLServices.DCLFileBrowser;
 6using DCLServices.EnvironmentProvider;
 7using DCLServices.Lambdas;
 8using DCLServices.WearablesCatalogService;
 9using MainScripts.DCL.Components.Avatar.VRMExporter;
 10using MainScripts.DCL.Controllers.HUD.CharacterPreview;
 11
 12namespace DCL.Backpack
 13{
 14    public class BackpackEditorV2Plugin : IPlugin
 15    {
 16        private BackpackEditorHUDController hudController;
 17
 018        public BackpackEditorV2Plugin()
 19        {
 020            Initialize().Forget();
 021        }
 22
 23        private async UniTaskVoid Initialize()
 24        {
 025            var assetsProvider = Environment.i.platform.serviceLocator.Get<IAddressableResourceProvider>();
 026            var vrmExporterReferences = await assetsProvider.Instantiate<VRMExporterReferences>("VRMExporter", "_VRMExpo
 27
 028            ServiceLocator serviceLocator = Environment.i.serviceLocator;
 029            IWearablesCatalogService wearablesCatalogService = serviceLocator.Get<IWearablesCatalogService>();
 030            var userProfileBridge = new UserProfileWebInterfaceBridge();
 31
 032            DataStore dataStore = DataStore.i;
 33
 034            var view = BackpackEditorHUDV2ComponentView.Create();
 35
 036            view.Initialize(
 37                serviceLocator.Get<ICharacterPreviewFactory>(),
 38                new PreviewCameraRotationController(),
 39                new PreviewCameraPanningController(),
 40                new PreviewCameraZoomController());
 41
 042            var backpackAnalyticsService = new BackpackAnalyticsService(
 43                Environment.i.platform.serviceProviders.analytics,
 44                new NewUserExperienceAnalytics(Environment.i.platform.serviceProviders.analytics));
 45
 046            view.OutfitsSectionComponentView.Initialize(serviceLocator.Get<ICharacterPreviewFactory>());
 47
 048            var outfitsController = new OutfitsController(
 49                view.OutfitsSectionComponentView,
 50                new LambdaOutfitsService(
 51                    serviceLocator.Get<ILambdasService>(),
 52                    serviceLocator.Get<IServiceProviders>()),
 53                userProfileBridge,
 54                dataStore,
 55                backpackAnalyticsService);
 56
 057            var backpackEmotesSectionController = new BackpackEmotesSectionController(
 58                dataStore,
 59                view.EmotesSectionTransform,
 60                userProfileBridge,
 61                serviceLocator.Get<IEmotesCatalogService>(),
 62                view.EmotesController,
 63                Environment.i.serviceLocator.Get<ICustomNftCollectionService>()
 64                );
 65
 066            var backpackFiltersController = new BackpackFiltersController(view.BackpackFiltersComponentView, wearablesCa
 67
 068            var avatarSlotsHUDController = new AvatarSlotsHUDController(view.AvatarSlotsView, backpackAnalyticsService, 
 69
 070            var wearableGridController = new WearableGridController(view.WearableGridComponentView,
 71                userProfileBridge,
 72                wearablesCatalogService,
 73                dataStore.backpackV2,
 74                new WebInterfaceBrowserBridge(),
 75                backpackFiltersController,
 76                avatarSlotsHUDController,
 77                backpackAnalyticsService,
 78                Environment.i.serviceLocator.Get<ICustomNftCollectionService>());
 79
 080            var wearablesNFTFetchHelper = new WearablesNFTFetchHelper();
 081            var environmentProvider = Environment.i.serviceLocator.Get<IEnvironmentProviderService>();
 082            var vrmExportController = new VRMDetailsController(
 83                view.VrmDetailsComponentView,
 84                userProfileBridge,
 85                wearablesNFTFetchHelper,
 86                environmentProvider
 87                );
 88
 089            hudController = new BackpackEditorHUDController(
 90                view,
 91                dataStore,
 92                CommonScriptableObjects.rendererState,
 93                userProfileBridge,
 94                wearablesCatalogService,
 95                backpackEmotesSectionController,
 96                backpackAnalyticsService,
 97                wearableGridController,
 98                avatarSlotsHUDController,
 99                outfitsController,
 100                new VRMExporter(vrmExporterReferences),
 101                vrmExportController,
 102                Environment.i.platform.serviceLocator.Get<IDCLFileBrowserService>(),
 103                Environment.i.platform.serviceLocator.Get<IEmotesCatalogService>());
 104
 0105        }
 106
 107        public void Dispose()
 108        {
 0109            hudController.Dispose();
 0110        }
 111    }
 112}