Example #1
0
 // Token: 0x06002C60 RID: 11360 RVA: 0x00489434 File Offset: 0x00487634
 public void ForceCloseHint()
 {
     this.BtnAction  = UIButtonHint._BntAction.BtnNone;
     this.bFadeOut   = false;
     this.bCountDown = false;
     if (this.m_eHint == EUIButtonHint.UIHIBtn)
     {
         GUIManager.Instance.m_SimpleItemInfo.Hide(this);
     }
     if (this.m_DownUpHandler != null)
     {
         this.m_DownUpHandler.OnButtonUp(this);
     }
     UIButtonHint.DelayFadeOutHint = null;
     GUIManager.Instance.HintMaskObj.HideBtn.m_Handler = null;
 }
Example #2
0
    // Token: 0x06002C5A RID: 11354 RVA: 0x00488FD0 File Offset: 0x004871D0
    public void OnCloseHint()
    {
        GUIManager.Instance.HintMaskObj.HideBtn.m_Handler = null;
        if (this.FadeOutCanvas)
        {
            this.bFadeOut = true;
            this.FadeTime = 0f;
        }
        switch (this.m_eHint)
        {
        case EUIButtonHint.UIHIBtn:
        {
            UIHIBtn uihibtn = this.m_Button as UIHIBtn;
            if (!(uihibtn == null))
            {
                eHeroOrItem heroOrItem = (eHeroOrItem)uihibtn.HeroOrItem;
                if (heroOrItem == eHeroOrItem.Hero || heroOrItem == eHeroOrItem.Item)
                {
                    this.BtnAction = UIButtonHint._BntAction.BtnUp;
                }
            }
            break;
        }

        case EUIButtonHint.DownUpHandler:
        case EUIButtonHint.UILeBtn:
        case EUIButtonHint.UIArena_Hint:
            this.BtnAction = UIButtonHint._BntAction.BtnUp;
            break;

        case EUIButtonHint.Slider:
            if (this.m_DownUpHandler != null)
            {
                this.m_DownUpHandler.OnButtonUp(this);
            }
            break;

        case EUIButtonHint.CountDown:
            this.m_Time     = 0f;
            this.bCountDown = false;
            this.BtnAction  = UIButtonHint._BntAction.BtnUp;
            break;
        }
    }
Example #3
0
 // Token: 0x06002C62 RID: 11362 RVA: 0x00489524 File Offset: 0x00487724
 private void Update()
 {
     if (!base.enabled)
     {
         return;
     }
     if (this.BtnAction == UIButtonHint._BntAction.BtnNone)
     {
         return;
     }
     if (this.GetCScrollRect() != null && this.GetCScrollRect().Get_Dragging())
     {
         if (this.GetCScrollRect().content != null)
         {
             if (Math.Abs(this.PressPosition.y - this.GetCScrollRect().content.anchoredPosition.y) > 20f)
             {
                 this.IsValidClick = 0;
                 this.ForceCloseHint();
             }
         }
         else if (Math.Abs(this.PressPosition.y - base.transform.position.y) > 20f)
         {
             this.IsValidClick = 0;
             this.ForceCloseHint();
         }
     }
     if (this.GetScrollRect() != null && Math.Abs(this.PressPosition.y - base.transform.position.y) > 20f)
     {
         this.IsValidClick = 0;
         this.ForceCloseHint();
     }
     if (this.BtnAction == UIButtonHint._BntAction.BtnUp)
     {
         if (!this.FadeOutCanvas)
         {
             if (this.m_DownUpHandler != null)
             {
                 this.m_DownUpHandler.OnButtonUp(this);
             }
             this.BtnAction = UIButtonHint._BntAction.BtnNone;
             UIButtonHint.DelayFadeOutHint = null;
         }
         if (this.bFadeOut)
         {
             if (this.FadeTime < this.MaxFadeTime)
             {
                 this.FadeOutCanvas.alpha = Mathf.Clamp(1f - this.FadeTime / this.MaxFadeTime, 0f, 1f);
                 this.FadeTime           += Time.unscaledDeltaTime;
             }
             else
             {
                 this.bFadeOut = false;
                 if (this.m_DownUpHandler != null)
                 {
                     this.m_DownUpHandler.OnButtonUp(this);
                 }
                 this.FadeOutCanvas.alpha      = 1f;
                 UIButtonHint.DelayFadeOutHint = null;
                 this.BtnAction = UIButtonHint._BntAction.BtnNone;
                 GUIManager.Instance.m_SimpleItemInfo.Hide(this);
                 GUIManager.Instance.m_LordInfo.Hide(this);
                 GUIManager.Instance.HintMaskObj.Hide(this);
             }
         }
     }
     if (this.m_eHint == EUIButtonHint.CountDown && this.bCountDown)
     {
         this.m_Time += Time.unscaledDeltaTime;
         if (this.m_Time >= this.DelayTime)
         {
             if (this.m_DownUpHandler != null)
             {
                 this.m_DownUpHandler.OnButtonDown(this);
                 GUIManager.Instance.HintMaskObj.Show(this);
                 GUIManager.Instance.HintMaskObj.HideBtn.m_Handler = this;
             }
             this.bCountDown = false;
             this.m_Time     = 0f;
         }
     }
 }
