Ejemplo n.º 1
0
    private bool newTaskbarIsEnabled = false; // NOTE(Santi): This is temporal, until we remove the old taskbar

    private void Awake()
    {
        i = this;

        toggleUIVisibilityTrigger              = Resources.Load <InputAction_Trigger>(TOGGLE_UI_VISIBILITY_ASSET_NAME);
        toggleUIVisibilityTrigger.OnTriggered += ToggleUIVisibility_OnTriggered;
    }
Ejemplo n.º 2
0
        public IEnumerator Toggle()
        {
            InputAction_Trigger action = null;
            var inputController        = GameObject.FindObjectOfType <InputController>();

            for (int i = 0; i < inputController.triggerTimeActions.Length; i++)
            {
                // Find the open nav map action used by the input controller
                if (inputController.triggerTimeActions[i].GetDCLAction() == DCLAction_Trigger.ToggleNavMap)
                {
                    action = inputController.triggerTimeActions[i];
                    break;
                }
            }

            Assert.IsNotNull(action);

            action.RaiseOnTriggered();

            yield return(null);

            Assert.IsTrue(navmapView.scrollRect.gameObject.activeSelf);

            action.RaiseOnTriggered();

            yield return(null);

            Assert.IsFalse(navmapView.scrollRect.gameObject.activeSelf);
        }
Ejemplo n.º 3
0
    public void Initialize(ChatHUDView view = null, UnityAction <ChatMessage> onSendMessage = null)
    {
        this.view = view ?? ChatHUDView.Create();

        this.view.Initialize(this, onSendMessage);

        this.view.OnPressPrivateMessage -= View_OnPressPrivateMessage;
        this.view.OnPressPrivateMessage += View_OnPressPrivateMessage;

        if (this.view.contextMenu != null)
        {
            this.view.contextMenu.OnShowMenu -= ContextMenu_OnShowMenu;
            this.view.contextMenu.OnShowMenu += ContextMenu_OnShowMenu;

            this.view.contextMenu.OnPassport -= ContextMenu_OnPassport;
            this.view.contextMenu.OnPassport += ContextMenu_OnPassport;

            this.view.contextMenu.OnBlock -= ContextMenu_OnBlock;
            this.view.contextMenu.OnBlock += ContextMenu_OnBlock;

            this.view.contextMenu.OnReport -= ContextMenu_OnReport;
            this.view.contextMenu.OnReport += ContextMenu_OnReport;
        }

        closeWindowTrigger              = Resources.Load <InputAction_Trigger>("CloseWindow");
        closeWindowTrigger.OnTriggered -= OnCloseButtonPressed;
        closeWindowTrigger.OnTriggered += OnCloseButtonPressed;
    }
