示例#1
0
    /// <summary>
    /// Closes the UI. From a high level, releases all appropriate locks on the UI.
    /// </summary>
    public void CloseUI()
    {
        // you can't close a UI if there is UI tweening going on
        if (!isIgnoreTweenLockOnClose && ClickManager.Instance.IsTweeningUI())
        {
            Debug.LogWarning("Something is tweening, cannot close " + name);
            return;
        }

        if (isLockModeInClickmanager)
        {
            // a ui is closing, so release our locks
            ClickManager.Instance.ReleaseLock();
        }

        if (blockGUI)
        {
            Debug.LogWarning("ACTIVE MODE LOCK BYPASS");
            //ClickManager.SetActiveGUIModeLock(false);
        }

        // fire callback
        UIManagerEventArgs args = new UIManagerEventArgs();

        args.Opening = false;
        if (OnManagerOpen != null)
        {
            OnManagerOpen(this, args);
        }

        // the ui is no longer open
        isOpen = false;

        _CloseUI();
    }
示例#2
0
    /// <summary>
    /// When a button wants to open a given UI, this is what should be called.
    /// From a high level, the UIManager locks clicks/modes, the child class implements its own _OpenUI logic
    /// </summary>
    public void OpenUI()
    {
        if (isLockModeInClickmanager)
        {
            // a ui is opening, so we need to lock things down
            List <ClickLockExceptions> listExceptions = GetClickLockExceptions();
            ClickManager.Instance.Lock(eModeType, listExceptions);
        }

        if (blockGUI)
        {
            Debug.LogWarning("ACTIVE MODE LOCK BYPASS");
            //ClickManager.SetActiveGUIModeLock(true);
        }

        // fire callback
        UIManagerEventArgs args = new UIManagerEventArgs();

        args.Opening = true;
        if (OnManagerOpen != null)
        {
            OnManagerOpen(this, args);
        }

        // the UI is now open
        isOpen = true;

        _OpenUI();
    }
 private void EnableEntrance(object sender, UIManagerEventArgs args)
 {
     if (args.Opening == false)
     {
         CheckToActivateEntrance();
     }
 }
示例#4
0
 //---------------------------------------------------
 // OnTweenDone()
 // Callback for when the wellapad UI is done tweening.
 //---------------------------------------------------
 private void OnTweenDone(object sender, UIManagerEventArgs args)
 {
     // if the UI is opening, update our task
     if (args.Opening)
     {
         SetCheckboxSprite(true);
     }
 }
示例#5
0
    /// <summary>
    /// Raises the show event. Tween callback for when this UI finishes its
    /// show tween.
    /// </summary>
    private void OnShow()
    {
        // send callback
        UIManagerEventArgs args = new UIManagerEventArgs();

        args.Opening = true;
        if (OnTweenDone != null)
        {
            OnTweenDone(this, args);
        }
    }
示例#6
0
    /// <summary>
    /// Raises the wellapad closed event.
    /// </summary>
    /// <param name="sender">Sender.</param>
    /// <param name="args">Arguments.</param>
    private void OnWellapadClosed(object sender, UIManagerEventArgs args)
    {
        if (args.Opening == false)
        {
            // wellapad is closing, so stop listening
            WellapadUIManager.Instance.OnManagerOpen -= OnWellapadClosed;

            // advance to next step
            Advance();
        }
    }
示例#7
0
    // Event listener. listening to when decoration mode is enabled/disabled
    private void ShowDecoZones(object sender, UIManagerEventArgs args)
    {
        TweenToggle toggle = GetComponent <ScaleTweenToggle>();

        if (args.Opening)
        {
            toggle.Show();                  // edit mode is opening, so turn this node on
        }
        else
        {
            toggle.Hide();                  // edit mode is closing so turn this node off
        }
    }
示例#8
0
 private void ShouldPauseIdleAnimations(object sender, UIManagerEventArgs args)
 {
     // Check if the minipet is hatched first
     if (isHatchedAux)
     {
         if (args.Opening)
         {
             animationManager.IsRunningIdleAnimations = false;
         }
         else
         {
             animationManager.IsRunningIdleAnimations = true;
         }
     }
 }
示例#9
0
 /// <summary>
 /// Disable arrow hints for entrance when zoom into mini pet.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="args">Arguments.</param>
 private void OnManagerOpenEventHandler(object sender, UIManagerEventArgs args)
 {
     if (args.Opening)
     {
         arrowGameObject.SetActive(false);
     }
     else
     {
         bool isFirstTime = DataManager.Instance.GameData.FirstTimeEntrance.IsFirstTimeEntrance(entranceKey);
         if (isFirstTime)
         {
             ShowArrow();
         }
     }
 }