Пример #1
0
 public override void OnClose()
 {
     base.OnMinimize();
     if (DPSettings.config.focusGameWhenNotInteracting)
     {
         GamingManager.FocusActiveGame();
     }
 }
Пример #2
0
        public void Button_Close()
        {
            DPUIManager.Animate(keyboardDP, DPAnimation.FadeOut);

            if (DPSettings.config.focusGameWhenNotInteracting)
            {
                GamingManager.FocusActiveGame();
            }


            //ResetPrevious();
        }
Пример #3
0
        /// <summary>
        /// Used internally to toggle the visibility of the bar, it's children, and the DPApps
        /// </summary>
        /// <param name="visible"></param>
        private void ToggleVisible(bool visible)
        {
            isOpened = visible;


            if (!visible)
            {
                OverlayInteractionManager.I.EndCurrentDrag();

                TheBarManager.I.ToggleSnapPointsVisible(false);

                //Return focus to the active game if that's on
                if (DPSettings.config.focusGameWhenNotInteracting)
                {
                    GamingManager.FocusActiveGame();
                }


                DPUIManager.Animate(theBarDP, DPAnimation.FadeOut);
            }
            else
            {
                Vector3 goodRotBar = new Vector3(45, activatedRotation.eulerAngles.y, 0);
                theBarDP.SetOverlayTransform(GetPosFromOriginOffset(new Vector3(0, -0.45f, 0f)), goodRotBar);


                DPUIManager.Animate(theBarDP, DPAnimation.FadeInUp);
            }

            OverlayInteractionManager.I.TryEnableInteraction(visible, true);

            ToggleBlackout(visible);

            onBarOpened?.Invoke(visible);


            //Handle all the DPApps
            if (visible)
            {
                UpdateAnchoredAppsTransform();
            }

            ToggleApps(visible);
        }
Пример #4
0
 private void Awake()
 {
     Instance = this;
 }
Пример #5
0
        private void OnInteractedWith(bool interacting)
        {
            if (!loaded)
            {
                return;
            }

            //Debug.Log("Interaction state: " + interacting);

            isInteractingVirtually = interacting;

            if (interacting && isTargetingWindow)
            {
                if (isTargetingWindow && window.isIconic)
                {
                    WinNative.ShowWindow(window.handle, ShowWindowCommands.Restore);
                }

                WinNative.SetForegroundWindow(window.handle);

                if (primaryWindowDP != this)
                {
                    //Clear the previous
                    if (primaryWindowDP != null)
                    {
                        primaryWindowDP.isPrimary = false;

                        //if (primaryWindowDP.isTargetingWindow) {

                        //}

                        primaryWindowDP.RequestRendering();
                        //primaryWindowDP.UpdateOverlayUVs();
                    }

                    //StartCoroutine(C_Lock());

                    primaryWindowDP = this;
                    isPrimary       = true;

                    UDDManager.instance.gameObject.SetActive(false);
                    UDDManager.instance.gameObject.SetActive(true);

                    //UpdateOverlayUVs();
                }
            }

            //Update the title
            if (interacting)
            {
                if (!isTargetingWindow)
                {
                    dpAppParent.title = monitor.name;
                }
                else
                {
                    dpAppParent.title = window.title;
                }
            }

            //This only runs when the bar is closed and the config option is enabled
            if (DPSettings.config.focusGameWhenNotInteracting && !interacting)
            {
                GamingManager.FocusActiveGame();
            }
        }
Пример #6
0
 // Start is called before the first frame update
 void Awake()
 {
     DontDestroyOnLoad(this);
     _instance = this;
     initGame();
 }
Пример #7
0
 private void Awake()
 {
     I = this;
 }