Ejemplo n.º 4
0
    public override void Init(BIWContext context)
    {
        base.Init(context);

        lookAtT = new GameObject("BIWGodModeTransform").transform;
        maxDistanceToSelectEntitiesValue = context.godModeDynamicVariablesAsset.maxDistanceToSelectEntities;

        snapFactor = context.godModeDynamicVariablesAsset.snapFactor;
        snapRotationDegresFactor       = context.godModeDynamicVariablesAsset.snapRotationDegresFactor;
        snapScaleFactor                = context.godModeDynamicVariablesAsset.snapScaleFactor;
        snapDistanceToActivateMovement = context.godModeDynamicVariablesAsset.snapDistanceToActivateMovement;

        initialEagleCameraHeight       = context.godModeDynamicVariablesAsset.initialEagleCameraHeight;
        initialEagleCameraDistance     = context.godModeDynamicVariablesAsset.initialEagleCameraDistance;
        initialEagleCameraLookAtHeight = context.godModeDynamicVariablesAsset.initialEagleCameraLookAtHeight;

        snapDragFactor = context.godModeDynamicVariablesAsset.snapDragFactor;

        outlinerController = context.outlinerController;
        gizmoManager       = context.gizmosController;

        if (HUDController.i.builderInWorldMainHud != null)
        {
            HUDController.i.builderInWorldMainHud.OnTranslateSelectedAction      += TranslateMode;
            HUDController.i.builderInWorldMainHud.OnRotateSelectedAction         += RotateMode;
            HUDController.i.builderInWorldMainHud.OnScaleSelectedAction          += ScaleMode;
            HUDController.i.builderInWorldMainHud.OnSelectedObjectPositionChange += UpdateSelectionPosition;
            HUDController.i.builderInWorldMainHud.OnSelectedObjectRotationChange += UpdateSelectionRotation;
            HUDController.i.builderInWorldMainHud.OnSelectedObjectScaleChange    += UpdateSelectionScale;
            HUDController.i.builderInWorldMainHud.OnResetCameraAction            += ResetCamera;
            HUDController.i.builderInWorldMainHud.OnPublishAction += TakeSceneScreenshotForPublish;
        }

        if (context.sceneReferences.cameraController.TryGetCameraStateByType <FreeCameraMovement>(out CameraStateBase cameraState))
        {
            freeCameraController = (FreeCameraMovement)cameraState;
        }
        mouseCatcher     = context.sceneReferences.mouseCatcher;
        avatarRenderer   = context.sceneReferences.playerAvatarController;
        cameraController = context.sceneReferences.cameraController;

        BIWInputWrapper.OnMouseDown   += OnInputMouseDown;
        BIWInputWrapper.OnMouseUp     += OnInputMouseUp;
        BIWInputWrapper.OnMouseUpOnUI += OnInputMouseUpOnUi;
        BIWInputWrapper.OnMouseDrag   += OnInputMouseDrag;

        focusOnSelectedEntitiesInputAction = context.inputsReferencesAsset.focusOnSelectedEntitiesInputAction;
        multiSelectionInputAction          = context.inputsReferencesAsset.multiSelectionInputAction;

        focusOnSelectedEntitiesInputAction.OnTriggered += (o) => FocusOnSelectedEntitiesInput();

        multiSelectionInputAction.OnStarted  += (o) => ChangeSnapTemporaryActivated();
        multiSelectionInputAction.OnFinished += (o) => ChangeSnapTemporaryDeactivated();

        gizmoManager.OnChangeTransformValue      += EntitiesTransfromByGizmos;
        gizmoManager.OnGizmoTransformObjectEnd   += OnGizmosTransformEnd;
        gizmoManager.OnGizmoTransformObjectStart += OnGizmosTransformStart;
    }
    public override void Initialize()
    {
        base.Initialize();

        if (isInit)
        {
            return;
        }

        activeFeature = true;

        isInit = true;

        BIWCatalogManager.Init();

        CreateControllers();
        InitReferences();


        if (builderInWorldBridge != null)
        {
            builderInWorldBridge.OnCatalogHeadersReceived += CatalogHeadersReceived;
            builderInWorldBridge.OnBuilderProjectInfo     -= BuilderProjectPanelInfo;
        }

        userProfile = UserProfile.GetOwnUserProfile();
        if (!string.IsNullOrEmpty(userProfile.userId))
        {
            updateLandsWithAcessCoroutine = CoroutineStarter.Start(CheckLandsAccess());
        }
        else
        {
            userProfile.OnUpdate += OnUserProfileUpdate;
        }

        InitHUD();

        BIWTeleportAndEdit.OnTeleportEnd += OnPlayerTeleportedToEditScene;

        ConfigureLoadingController();
        InitControllers();

        CommonScriptableObjects.builderInWorldNotNecessaryUIVisibilityStatus.Set(true);

        builderInWorldBridge.AskKernelForCatalogHeaders();

        isCatalogLoading = true;
        BIWNFTController.i.Initialize();
        BIWNFTController.i.OnNFTUsageChange += OnNFTUsageChange;

        editModeChangeInputAction              = context.inputsReferencesAsset.editModeChangeInputAction;
        editModeChangeInputAction.OnTriggered += ChangeEditModeStatusByShortcut;

        biwAudioHandler = GameObject.Instantiate(context.projectReferencesAsset.audioPrefab, Vector3.zero, Quaternion.identity).GetComponent <BuilderInWorldAudioHandler>();
        biwAudioHandler.SetReferences(context);
        biwAudioHandler.gameObject.SetActive(false);
    }
