< Summary

Class:BuilderEditorHUDController
Assembly:BuildModeHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/BuilderInWorld/HUD/BuildModeHUD/Scripts/BuilderEditorHUDController.cs
Covered lines:151
Uncovered lines:142
Coverable lines:293
Total lines:647
Line coverage:51.5% (151 of 293)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Initialize(...)0%2100%
Initialize(...)0%110100%
CreateBuildModeControllers()0%110100%
CreateMainView()0%2.032080%
ConfigureSceneCatalogController()0%2100%
ConfigureEntityInformationController()0%2100%
ConfigureFirstPersonModeController()0%2100%
ConfigureShortcutsController()0%2100%
ConfigureDragAndDropSceneObjectController()0%2100%
ConfigurePublishBtnController()0%2100%
ConfigureInspectorBtnController()0%2100%
ConfigureCatalogBtnController()0%2100%
ConfigureInspectorController()0%2100%
ConfigureTopActionsButtonsController()0%2100%
ConfigureSaveHUDController()0%2100%
ConfigureNewProjectDetailsController()0%2100%
ConfigurePublicationDetailsController()0%2100%
ConfigureQuickBarController()0%2100%
QuickBarCatalogItemAssigned(...)0%2100%
SceneSaved()0%2100%
SetBuilderProjectInfo(...)0%220100%
NewProjectStart(...)0%110100%
SaveSceneInfo()0%440100%
CancelNewProjectDetails()0%110100%
SetBuilderProjectScreenshot(...)0%2100%
PublishStart()0%110100%
ConfigureConfirmationModal(...)0%110100%
ConfirmPublicationDetails()0%110100%
CancelPublicationDetails()0%110100%
CancelPublishModal(...)0%2.012085.71%
ConfirmPublishModal(...)0%5.015091.67%
FakePublishProgress()0%3.143075%
ExitStart()0%3.143075%
CancelExitModal(...)0%2.022083.33%
ConfirmExitModal(...)0%3.033085.71%
UnsubscribeConfirmationModal()0%110100%
PublishEnd(...)0%2.262060%
SetGizmosActive(...)0%2100%
SetParcelScene(...)0%110100%
SetPublishBtnAvailability(...)0%110100%
GetCatalogSectionSelected()0%2100%
ShowTooltipForCatalogItemAdapter(...)0%2100%
RefreshCatalogAssetPack()0%110100%
RefreshCatalogContent()0%110100%
StopInput()0%6200%
CatalogItemSelected(...)0%220100%
CatalogItemDropped(...)0%6200%
ToggleCatalogIfExpanded()0%2.152066.67%
SetVisibilityOfCatalog(...)0%330100%
ChangeVisibilityOfCatalog()0%110100%
ShowSceneLimitsPassed()0%6200%
UpdateSceneLimitInfo()0%110100%
ChangeVisibilityOfSceneInfo(...)0%110100%
ChangeVisibilityOfSceneInfo()0%110100%
ActivateFirstPersonModeUI()0%220100%
ActivateGodModeUI()0%220100%
EntityInformationSetEntity(...)0%110100%
ShowEntityInformation(...)0%220100%
HideEntityInformation()0%2.032080%
OnEntityInformationDisable()0%6200%
SetEntityList(...)0%2.062075%
ChangeVisibilityOfEntityList()0%440100%
ClearEntityList()0%110100%
ChangeVisibilityOfControls()0%110100%
ChangeVisibilityOfUI()0%2100%
ChangeVisibilityOfExtraBtns()0%110100%
HideExtraBtns()0%6200%
SetActionsButtonsInteractable(...)0%2100%
SetSnapModeActive(...)0%2100%
SetUndoButtonInteractable(...)0%2100%
SetRedoButtonInteractable(...)0%2100%
SetVisibility(...)0%30500%
Dispose()0%3.583060%
ToggleVisibility()0%2100%
IsVisible()0%6200%
CreateView()0%2100%
UpdateEntitiesSelection(...)0%2100%
SetVisibilityOfInspector(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/BuilderInWorld/HUD/BuildModeHUD/Scripts/BuilderEditorHUDController.cs

#LineLine coverage
 1using DCL.Configuration;
 2using DCL.Controllers;
 3using System;
 4using System.Collections;
 5using System.Collections.Generic;
 6using System.Runtime.Remoting.Contexts;
 7using DCL;
 8using DCL.Builder;
 9using UnityEngine;
 10using UnityEngine.EventSystems;
 11
 12public class BuilderEditorHUDController : IHUD, IBuilderEditorHUDController
 13{
 14    public event Action OnChangeModeAction;
 15    public event Action OnTranslateSelectedAction;
 16    public event Action OnRotateSelectedAction;
 17    public event Action OnScaleSelectedAction;
 18    public event Action OnResetAction;
 19    public event Action OnResetCameraAction;
 20    public event Action OnUndoAction;
 21    public event Action OnRedoAction;
 22    public event Action OnDuplicateSelectedAction;
 23    public event Action OnDeleteSelectedAction;
 24    public event Action OnEntityListVisible;
 25    public event Action OnStopInput;
 26    public event Action OnResumeInput;
 27    public event Action OnTutorialAction;
 28    public event Action OnPublishAction;
 29    public event Action<string, string, string> OnSaveSceneInfoAction;
 30    public event Action<string, string, string> OnConfirmPublishAction;
 31    public event Action OnStartExitAction;
 32    public event Action OnLogoutAction;
 33    public event Action OnChangeSnapModeAction;
 34    public event Action<CatalogItem> OnCatalogItemSelected;
 35    public event Action<CatalogItem> OnCatalogItemDropped;
 36    public event Action<BIWEntity> OnEntityClick;
 37    public event Action<BIWEntity> OnEntityDelete;
 38    public event Action<BIWEntity> OnEntityLock;
 39    public event Action<BIWEntity> OnEntityChangeVisibility;
 40    public event Action<BIWEntity, string> OnEntityRename;
 41    public event Action<BIWEntity> OnEntitySmartItemComponentUpdate;
 42    public event Action<Vector3> OnSelectedObjectPositionChange;
 43    public event Action<Vector3> OnSelectedObjectRotationChange;
 44    public event Action<Vector3> OnSelectedObjectScaleChange;
 45    public event Action OnCatalogOpen; // Note(Adrian): This is used right now for tutorial purposes
 46
 47    internal IBuildModeHUDView view;
 48
 49    internal bool areExtraButtonsVisible = false;
 50    internal bool isControlsVisible = false;
 51    internal bool isEntityListVisible = false;
 52    internal bool isSceneLimitInfoVisibile = false;
 53    internal bool isCatalogOpen = false;
 54
 55    internal BuildModeHUDInitializationModel controllers;
 56
 57    private Coroutine publishProgressCoroutine = null;
 58    private float timeFromLastClickOnExtraButtons = 0f;
 59    internal IContext context;
 60
 61    public void Initialize(IContext context)
 62    {
 063        this.context = context;
 064        CreateBuildModeControllers();
 065        CreateMainView();
 066        ConfigureSceneCatalogController();
 067        ConfigureEntityInformationController();
 068        ConfigureFirstPersonModeController();
 069        ConfigureShortcutsController();
 070        ConfigureDragAndDropSceneObjectController();
 071        ConfigurePublishBtnController();
 072        ConfigureInspectorBtnController();
 073        ConfigureCatalogBtnController();
 074        ConfigureInspectorController();
 075        ConfigureTopActionsButtonsController();
 076        ConfigureSaveHUDController();
 077        ConfigureNewProjectDetailsController();
 078        ConfigurePublicationDetailsController();
 079        ConfigureQuickBarController();
 080    }
 81
 82    public void Initialize(BuildModeHUDInitializationModel controllers,IContext context)
 83    {
 4584        this.context = context;
 4585        this.controllers = controllers;
 86
 4587        CreateMainView();
 4588    }
 89
 90    internal void CreateBuildModeControllers()
 91    {
 192        controllers = new BuildModeHUDInitializationModel
 93        {
 94            tooltipController = new TooltipController(),
 95            feedbackTooltipController = new TooltipController(),
 96            sceneCatalogController = new SceneCatalogController(),
 97            quickBarController = new QuickBarController(),
 98            entityInformationController = new EntityInformationController(),
 99            firstPersonModeController = new FirstPersonModeController(),
 100            shortcutsController = new ShortcutsController(),
 101            publishPopupController = new PublishPopupController(),
 102            dragAndDropSceneObjectController = new DragAndDropSceneObjectController(),
 103            publishBtnController = new PublishBtnController(),
 104            inspectorBtnController = new InspectorBtnController(),
 105            catalogBtnController = new CatalogBtnController(),
 106            inspectorController = new InspectorController(),
 107            buildModeConfirmationModalController = new BuildModeConfirmationModalController(),
 108            topActionsButtonsController = new TopActionsButtonsController(),
 109            saveHUDController = new SaveHUDController(),
 110            newProjectDetailsController = new PublicationDetailsController(),
 111            publicationDetailsController = new PublicationDetailsController()
 112        };
 1113    }
 114
 115    internal void CreateMainView()
 116    {
 46117        view = CreateView();
 118
 46119        if (view.viewGO != null)
 0120            view.viewGO.SetActive(false);
 121
 46122        view.Initialize(controllers);
 46123    }
 124
 125    private void ConfigureSceneCatalogController()
 126    {
 0127        controllers.sceneCatalogController.OnHideCatalogClicked += ChangeVisibilityOfCatalog;
 0128        controllers.sceneCatalogController.OnCatalogItemSelected += CatalogItemSelected;
 0129        controllers.sceneCatalogController.OnStopInput += StopInput;
 130
 0131        controllers.sceneCatalogController.OnResumeInput += () => OnResumeInput?.Invoke();
 0132        controllers.sceneCatalogController.OnPointerEnterInCatalogItemAdapter += ShowTooltipForCatalogItemAdapter;
 0133        controllers.sceneCatalogController.OnPointerExitInCatalogItemAdapter += (x, y) => controllers.tooltipController.
 0134    }
 135
 136    private void ConfigureEntityInformationController()
 137    {
 0138        controllers.entityInformationController.OnPositionChange += (x) => OnSelectedObjectPositionChange?.Invoke(x);
 0139        controllers.entityInformationController.OnRotationChange += (x) => OnSelectedObjectRotationChange?.Invoke(x);
 0140        controllers.entityInformationController.OnScaleChange += (x) => OnSelectedObjectScaleChange?.Invoke(x);
 0141        controllers.entityInformationController.OnNameChange += (entity, newName) => OnEntityRename?.Invoke(entity, newN
 0142        controllers.entityInformationController.OnSmartItemComponentUpdate += (entity) => OnEntitySmartItemComponentUpda
 0143        controllers.entityInformationController.OnDisable += OnEntityInformationDisable;
 0144    }
 145
 0146    private void ConfigureFirstPersonModeController() { controllers.firstPersonModeController.OnClick += () => OnChangeM
 147
 0148    private void ConfigureShortcutsController() { controllers.shortcutsController.OnCloseClick += ChangeVisibilityOfCont
 149
 150    private void ConfigureDragAndDropSceneObjectController()
 151    {
 0152        controllers.dragAndDropSceneObjectController.OnStopInput += StopInput;
 0153        controllers.dragAndDropSceneObjectController.OnResumeInput += () => OnResumeInput?.Invoke();
 0154        controllers.dragAndDropSceneObjectController.OnCatalogItemDropped += CatalogItemDropped;
 0155    }
 156
 0157    private void ConfigurePublishBtnController() { controllers.publishBtnController.OnClick += () => OnPublishAction?.In
 158
 0159    private void ConfigureInspectorBtnController() { controllers.inspectorBtnController.OnClick += () => ChangeVisibilit
 160
 0161    private void ConfigureCatalogBtnController() { controllers.catalogBtnController.OnClick += ChangeVisibilityOfCatalog
 162
 163    private void ConfigureInspectorController()
 164    {
 0165        controllers.inspectorController.OnEntityClick += (x) => OnEntityClick(x);
 0166        controllers.inspectorController.OnEntityDelete += (x) => OnEntityDelete(x);
 0167        controllers.inspectorController.OnEntityLock += (x) => OnEntityLock(x);
 0168        controllers.inspectorController.OnEntityChangeVisibility += (x) => OnEntityChangeVisibility(x);
 0169        controllers.inspectorController.OnEntityRename += (entity, newName) => OnEntityRename(entity, newName);
 0170        controllers.inspectorController.SetCloseButtonsAction(ChangeVisibilityOfEntityList);
 0171    }
 172
 173    private void ConfigureTopActionsButtonsController()
 174    {
 0175        controllers.topActionsButtonsController.OnChangeModeClick += () => OnChangeModeAction?.Invoke();
 0176        controllers.topActionsButtonsController.OnExtraClick += ChangeVisibilityOfExtraBtns;
 0177        controllers.topActionsButtonsController.OnTranslateClick += () => OnTranslateSelectedAction?.Invoke();
 0178        controllers.topActionsButtonsController.OnRotateClick += () => OnRotateSelectedAction?.Invoke();
 0179        controllers.topActionsButtonsController.OnScaleClick += () => OnScaleSelectedAction?.Invoke();
 0180        controllers.topActionsButtonsController.OnUndoClick += () => OnUndoAction?.Invoke();
 0181        controllers.topActionsButtonsController.OnRedoClick += () => OnRedoAction?.Invoke();
 0182        controllers.topActionsButtonsController.OnDuplicateClick += () => OnDuplicateSelectedAction?.Invoke();
 0183        controllers.topActionsButtonsController.OnDeleteClick += () => OnDeleteSelectedAction?.Invoke();
 0184        controllers.topActionsButtonsController.OnSnapModeClick += () => OnChangeSnapModeAction?.Invoke();
 0185        controllers.topActionsButtonsController.OnLogOutClick += ExitStart;
 0186        controllers.topActionsButtonsController.extraActionsController.OnControlsClick += ChangeVisibilityOfControls;
 0187        controllers.topActionsButtonsController.extraActionsController.OnHideUIClick += ChangeVisibilityOfUI;
 0188        controllers.topActionsButtonsController.extraActionsController.OnResetClick += () => OnResetAction?.Invoke();
 0189        controllers.topActionsButtonsController.extraActionsController.OnTutorialClick += () => OnTutorialAction?.Invoke
 0190        controllers.topActionsButtonsController.extraActionsController.OnResetCameraClick += () => OnResetCameraAction?.
 191
 0192        controllers.topActionsButtonsController.extraActionsController.SetResetButtonInteractable(false);
 0193    }
 194
 0195    private void ConfigureSaveHUDController() { OnLogoutAction += controllers.saveHUDController.StopAnimation; }
 196
 197    private void ConfigureNewProjectDetailsController()
 198    {
 0199        controllers.newProjectDetailsController.OnCancel += CancelNewProjectDetails;
 0200        controllers.newProjectDetailsController.OnConfirm += SaveSceneInfo;
 0201    }
 202
 203    private void ConfigurePublicationDetailsController()
 204    {
 0205        controllers.publicationDetailsController.OnCancel += CancelPublicationDetails;
 0206        controllers.publicationDetailsController.OnConfirm += ConfirmPublicationDetails;
 0207    }
 208
 0209    private void ConfigureQuickBarController() { controllers.quickBarController.OnCatalogItemAssigned += QuickBarCatalog
 210
 0211    private void QuickBarCatalogItemAssigned(CatalogItem item) { BIWAnalytics.QuickAccessAssigned(item, GetCatalogSectio
 212
 0213    public void SceneSaved() { controllers.saveHUDController.SceneStateSave(); }
 214
 215    public void SetBuilderProjectInfo(string projectName, string projectDescription)
 216    {
 2217        if (!string.IsNullOrEmpty(projectName))
 218        {
 1219            controllers.newProjectDetailsController.SetCustomPublicationInfo(projectName, projectDescription);
 1220            controllers.publicationDetailsController.SetCustomPublicationInfo(projectName, projectDescription);
 1221        }
 222        else
 223        {
 1224            controllers.newProjectDetailsController.SetDefaultPublicationInfo();
 1225            controllers.publicationDetailsController.SetDefaultPublicationInfo();
 226        }
 1227    }
 228
 229    public void NewProjectStart(Texture2D screenshot)
 230    {
 1231        controllers.newProjectDetailsController.SetPublicationScreenshot(screenshot);
 232
 233        // TODO: This is temporal until we add the Welcome panel where the user will be able to edit the project info
 234        //controllers.newProjectDetailsController.SetActive(true);
 1235        SaveSceneInfo();
 1236    }
 237
 238    public void SaveSceneInfo()
 239    {
 2240        Texture2D newSceneScreenshotTexture = context.cameraController.GetLastScreenshot();
 2241        string newSceneName = controllers.newProjectDetailsController.GetSceneName();
 2242        string newSceneDescription = controllers.newProjectDetailsController.GetSceneDescription();
 243
 2244        controllers.publicationDetailsController.SetCustomPublicationInfo(newSceneName, newSceneDescription);
 2245        controllers.newProjectDetailsController.SetActive(false);
 246
 2247        OnSaveSceneInfoAction?.Invoke(
 248            newSceneName,
 249            newSceneDescription,
 250            newSceneScreenshotTexture != null ? Convert.ToBase64String(newSceneScreenshotTexture.EncodeToJPG(90)) : "");
 1251    }
 252
 2253    internal void CancelNewProjectDetails() { controllers.newProjectDetailsController.SetActive(false); }
 254
 255    public void SetBuilderProjectScreenshot(Texture2D screenshot)
 256    {
 0257        controllers.publicationDetailsController.SetPublicationScreenshot(screenshot);
 0258        controllers.newProjectDetailsController.SetPublicationScreenshot(screenshot);
 0259    }
 260
 2261    public void PublishStart() { controllers.publicationDetailsController.SetActive(true); }
 262
 263    public void ConfigureConfirmationModal(string title, string subTitle, string cancelButtonText, string confirmButtonT
 264    {
 2265        controllers.buildModeConfirmationModalController.Configure(
 266            title,
 267            subTitle,
 268            cancelButtonText,
 269            confirmButtonText);
 2270    }
 271
 272    internal void ConfirmPublicationDetails()
 273    {
 1274        UnsubscribeConfirmationModal();
 275
 1276        controllers.buildModeConfirmationModalController.OnCancelExit += CancelPublishModal;
 1277        controllers.buildModeConfirmationModalController.OnConfirmExit += ConfirmPublishModal;
 278
 1279        ConfigureConfirmationModal(
 280            BIWSettings.PUBLISH_MODAL_TITLE,
 281            BIWSettings.PUBLISH_MODAL_SUBTITLE,
 282            BIWSettings.PUBLISH_MODAL_CANCEL_BUTTON,
 283            BIWSettings.PUBLISH_MODAL_CONFIRM_BUTTON);
 284
 1285        controllers.buildModeConfirmationModalController.SetActive(true, BuildModeModalType.PUBLISH);
 1286        controllers.publicationDetailsController.SetActive(false);
 1287    }
 288
 2289    internal void CancelPublicationDetails() { controllers.publicationDetailsController.SetActive(false); }
 290
 291    internal void CancelPublishModal(BuildModeModalType modalType)
 292    {
 1293        if (modalType != BuildModeModalType.PUBLISH)
 0294            return;
 295
 1296        controllers.buildModeConfirmationModalController.SetActive(false, BuildModeModalType.PUBLISH);
 1297        controllers.publicationDetailsController.SetActive(true);
 298
 1299        controllers.buildModeConfirmationModalController.OnCancelExit -= CancelPublishModal;
 1300        controllers.buildModeConfirmationModalController.OnConfirmExit -= ConfirmPublishModal;
 1301    }
 302
 303    internal void ConfirmPublishModal(BuildModeModalType modalType)
 304    {
 1305        if (modalType != BuildModeModalType.PUBLISH)
 0306            return;
 307
 1308        controllers.publishPopupController.PublishStart();
 309
 1310        Texture2D sceneScreenshotTexture = controllers.publicationDetailsController.GetSceneScreenshotTexture();
 1311        string sceneName = controllers.publicationDetailsController.GetSceneName();
 1312        string sceneDescription = controllers.publicationDetailsController.GetSceneDescription();
 313
 1314        OnConfirmPublishAction?.Invoke(
 315            sceneName,
 316            sceneDescription,
 317            sceneScreenshotTexture != null ? Convert.ToBase64String(sceneScreenshotTexture.EncodeToJPG(90)) : "");
 318
 1319        controllers.newProjectDetailsController.SetCustomPublicationInfo(sceneName, sceneDescription);
 320
 321        // NOTE (Santi): This is temporal until we implement the way of return the publish progress from the kernel side
 322        //               Meanwhile we will display a fake progress.
 1323        publishProgressCoroutine = CoroutineStarter.Start(FakePublishProgress());
 324
 1325        controllers.buildModeConfirmationModalController.OnCancelExit -= CancelPublishModal;
 1326        controllers.buildModeConfirmationModalController.OnConfirmExit -= ConfirmPublishModal;
 1327    }
 328
 329    private IEnumerator FakePublishProgress()
 330    {
 0331        while (true)
 332        {
 1333            float newPercentage = Mathf.Clamp(
 334                controllers.publishPopupController.currentProgress + UnityEngine.Random.Range(10f, 30f),
 335                controllers.publishPopupController.currentProgress,
 336                99f);
 337
 1338            controllers.publishPopupController.SetPercentage(newPercentage);
 339
 1340            yield return new WaitForSeconds(UnityEngine.Random.Range(0f, 0.5f));
 341        }
 342    }
 343
 344    public void ExitStart()
 345    {
 1346        if (controllers.buildModeConfirmationModalController.IsViewActive())
 0347            return;
 1348        UnsubscribeConfirmationModal();
 349
 1350        controllers.buildModeConfirmationModalController.OnCancelExit += CancelExitModal;
 1351        controllers.buildModeConfirmationModalController.OnConfirmExit += ConfirmExitModal;
 352
 1353        controllers.buildModeConfirmationModalController.SetActive(true, BuildModeModalType.EXIT);
 354
 1355        OnStartExitAction?.Invoke();
 0356    }
 357
 358    internal void CancelExitModal(BuildModeModalType modalType)
 359    {
 1360        if (modalType != BuildModeModalType.EXIT)
 0361            return;
 362
 1363        controllers.buildModeConfirmationModalController.SetActive(false, BuildModeModalType.EXIT);
 364
 1365        controllers.buildModeConfirmationModalController.OnCancelExit -= CancelExitModal;
 1366        controllers.buildModeConfirmationModalController.OnConfirmExit -= ConfirmExitModal;
 1367    }
 368
 369    internal void ConfirmExitModal(BuildModeModalType modalType)
 370    {
 1371        if (modalType != BuildModeModalType.EXIT)
 0372            return;
 373
 1374        OnLogoutAction?.Invoke();
 375
 1376        controllers.buildModeConfirmationModalController.OnCancelExit -= CancelExitModal;
 1377        controllers.buildModeConfirmationModalController.OnConfirmExit -= ConfirmExitModal;
 378
 1379        controllers.publicationDetailsController.SetDefaultPublicationInfo();
 1380    }
 381
 382    private void UnsubscribeConfirmationModal()
 383    {
 2384        controllers.buildModeConfirmationModalController.OnCancelExit -= CancelPublishModal;
 2385        controllers.buildModeConfirmationModalController.OnCancelExit -= CancelExitModal;
 2386        controllers.buildModeConfirmationModalController.OnConfirmExit -= ConfirmPublishModal;
 2387        controllers.buildModeConfirmationModalController.OnConfirmExit -= ConfirmExitModal;
 2388    }
 389
 390    public void PublishEnd(bool isOk, string message)
 391    {
 2392        if (publishProgressCoroutine != null)
 393        {
 0394            CoroutineStarter.Stop(publishProgressCoroutine);
 0395            publishProgressCoroutine = null;
 396        }
 397
 2398        controllers.publishPopupController.PublishEnd(isOk, message);
 2399    }
 400
 0401    public void SetGizmosActive(string gizmos) { controllers.topActionsButtonsController.SetGizmosActive(gizmos); }
 2402    public void SetParcelScene(IParcelScene IParcelScene) { controllers.inspectorController.sceneLimitsController.SetPar
 403
 4404    public void SetPublishBtnAvailability(bool isAvailable, string feedbackMessage = "") { view.SetPublishBtnAvailabilit
 405
 406    #region Catalog
 407
 0408    public BuildModeCatalogSection GetCatalogSectionSelected() { return controllers.sceneCatalogController.GetCurrentSec
 409
 410    private void ShowTooltipForCatalogItemAdapter(PointerEventData data, CatalogItemAdapter adapter)
 411    {
 0412        controllers.tooltipController.SetTooltipText(adapter.GetContent().name);
 0413        controllers.tooltipController.ShowTooltip(data);
 0414    }
 415
 2416    public void RefreshCatalogAssetPack() { view.RefreshCatalogAssetPack(); }
 417
 2418    public void RefreshCatalogContent() { view.RefreshCatalogContent(); }
 419
 420    public void StopInput()
 421    {
 0422        OnStopInput?.Invoke();
 0423        ToggleCatalogIfExpanded();
 0424    }
 425
 426    public void CatalogItemSelected(CatalogItem catalogItem)
 427    {
 1428        OnCatalogItemSelected?.Invoke(catalogItem);
 1429        ToggleCatalogIfExpanded();
 1430    }
 431
 432    public void CatalogItemDropped(CatalogItem catalogItem)
 433    {
 0434        OnCatalogItemDropped?.Invoke(catalogItem);
 0435        ToggleCatalogIfExpanded();
 0436    }
 437
 438    private void ToggleCatalogIfExpanded()
 439    {
 1440        if (controllers.sceneCatalogController.IsCatalogExpanded())
 0441            controllers.sceneCatalogController.ToggleCatalogExpanse();
 1442    }
 443
 444    public void SetVisibilityOfCatalog(bool isVisible)
 445    {
 3446        isCatalogOpen = isVisible;
 3447        view.SetVisibilityOfCatalog(isCatalogOpen);
 448
 3449        if (isVisible)
 2450            OnCatalogOpen?.Invoke();
 2451    }
 452
 453    public void ChangeVisibilityOfCatalog()
 454    {
 1455        isCatalogOpen = !controllers.sceneCatalogController.IsCatalogOpen();
 1456        SetVisibilityOfCatalog(isCatalogOpen);
 1457    }
 458
 459    #endregion
 460
 461    #region SceneLimitInfo
 462
 463    public void ShowSceneLimitsPassed()
 464    {
 0465        if (!isSceneLimitInfoVisibile)
 0466            ChangeVisibilityOfSceneInfo();
 0467    }
 468
 2469    public void UpdateSceneLimitInfo() { controllers.inspectorController.sceneLimitsController.UpdateInfo(); }
 470
 471    public void ChangeVisibilityOfSceneInfo(bool shouldBeVisibile)
 472    {
 2473        isSceneLimitInfoVisibile = shouldBeVisibile;
 2474        view.SetVisibilityOfSceneInfo(isSceneLimitInfoVisibile);
 2475    }
 476
 477    public void ChangeVisibilityOfSceneInfo()
 478    {
 1479        isSceneLimitInfoVisibile = !isSceneLimitInfoVisibile;
 1480        view.SetVisibilityOfSceneInfo(isSceneLimitInfoVisibile);
 1481    }
 482
 483    #endregion
 484
 485    public void ActivateFirstPersonModeUI()
 486    {
 1487        if (view != null)
 1488            view.SetFirstPersonView();
 1489    }
 490
 491    public void ActivateGodModeUI()
 492    {
 1493        if (view != null)
 1494            view.SetGodModeView();
 1495    }
 496
 497    #region EntityInformation
 498
 2499    public void EntityInformationSetEntity(BIWEntity entity, IParcelScene scene) { controllers.entityInformationControll
 500
 501    public void ShowEntityInformation(bool activateTransparencyMode = false)
 502    {
 2503        controllers.entityInformationController.Enable();
 2504        controllers.entityInformationController.SetTransparencyMode(activateTransparencyMode);
 2505        controllers.sceneCatalogController.CloseCatalog();
 2506        controllers.tooltipController.HideTooltip();
 507
 2508        if (activateTransparencyMode)
 1509            controllers.catalogBtnController.SetActive(false);
 2510    }
 511
 512    public void HideEntityInformation()
 513    {
 1514        controllers.entityInformationController.Disable();
 1515        controllers.catalogBtnController.SetActive(true);
 516
 1517        if (isCatalogOpen)
 0518            controllers.sceneCatalogController.SetActive(true);
 1519    }
 520
 521    private void OnEntityInformationDisable()
 522    {
 0523        if (isCatalogOpen)
 0524            controllers.sceneCatalogController.SetActive(true);
 0525    }
 526
 527    #endregion
 528
 529    public void SetEntityList(List<BIWEntity> entityList)
 530    {
 1531        controllers.inspectorController.SetEntityList(entityList);
 532
 1533        if (view.entityInformation != null)
 0534            view.entityInformation.smartItemListView.SetEntityList(entityList);
 1535    }
 536
 537    public void ChangeVisibilityOfEntityList()
 538    {
 2539        isEntityListVisible = !isEntityListVisible;
 2540        controllers.saveHUDController?.SetSaveViewByEntityListOpen(isEntityListVisible);
 2541        if (isEntityListVisible)
 542        {
 1543            OnEntityListVisible?.Invoke();
 1544            controllers.inspectorController.OpenEntityList();
 1545        }
 546        else
 547        {
 1548            controllers.inspectorController.CloseList();
 549        }
 1550    }
 551
 2552    public void ClearEntityList() { controllers.inspectorController.ClearList(); }
 553
 554    public void ChangeVisibilityOfControls()
 555    {
 1556        isControlsVisible = !isControlsVisible;
 1557        view.SetVisibilityOfControls(isControlsVisible);
 1558    }
 559
 560    public void ChangeVisibilityOfUI()
 561    {
 0562        DataStore.i.builderInWorld.showTaskBar.Set(!IsVisible());
 0563        SetVisibility(!IsVisible());
 0564    }
 565
 566    #region TopButtons
 567
 568    public void ChangeVisibilityOfExtraBtns()
 569    {
 1570        areExtraButtonsVisible = !areExtraButtonsVisible;
 1571        view.SetVisibilityOfExtraBtns(areExtraButtonsVisible);
 1572        timeFromLastClickOnExtraButtons = Time.realtimeSinceStartup;
 1573    }
 574
 575    public void HideExtraBtns()
 576    {
 0577        if ((Time.realtimeSinceStartup - timeFromLastClickOnExtraButtons) <= 0.1f)
 0578            return;
 579
 0580        areExtraButtonsVisible = false;
 0581        controllers.topActionsButtonsController.extraActionsController.SetActive(areExtraButtonsVisible);
 0582    }
 583
 0584    public void SetActionsButtonsInteractable(bool isInteractable) { controllers.topActionsButtonsController.SetActionsI
 585
 0586    public void SetSnapModeActive(bool isActive) { controllers.topActionsButtonsController.SetSnapActive(isActive); }
 587
 0588    public void SetUndoButtonInteractable(bool isInteractable) { controllers.topActionsButtonsController.SetUndoInteract
 0589    public void SetRedoButtonInteractable(bool isInteractable) { controllers.topActionsButtonsController.SetRedoInteract
 590
 591    #endregion
 592
 593    public void SetVisibility(bool visible)
 594    {
 0595        if (view == null)
 0596            return;
 597
 0598        if (IsVisible() && !visible)
 599        {
 0600            view.AnimatorShow(false);
 0601            AudioScriptableObjects.fadeOut.Play(true);
 0602        }
 0603        else if (!IsVisible() && visible)
 604        {
 0605            view.SetActive(true);
 0606            view.AnimatorShow(true);
 0607            AudioScriptableObjects.fadeIn.Play(true);
 608        }
 0609    }
 610
 611    public void Dispose()
 612    {
 45613        if (view == null)
 0614            return;
 45615        else if (view.viewGO != null)
 0616            UnityEngine.Object.Destroy(view.viewGO);
 45617    }
 618
 0619    public void ToggleVisibility() { SetVisibility(!IsVisible()); }
 620
 621    public bool IsVisible()
 622    {
 0623        if (view == null)
 0624            return false;
 625
 0626        return view.isShowHideAnimatorVisible;
 627    }
 628
 0629    internal virtual IBuildModeHUDView CreateView() => BuildModeHUDView.Create();
 630
 631    public void UpdateEntitiesSelection(int numberOfSelectedEntities)
 632    {
 0633        controllers.entityInformationController.UpdateEntitiesSelection(numberOfSelectedEntities);
 0634        controllers.topActionsButtonsController.extraActionsController.SetResetButtonInteractable(numberOfSelectedEntiti
 0635    }
 636
 637    #region Inspector
 638
 639    public void SetVisibilityOfInspector(bool isVisible)
 640    {
 2641        isEntityListVisible = isVisible;
 2642        view.SetVisibilityOfInspector(isVisible);
 2643    }
 644
 645    #endregion
 646
 647}

Methods/Properties

Initialize(DCL.Builder.IContext)
Initialize(BuildModeHUDInitializationModel, DCL.Builder.IContext)
CreateBuildModeControllers()
CreateMainView()
ConfigureSceneCatalogController()
ConfigureEntityInformationController()
ConfigureFirstPersonModeController()
ConfigureShortcutsController()
ConfigureDragAndDropSceneObjectController()
ConfigurePublishBtnController()
ConfigureInspectorBtnController()
ConfigureCatalogBtnController()
ConfigureInspectorController()
ConfigureTopActionsButtonsController()
ConfigureSaveHUDController()
ConfigureNewProjectDetailsController()
ConfigurePublicationDetailsController()
ConfigureQuickBarController()
QuickBarCatalogItemAssigned(CatalogItem)
SceneSaved()
SetBuilderProjectInfo(System.String, System.String)
NewProjectStart(UnityEngine.Texture2D)
SaveSceneInfo()
CancelNewProjectDetails()
SetBuilderProjectScreenshot(UnityEngine.Texture2D)
PublishStart()
ConfigureConfirmationModal(System.String, System.String, System.String, System.String)
ConfirmPublicationDetails()
CancelPublicationDetails()
CancelPublishModal(BuildModeModalType)
ConfirmPublishModal(BuildModeModalType)
FakePublishProgress()
ExitStart()
CancelExitModal(BuildModeModalType)
ConfirmExitModal(BuildModeModalType)
UnsubscribeConfirmationModal()
PublishEnd(System.Boolean, System.String)
SetGizmosActive(System.String)
SetParcelScene(DCL.Controllers.IParcelScene)
SetPublishBtnAvailability(System.Boolean, System.String)
GetCatalogSectionSelected()
ShowTooltipForCatalogItemAdapter(UnityEngine.EventSystems.PointerEventData, CatalogItemAdapter)
RefreshCatalogAssetPack()
RefreshCatalogContent()
StopInput()
CatalogItemSelected(CatalogItem)
CatalogItemDropped(CatalogItem)
ToggleCatalogIfExpanded()
SetVisibilityOfCatalog(System.Boolean)
ChangeVisibilityOfCatalog()
ShowSceneLimitsPassed()
UpdateSceneLimitInfo()
ChangeVisibilityOfSceneInfo(System.Boolean)
ChangeVisibilityOfSceneInfo()
ActivateFirstPersonModeUI()
ActivateGodModeUI()
EntityInformationSetEntity(BIWEntity, DCL.Controllers.IParcelScene)
ShowEntityInformation(System.Boolean)
HideEntityInformation()
OnEntityInformationDisable()
SetEntityList(System.Collections.Generic.List[BIWEntity])
ChangeVisibilityOfEntityList()
ClearEntityList()
ChangeVisibilityOfControls()
ChangeVisibilityOfUI()
ChangeVisibilityOfExtraBtns()
HideExtraBtns()
SetActionsButtonsInteractable(System.Boolean)
SetSnapModeActive(System.Boolean)
SetUndoButtonInteractable(System.Boolean)
SetRedoButtonInteractable(System.Boolean)
SetVisibility(System.Boolean)
Dispose()
ToggleVisibility()
IsVisible()
CreateView()
UpdateEntitiesSelection(System.Int32)
SetVisibilityOfInspector(System.Boolean)