Example #4
0
    // Token: 0x06002C56 RID: 11350 RVA: 0x00488CB4 File Offset: 0x00486EB4
    public void OnPointerDown(PointerEventData eventData)
    {
        if (!base.enabled || !base.gameObject.activeInHierarchy || (this.m_Button != null && !this.m_Button.IsInteractable()))
        {
            return;
        }
        if (this.m_eHint == EUIButtonHint.UIHIBtn || this.m_eHint == EUIButtonHint.UILeBtn)
        {
            this.SetFadeOutObject(this.m_eHint);
        }
        if (UIButtonHint.DelayFadeOutHint)
        {
            UIButtonHint.DelayFadeOutHint.ForceCloseHint();
        }
        if (GUIManager.Instance.HintMaskObj.HideBtn.m_Handler != null)
        {
            GUIManager.Instance.HintMaskObj.HideBtn.m_Handler.OnButtonClick(null);
        }
        if (this.GetCScrollRect() != null && this.GetCScrollRect().content != null)
        {
            this.PressPosition = this.GetCScrollRect().content.anchoredPosition;
        }
        else
        {
            this.PressPosition = base.transform.position;
        }
        this.BtnAction = UIButtonHint._BntAction.BtnDown;
        UIButtonHint.DelayFadeOutHint = this;
        GUIManager.Instance.HintMaskObj.Hide(this);
        this.IsValidClick = 1;
        if (this.FadeOutCanvas)
        {
            this.bFadeOut            = false;
            this.FadeOutCanvas.alpha = 1f;
        }
        switch (this.m_eHint)
        {
        case EUIButtonHint.UIHIBtn:
        {
            UIHIBtn uihibtn = this.m_Button as UIHIBtn;
            if (!(uihibtn == null))
            {
                eHeroOrItem heroOrItem = (eHeroOrItem)uihibtn.HeroOrItem;
                if (heroOrItem != eHeroOrItem.Hero)
                {
                    if (heroOrItem == eHeroOrItem.Item)
                    {
                        GUIManager.Instance.m_SimpleItemInfo.Show(this, uihibtn.HIID, -1, UIButtonHint.ePosition.Original, null);
                    }
                }
                else
                {
                    GUIManager.Instance.m_SimpleItemInfo.ShowHero(this, uihibtn.HIID, (ushort)uihibtn.m_BtnID1, (ushort)uihibtn.m_BtnID2);
                }
            }
            break;
        }

        case EUIButtonHint.DownUpHandler:
        case EUIButtonHint.Slider:
            if (this.m_DownUpHandler != null)
            {
                this.m_DownUpHandler.OnButtonDown(this);
            }
            break;

        case EUIButtonHint.CountDown:
            this.m_Time     = 0f;
            this.bCountDown = true;
            break;

        case EUIButtonHint.UILeBtn:
            if (this.m_DownUpHandler != null)
            {
                this.m_DownUpHandler.OnButtonDown(this);
            }
            break;

        case EUIButtonHint.UIArena_Hint:
            if (this.m_DownUpHandler != null)
            {
                this.m_DownUpHandler.OnButtonDown(this);
            }
            break;
        }
        if (this.GetCScrollRect() != null)
        {
            this.GetCScrollRect().OnBeginDrag(eventData);
        }
        if (this.GetScrollRect() != null)
        {
            this.GetScrollRect().OnBeginDrag(eventData);
        }
    }