Exemple #1
0
        void ResSrcTooltipObjectDisplay(Vector3 pos, ePressTipAnchorType anchor)
        {
            if (!string.IsNullOrEmpty(m_tooltipSystem))
            {
                string tooltipContext = "default";

                DataLookupsCache.Instance.SearchDataByID <string>("tooltip.context", out tooltipContext);

                TooltipLibraryEntry targetEntry = tooltipLibrary.Find(x =>
                                                                      x.systemName == m_tooltipSystem &&
                                                                      x.contextName == tooltipContext
                                                                      );

                if (null != targetEntry.tooltipObject && null == m_currentTooltipObject)
                {
                    MessageDialog.HideCurrent();
                    m_currentTooltipObject = m_tooltipDataPanelDic[targetEntry.tooltipObject.name];
                    m_currentTooltipObject.GetComponent <UITooltipPressPos>().SetPosAndAnchor(pos, anchor);
                    m_currentTooltipObject.CustomSetActive(true);
                    if (m_currentTooltipObject.GetComponent <UIController>())
                    {
                        m_currentTooltipObject.GetComponent <UIController>().Open();
                    }
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// 显示技能描述弹框
 /// </summary>
 public void DisplaySkillTip(string dataID, Vector3 pos, ePressTipAnchorType anchor)
 {
     if (string.IsNullOrEmpty(dataID) || m_currentTooltipObject != null)
     {
         return;
     }
     DisplayTooltipForPress(dataID, "Skill", "default", pos, anchor, false, false, false, delegate() { });
 }
Exemple #3
0
        public void OnResourceClick()
        {
            if (m_ResID != "alliance-gold" &&
                m_ResID != "arena-gold" &&
                m_ResID != "expedition-gold" &&
                m_ResID != "train" &&
                m_ResID != "ladder-gold")
            {
                return;
            }

            InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f);
            Vector3             pos    = m_Anchor.position;
            ePressTipAnchorType anchor = ePressTipAnchorType.LeftDown;

            UITooltipManager.Instance.DisplayResSrcTooltip(m_ResID, "Res", "default", pos, anchor);
        }
Exemple #4
0
        //获取这个物体的边界 根据pos 和anchor 设置
        public void SetPosAndAnchor(Vector3 pos, ePressTipAnchorType anchor)
        {
            if (anchor == ePressTipAnchorType.RightUp)
            {
                m_Container.pivot = UIWidget.Pivot.TopRight;
            }
            else if (anchor == ePressTipAnchorType.RightDown)
            {
                m_Container.pivot = UIWidget.Pivot.BottomRight;
            }
            else if (anchor == ePressTipAnchorType.LeftUp)
            {
                m_Container.pivot = UIWidget.Pivot.TopLeft;
            }
            else
            {
                m_Container.pivot = UIWidget.Pivot.BottomLeft;
            }

            m_Container.gameObject.transform.position = pos;
        }
Exemple #5
0
        void TooltipObjectDisplayPress(Vector3 pos, ePressTipAnchorType anchor, bool isSkillPanel = false, bool isCanUse = false, bool isHaveUse = false, System.Action useCallback = null)
        {
            if (!string.IsNullOrEmpty(m_tooltipSystem))
            {
                string tooltipContext = "default";

                DataLookupsCache.Instance.SearchDataByID <string>("tooltip.context", out tooltipContext);

                TooltipLibraryEntry targetEntry = tooltipLibrary.Find(x =>
                                                                      x.systemName == m_tooltipSystem &&
                                                                      x.contextName == tooltipContext
                                                                      );

                if (null != targetEntry.tooltipObject && null == m_currentTooltipObject)
                {
                    MessageDialog.HideCurrent();
                    m_currentTooltipObject = m_tooltipDataPanelDic[targetEntry.tooltipObject.name];

                    //if (m_currentTooltipObject.GetComponent<UISkillDescContorller>())
                    //{
                    //    m_currentTooltipObject.GetComponent<UISkillDescContorller>().SetData(pos);
                    //}
                    var ilr = m_currentTooltipObject.GetComponent <DynamicMonoILR>();
                    if (ilr != null && ilr.hotfixClassPath.Equals("Hotfix_LT.UI.UISkillDescContorller"))
                    {
                        ilr.FloatParamList = new List <float>()
                        {
                            pos.x, pos.y, pos.z
                        };
                    }

                    m_currentTooltipObject.CustomSetActive(true);
                    if (m_currentTooltipObject.GetComponent <UIController>())
                    {
                        m_currentTooltipObject.GetComponent <UIController>().Open();
                    }
                }
            }
        }
Exemple #6
0
 /// <summary>
 /// 显示资源来源框
 /// </summary>
 /// <param name="dataID"></param>
 /// <param name="tooltipSystem"></param>
 /// <param name="context"></param>
 public void DisplayResSrcTooltip(string id, string tooltipSystem, string context, Vector3 pos, ePressTipAnchorType anchor)
 {
     if (string.IsNullOrEmpty(id) || m_currentTooltipObject != null)
     {
         return;
     }
     m_tooltipSystem = tooltipSystem;
     ClearTooltipCache();
     StoreData("context", context);
     StoreData("target", id);
     if (!string.IsNullOrEmpty(m_tooltipSystem))
     {
         ResSrcTooltipObjectDisplay(pos, anchor);
     }
     else
     {
         EB.Debug.LogWarning("Tooltip Target is NULL!!");
     }
 }
Exemple #7
0
        public void DisplayTooltipForPress(string dataID, string tooltipSystem, string context, Vector3 pos, ePressTipAnchorType anchor, bool isSkillPanel = false, bool isCanUse = false, bool isHaveUse = false, System.Action useCallback = null)
        {
            if (string.IsNullOrEmpty(dataID) || m_currentTooltipObject != null)
            {
                return;
            }
            m_tooltipSystem = tooltipSystem;
            ClearTooltipCache();
            StoreData("context", context);
            StoreData("target", dataID);

            if (!string.IsNullOrEmpty(m_tooltipSystem))
            {
                TooltipObjectDisplayPress(pos, anchor, isSkillPanel, isCanUse, isHaveUse, useCallback);
            }
            else
            {
                EB.Debug.LogWarning("Tooltip Target is NULL!!");
            }
        }