Ejemplo n.º 6
0
    private void Awake()
    {
        i = this;

        toggleUIVisibilityTrigger              = Resources.Load <InputAction_Trigger>(TOGGLE_UI_VISIBILITY_ASSET_NAME);
        toggleUIVisibilityTrigger.OnTriggered += ToggleUIVisibility_OnTriggered;

        CommonScriptableObjects.allUIHidden.OnChange += AllUIHiddenOnOnChange;
        UserContextMenu.OnOpenPrivateChatRequest     += OpenPrivateChatWindow;
    }
Ejemplo n.º 7
0
    public void Initialize(IHUDFactory hudFactory)
    {
        i = this;
        this.hudFactory = hudFactory;

        toggleUIVisibilityTrigger              = Resources.Load <InputAction_Trigger>(TOGGLE_UI_VISIBILITY_ASSET_NAME);
        toggleUIVisibilityTrigger.OnTriggered += ToggleUIVisibility_OnTriggered;

        CommonScriptableObjects.allUIHidden.OnChange += AllUIHiddenOnOnChange;
        UserContextMenu.OnOpenPrivateChatRequest     += OpenPrivateChatWindow;
    }
Ejemplo n.º 8
0
    public void Initialize(IMouseCatcher mouseCatcher, IChatController chatController,
                           IFriendsController friendsController)
    {
        this.mouseCatcher   = mouseCatcher;
        this.chatController = chatController;

        view = TaskbarHUDView.Create(this, chatController, friendsController);

        if (mouseCatcher != null)
        {
            mouseCatcher.OnMouseLock   -= MouseCatcher_OnMouseLock;
            mouseCatcher.OnMouseUnlock -= MouseCatcher_OnMouseUnlock;
            mouseCatcher.OnMouseLock   += MouseCatcher_OnMouseLock;
            mouseCatcher.OnMouseUnlock += MouseCatcher_OnMouseUnlock;
        }

        view.chatHeadsGroup.OnHeadToggleOn  += ChatHeadsGroup_OnHeadOpen;
        view.chatHeadsGroup.OnHeadToggleOff += ChatHeadsGroup_OnHeadClose;

        view.windowContainerLayout.enabled = false;

        view.OnChatToggleOff    += View_OnChatToggleOff;
        view.OnChatToggleOn     += View_OnChatToggleOn;
        view.OnFriendsToggleOff += View_OnFriendsToggleOff;
        view.OnFriendsToggleOn  += View_OnFriendsToggleOn;

        toggleFriendsTrigger              = Resources.Load <InputAction_Trigger>("ToggleFriends");
        toggleFriendsTrigger.OnTriggered -= ToggleFriendsTrigger_OnTriggered;
        toggleFriendsTrigger.OnTriggered += ToggleFriendsTrigger_OnTriggered;

        closeWindowTrigger              = Resources.Load <InputAction_Trigger>("CloseWindow");
        closeWindowTrigger.OnTriggered -= CloseWindowTrigger_OnTriggered;
        closeWindowTrigger.OnTriggered += CloseWindowTrigger_OnTriggered;

        toggleWorldChatTrigger              = Resources.Load <InputAction_Trigger>("ToggleWorldChat");
        toggleWorldChatTrigger.OnTriggered -= ToggleWorldChatTrigger_OnTriggered;
        toggleWorldChatTrigger.OnTriggered += ToggleWorldChatTrigger_OnTriggered;

        if (chatController != null)
        {
            chatController.OnAddMessage -= OnAddMessage;
            chatController.OnAddMessage += OnAddMessage;
        }

        view.windowContainerAnimator.Show();
    }
    public override void Init(BIWContext context)
    {
        base.Init(context);
        if (HUDController.i.builderInWorldMainHud != null)
        {
            hudController = HUDController.i.builderInWorldMainHud;
            hudController.OnEntityDelete            += DeleteSingleEntity;
            hudController.OnDuplicateSelectedAction += DuplicateSelectedEntitiesInput;
            hudController.OnDeleteSelectedAction    += DeleteSelectedEntitiesInput;
            hudController.OnEntityClick             += ChangeEntitySelectionFromList;
            hudController.OnEntityLock                     += ChangeEntityLockStatus;
            hudController.OnEntityChangeVisibility         += ChangeEntityVisibilityStatus;
            hudController.OnEntityRename                   += SetEntityName;
            hudController.OnEntitySmartItemComponentUpdate += UpdateSmartItemComponentInKernel;
        }


        BIWInputWrapper.OnMouseDown += OnInputMouseDown;
        BIWInputWrapper.OnMouseUp   += OnInputMouseUp;

        DCL.Environment.i.world.sceneBoundsChecker.OnEntityBoundsCheckerStatusChanged += ChangeEntityBoundsCheckerStatus;

        bridge = context.sceneReferences.builderInWorldBridge;

        outlinerController = context.outlinerController;

        modeController    = context.modeController;
        actionController  = context.actionController;
        creatorController = context.creatorController;
        raycastController = context.raycastController;

        editMaterial = context.projectReferencesAsset.editMaterial;

        hideSelectedEntitiesAction = context.inputsReferencesAsset.hideSelectedEntitiesAction;
        showAllEntitiesAction      = context.inputsReferencesAsset.showAllEntitiesAction;

        hideSelectedEntitiesDelegate = (action) => ChangeShowStateSelectedEntities();
        showAllEntitiesDelegate      = (action) => ShowAllEntities();

        hideSelectedEntitiesAction.OnTriggered += hideSelectedEntitiesDelegate;
        showAllEntitiesAction.OnTriggered      += showAllEntitiesDelegate;

        actionController.OnRedo += ReSelectEntities;
        actionController.OnUndo += ReSelectEntities;
    }
Ejemplo n.º 10
0
        public void Initialize(IQuestsController newQuestsController)
        {
            questsController = newQuestsController;
            view = CreateView();
            SetViewActive(false);

            toggleQuestsPanel = Resources.Load<InputAction_Trigger>("ToggleQuestsPanelHud");
            toggleQuestsPanel.OnTriggered += OnToggleActionTriggered;

            questsController.OnQuestUpdated += OnQuestUpdated;
            quests.OnAdded += OnQuestAdded;
            quests.OnRemoved += OnQuestRemoved;
            quests.OnSet += OnQuestSet;

            DataStore.i.HUDs.questsPanelVisible.OnChange -= OnQuestPanelVisibleChanged;
            DataStore.i.HUDs.questsPanelVisible.OnChange += OnQuestPanelVisibleChanged;

            OnQuestSet(quests.Get());
        }
Ejemplo n.º 11
0
    public ExploreHUDController()
    {
        view      = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("ExploreHUD")).GetComponent <ExploreHUDView>();
        view.name = "_ExploreHUD";
        view.popup.gameObject.SetActive(false);

        toggleExploreTrigger              = Resources.Load <InputAction_Trigger>("ToggleExploreHud");
        toggleExploreTrigger.OnTriggered += OnToggleActionTriggered;

        view.OnCloseButtonPressed += () =>
        {
            if (view.IsVisible())
            {
                toggleExploreTrigger.RaiseOnTriggered();
            }
        };

        view.gotoMagicButton.OnGotoMagicPressed += GoToMagic;
        view.togglePopupButton.onPointerDown    += () => toggleExploreTrigger.RaiseOnTriggered();
        HotSceneCellView.OnJumpIn += OnJumpIn;
    }
    public PlayerInfoCardHUDController()
    {
        view = PlayerInfoCardHUDView.CreateView();
        view.Initialize(() => { OnCloseButtonPressed(); }
                        , ReportPlayer, BlockPlayer, UnblockPlayer,
                        AddPlayerAsFriend, CancelInvitation, AcceptFriendRequest, RejectFriendRequest);
        currentPlayerId           = Resources.Load <StringVariable>(CURRENT_PLAYER_ID);
        currentPlayerId.OnChange += OnCurrentPlayerIdChanged;
        OnCurrentPlayerIdChanged(currentPlayerId, null);

        toggleFriendsTrigger              = Resources.Load <InputAction_Trigger>("ToggleFriends");
        toggleFriendsTrigger.OnTriggered -= OnCloseButtonPressed;
        toggleFriendsTrigger.OnTriggered += OnCloseButtonPressed;

        closeWindowTrigger              = Resources.Load <InputAction_Trigger>("CloseWindow");
        closeWindowTrigger.OnTriggered -= OnCloseButtonPressed;
        closeWindowTrigger.OnTriggered += OnCloseButtonPressed;

        toggleWorldChatTrigger              = Resources.Load <InputAction_Trigger>("ToggleWorldChat");
        toggleWorldChatTrigger.OnTriggered -= OnCloseButtonPressed;
        toggleWorldChatTrigger.OnTriggered += OnCloseButtonPressed;
    }
    public override void Init(BIWContext context)
    {
        base.Init(context);

        cursorGO = context.sceneReferences.cursorCanvas;
        cameraParentGO = context.sceneReferences.cameraParent;
        InitGameObjects();

        firstPersonMode = new BiwFirstPersonMode();
        godMode = new BiwGodMode();

        firstPersonMode.Init(context);
        godMode.Init(context);

        firstPersonMode.OnInputDone += InputDone;
        godMode.OnInputDone += InputDone;

        if (HUDController.i.builderInWorldMainHud != null)
        {
            HUDController.i.builderInWorldMainHud.OnChangeModeAction += ChangeAdvanceMode;
            HUDController.i.builderInWorldMainHud.OnResetAction += ResetScaleAndRotation;
            HUDController.i.builderInWorldMainHud.OnChangeSnapModeAction += ChangeSnapMode;
        }

        actionController = context.actionController;
        entityHandler = context.entityHandler;
        toggleSnapModeInputAction = context.inputsReferencesAsset.toggleSnapModeInputAction;

        snapModeDelegate = (action) => ChangeSnapMode();
        toggleSnapModeInputAction.OnTriggered += snapModeDelegate;

        firstPersonMode.OnActionGenerated += actionController.AddAction;
        godMode.OnActionGenerated += actionController.AddAction;

        SetEditorGameObjects();
    }
Ejemplo n.º 14
0
    public override void Init(BIWContext biwContext)
    {
        base.Init(biwContext);

        actionController   = biwContext.actionController;
        modeController     = biwContext.modeController;
        inputWrapper       = biwContext.inputWrapper;
        outlinerController = biwContext.outlinerController;
        entityHandler      = biwContext.entityHandler;

        toggleRedoActionInputAction = biwContext.inputsReferencesAsset.toggleRedoActionInputAction;
        toggleUndoActionInputAction = biwContext.inputsReferencesAsset.toggleUndoActionInputAction;
        multiSelectionInputAction   = biwContext.inputsReferencesAsset.multiSelectionInputAction;

        if (HUDController.i.builderInWorldMainHud != null)
        {
            HUDController.i.builderInWorldMainHud.OnStopInput   += StopInput;
            HUDController.i.builderInWorldMainHud.OnResumeInput += ResumeInput;
        }

        redoDelegate = (action) => RedoAction();
        undoDelegate = (action) => UndoAction();

        toggleRedoActionInputAction.OnTriggered += redoDelegate;
        toggleUndoActionInputAction.OnTriggered += undoDelegate;

        multiSelectionStartDelegate    = (action) => StartMultiSelection();
        multiSelectionFinishedDelegate = (action) => EndMultiSelection();

        BIWInputWrapper.OnMouseClick     += MouseClick;
        BIWInputWrapper.OnMouseClickOnUI += MouseClickOnUI;
        modeController.OnInputDone       += InputDone;

        multiSelectionInputAction.OnStarted  += multiSelectionStartDelegate;
        multiSelectionInputAction.OnFinished += multiSelectionFinishedDelegate;
    }
Ejemplo n.º 15
0
 public void SetUp()
 {
     action = ScriptableObject.CreateInstance <InputAction_Trigger>();
 }