Esempio n. 1
0
        protected void UpdateView(UWarGoodsStoreItem _nParam)
        {
            if (_nParam == null || _nParam.SchemeGoodsInfo == null)
            {
                return;
            }

            UWarGoodsStoreView.GetWarGoodsIcon(_nParam.SchemeGoodsInfo.GoodsIconID, GoodsIcon);
            GoodsCost.text = _nParam.GoodsCost.ToString();
            GoodsName.text = _nParam.SchemeGoodsInfo.GoodsName;

            string des = _nParam.SchemeGoodsInfo.GoodsDes;

            UBBProperty.GetInstance().getRatio(des);
            U3D_Render.Common.UBB.toHtml(ref des, UBB_FORMAT_TYPE.UGUI);
            GoodsDetailInfo.text = des;
            SetBuyBtnEnable(_nParam.GoodsCanBuy);

            if (DataCenter.LogicDataCenter.warMobaGoodsDataManager.EnableGoodsFilter)
            {
                if (_nParam.IsFiltered)
                {
                    BuyBtn.gameObject.SetActive(false);
                }
                else
                {
                    BuyBtn.gameObject.SetActive(true);
                }
            }
            else
            {
                BuyBtn.gameObject.SetActive(true);
            }
        }
        private void setEquipTips(SSchemeMobaGoods goods)
        {
            UTooltipTrigger equipTipsTrigger = EquipImage.GetComponent <UTooltipTrigger>();

            if (equipTipsTrigger == null)
            {
                return;
            }

            int    nEquipID  = goods.GoodsID;
            string equipDesc = goods.GoodsDes;

            if (nEquipID <= 0)
            {
                equipTipsTrigger.enabled = false;
                return;
            }

            equipTipsTrigger.enabled = true;

            string sGoodsDes = equipDesc;

            UBBProperty.GetInstance().getRatio(sGoodsDes);
            UBB.toHtml(ref sGoodsDes, UBB_FORMAT_TYPE.UGUI);
            equipTipsTrigger.SetText(UTooltipParamName.ItemDesc, sGoodsDes);

            string sGoodsName = goods.GoodsName;

            UBB.toHtml(ref sGoodsName, UBB_FORMAT_TYPE.UGUI);
            equipTipsTrigger.SetText(UTooltipParamName.ItemName, sGoodsName);
            equipTipsTrigger.SetText(UTooltipParamName.ItemCost, goods.GoodsCost.ToString());
        }
Esempio n. 3
0
        public void SetSkillShortcutKey(string keyCode)
        {
            if (string.IsNullOrEmpty(keyCode))
            {
                return;
            }

            if (KeyText == null)
            {
                return;
            }

            KeyText.text = keyCode;

            UTooltipTrigger skillTip = gameObject.GetComponent <UTooltipTrigger>();

            if (skillTip == null)
            {
                skillTip = gameObject.AddComponent <UTooltipTrigger>(ETooltipStyle.ETS_Default);
                skillTip.backgroundTint = Color.grey;
            }

            string sDesc = skillTip.parameterizedTextFields[0].value;

            if (string.IsNullOrEmpty(sDesc))
            {
                return;
            }

            UBBProperty.GetInstance().getRatio(sDesc);
            UBB.toHtml(ref sDesc, UBB_FORMAT_TYPE.UGUI);
            skillTip.SetText(UTooltipParamName.BodyText, sDesc);
        }
Esempio n. 4
0
        protected virtual void NonAlwaysChangeData(UWarGoodsStoreItem item)
        {
            UWarGoodsStoreView.GetWarGoodsIcon(item.SchemeGoodsInfo != null ? item.SchemeGoodsInfo.GoodsIconID:0, GoodsIcon);



            if (IsTooltipInit() && item.SchemeGoodsInfo != null)
            {
                GoodsTooltips.SetImage(GoodsTooltip_IconParamName, UWarGoodsStoreView.GetWarGoodsIcon(item.SchemeGoodsInfo.GoodsIconID));
                GoodsTooltips.SetText(GoodsTooltip_NameParamName, item.SchemeGoodsInfo.GoodsName);
                string GoodsDes = item.SchemeGoodsInfo.GoodsDes;
                UBBProperty.GetInstance().getRatio(GoodsDes);
                U3D_Render.Common.UBB.toHtml(ref GoodsDes, UBB_FORMAT_TYPE.UGUI);
                GoodsTooltips.SetText(GoodsTooltip_InfoParamName, GoodsDes);

                string GoodsLocIns = item.SchemeGoodsInfo.GoodsLocationInstructions;
                U3D_Render.Common.UBB.toHtml(ref GoodsLocIns, UBB_FORMAT_TYPE.UGUI);
                GoodsTooltips.SetText(GoodsTooltip_LocInstructionsParamName, GoodsLocIns);
            }
            else
            {
                GoodsTooltips.SetImage(GoodsTooltip_IconParamName, null);
                GoodsTooltips.SetText(GoodsTooltip_NameParamName, "");
                GoodsTooltips.SetText(GoodsTooltip_InfoParamName, "");
                GoodsTooltips.SetText(GoodsTooltip_LocInstructionsParamName, "");
            }
        }
Esempio n. 5
0
        public void SetData(UNPCGoodsItem item)
        {
            GoodsIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_MobaGoods, WndID.WND_ID_NPC, UGoodsDispositionView.GoodsIconSize, item.schemeGoods.GoodsIconID);

            if (item.schemeGoods.GoodsCost > 0)
            {
                GoodsCost.text = string.Format("{0}\n{1}", item.schemeGoods.GoodsCost.ToString(), item.schemeGoods.GoodsName);
            }
            else
            {
                GoodsCost.text = string.Format("{0}", item.schemeGoods.GoodsName);
            }

            GoodsTooltips.SetImage(GoodsTooltip_IconParamName, UWarGoodsStoreView.GetWarGoodsIcon(item.schemeGoods.GoodsIconID));
            GoodsTooltips.SetText(GoodsTooltip_CostParamName, item.schemeGoods.GoodsCost.ToString());
            GoodsTooltips.SetText(GoodsTooltip_NameParamName, item.schemeGoods.GoodsName);
            string GoodsDes = item.schemeGoods.GoodsDes;

            UBBProperty.GetInstance().getRatio(GoodsDes);
            U3D_Render.Common.UBB.toHtml(ref GoodsDes, UBB_FORMAT_TYPE.UGUI);
            GoodsTooltips.SetText(GoodsTooltip_InfoParamName, GoodsDes);

            string GoodsLocIns = item.schemeGoods.GoodsLocationInstructions;

            U3D_Render.Common.UBB.toHtml(ref GoodsLocIns, UBB_FORMAT_TYPE.UGUI);
            if (string.IsNullOrEmpty(GoodsLocIns))
            {
                GoodsLocIns = " ";
            }
            GoodsTooltips.SetText(GoodsTooltip_LocInstructionsParamName, GoodsLocIns);
        }
Esempio n. 6
0
    /**
     *   英雄技能相关
     */
    public void SetSpellSlot(cmd_creature_set_slot _data)
    {
        //召唤师技能(5 - 6)目前还没有,不接受消息
        if (CheckSlotIndexRange(_data.nSlotIndex))
        {
            ReCalSlotIndex(ref _data.nSlotIndex);

            //主动技能(0-2)
            //天赋技能(3)
            //召唤师技能(AS中序号是4)(策划配置是13)
            //SetSkillSlotID(_data.nSlotIndex);
            //SetSkillSlotType(_data.nSlotIndex, );
            //SetSkillIcon(_data.nSlotIndex, _data.slotview.nIconID);
            //SetSkillTooltip(_data.nSlotIndex, _data);
            //SetSkillLevel(_data.nSlotIndex, );
            int  _nType       = Convert.ToInt32(_data.nSlotType);
            bool bUseSlotFlag = Convert.ToBoolean(_data.nOverlaySpell);


            SetSpellSlot2AS(_data.nSlotIndex, _nType, _data.slotview.nIconID, _data.slotview.szSlotDesc, _data.nSlotLevel, bUseSlotFlag);
            GetMyHeroCtrl().SetSkillIDThroughSlot(_data.nSlotIndex, _data.slotview.nId);

            UBBProperty ubbProperty = UBBProperty.GetInstance();
            ubbProperty.SetShortCutSlotSkillId(_data.nSlotIndex, _data.slotview.nId);
        }
    }
Esempio n. 7
0
 // 获得单实例
 public static UBBProperty GetInstance()
 {
     if (_instance == null)
     {
         _instance = new UBBProperty();
         _instance.PropertyUBB();
     }
     return(_instance);
 }
        public void OnPointerEnter(UnityEngine.EventSystems.PointerEventData eventData)
        {
            if (string.IsNullOrEmpty(m_sEquipDesc) || playerEquipTipsTrigger == null)
            {
                return;
            }

            string sGoodsDes = m_sEquipDesc;

            UBBProperty.GetInstance().getRatio(sGoodsDes);
            UBB.toHtml(ref sGoodsDes, UBB_FORMAT_TYPE.UGUI);
            playerEquipTipsTrigger.SetText(UTooltipParamName.ItemDesc, sGoodsDes);
        }
        public void OnPointerEnter(UnityEngine.EventSystems.PointerEventData eventData)
        {
            if (string.IsNullOrEmpty(m_sTalentDesc) || tipsTrigger == null)
            {
                return;
            }

            string sTalentDesc = m_sTalentDesc;

            UBBProperty.GetInstance().getRatio(sTalentDesc);
            U3D_Render.Common.UBB.toHtml(ref sTalentDesc, UBB_FORMAT_TYPE.UGUI);
            tipsTrigger.SetText("TalentDesc", sTalentDesc);

            string sTalentName = m_sTalentName;

            U3D_Render.Common.UBB.toHtml(ref sTalentName, UBB_FORMAT_TYPE.UGUI);
            tipsTrigger.SetText("TalentName", sTalentName);
        }
Esempio n. 10
0
    //提供一个客户端自己更改槽位键值的方法
    public void SetSlotShortcutString(int nType, int nSlotId, string keyCode)
    {
        if (nType == (int)SLOT_TYPE.SLOT_TYPE_GOODS)
        {
            SetGoodsSlotShortcutKey(nSlotId, keyCode);
        }
        else if (nType == (int)SLOT_TYPE.SLOT_TYPE_SKILL)
        {
            if (CheckSlotIndexRange(nSlotId))//(((nSlotId >= 0) && (nSlotId <= 4)) || ((nSlotId >= 13) && (nSlotId <= 14)))
            {
                ReCalSlotIndex(ref nSlotId);
                SetSkillShortcutKey(nSlotId, keyCode);

                UBBProperty ubbProperty = UBBProperty.GetInstance();
                ubbProperty.SetShortCutSlotDesc(nSlotId, keyCode);
            }
        }
    }
Esempio n. 11
0
        public void UpdateSpellSlotDescInPropertyChange()
        {
            if (string.IsNullOrEmpty(m_sOriginalDesc))
            {
                return;
            }

            if (SkilltipTrigger == null)
            {
                return;
            }

            SkilltipTrigger.enabled = true;
            string strSlotTipsDesc = m_sOriginalDesc;

            UBBProperty.GetInstance().getRatio(m_sOriginalDesc);
            UBB.toHtml(ref strSlotTipsDesc, UBB_FORMAT_TYPE.UGUI);
            SkilltipTrigger.SetText(UTooltipParamName.BodyText, strSlotTipsDesc);

            if (m_listActiveTalent == null || m_listActiveTalent.Count <= 0)
            {
                return;
            }

            int nTalentIndex = 0;

            foreach (ActiveTalentDescItemInfo itemInfo in m_listActiveTalent)
            {
                string sTalentName = itemInfo.sTalentName;
                UBBProperty.GetInstance().getRatio(sTalentName);
                UBB.toHtml(ref sTalentName, UBB_FORMAT_TYPE.UGUI);

                string sTalentDesc = itemInfo.sTalentDesc;
                UBBProperty.GetInstance().getRatio(sTalentDesc);
                UBB.toHtml(ref sTalentDesc, UBB_FORMAT_TYPE.UGUI);

                nTalentIndex = itemInfo.nTalentIndex;
                //   SkilltipTrigger.SetText(SkillTooltip_TalentParamName + nTalentIndex, sTalentName);
                SkilltipTrigger.SetText(SkillTooltip_SkillParamDesc + nTalentIndex, "[" + sTalentName + "]" + sTalentDesc);
            }

            SkilltipTrigger.TurnSectionOn(SkillTooltip_SkillParamItem + nTalentIndex);
        }
Esempio n. 12
0
        public void OnPointerEnter(UnityEngine.EventSystems.PointerEventData eventData)
        {
            if (summerTipsTrigger == null)
            {
                return;
            }

            if (string.IsNullOrEmpty(m_sSummerDesc))
            {
                //summerTipsTrigger.SetText(UTooltipParamName.BodyText, "The SummerSkill Is Can't Find");
                return;
            }

            string sSummerDesc = m_sSummerDesc;

            UBBProperty.GetInstance().getRatio(sSummerDesc);
            UBB.toHtml(ref sSummerDesc, UBB_FORMAT_TYPE.UGUI);

            summerTipsTrigger.SetText(UTooltipParamName.BodyText, sSummerDesc);
        }
Esempio n. 13
0
        protected virtual void NonAlwaysChangeData(SSchemeMobaGoods item)
        {
            UGoodsDispositionView.GetGoodsIcon(item != null ? item.GoodsIconID : 0, GoodsIcon);



            if (IsTooltipInit() && item != null)
            {
                GoodsTooltips.SetImage(GoodsTooltip_IconParamName, UGoodsDispositionView.GetGoodsIcon(item.GoodsIconID));
                GoodsTooltips.SetText(GoodsTooltip_NameParamName, item.GoodsName);
                string GoodsDes = item.GoodsDes;
                UBBProperty.GetInstance().getRatio(GoodsDes);
                U3D_Render.Common.UBB.toHtml(ref GoodsDes, UBB_FORMAT_TYPE.UGUI);
                GoodsTooltips.SetText(GoodsTooltip_InfoParamName, GoodsDes);
            }
            else
            {
                GoodsTooltips.SetImage(GoodsTooltip_IconParamName, null);
                GoodsTooltips.SetText(GoodsTooltip_NameParamName, "");
                GoodsTooltips.SetText(GoodsTooltip_InfoParamName, "");
            }
        }
Esempio n. 14
0
        public virtual void SetData(int _newMobaGoodsID)
        {
            if (_newMobaGoodsID == m_nMobaGoodsID)
            {
                return;
            }

            m_nMobaGoodsID    = _newMobaGoodsID;
            GoodsImage.sprite = UGoodsDispositionView.GetGoodsIconByGoodsID(m_nMobaGoodsID);

            if (ShowTooltip)
            {
                if (GoodsTooltips == null)
                {
                    GoodsTooltips = gameObject.AddComponent <UTooltipTrigger>(ETooltipStyle.ETS_WarGoods);
                }

                SSchemeMobaGoods goodsSScheme;
                GoodsSchemesDataManager.Instance.GetMobaGoods_Out(_newMobaGoodsID, out goodsSScheme);
                if (goodsSScheme != null && _newMobaGoodsID != 0 && GoodsTooltips != null)
                {
                    GoodsTooltips.enabled = true;
                    GoodsTooltips.SetImage(GoodsTooltip_IconParamName, UGoodsDispositionView.GetGoodsIcon(goodsSScheme.GoodsIconID));
                    GoodsTooltips.SetText(GoodsTooltip_NameParamName, goodsSScheme.GoodsName);
                    string GoodsDes = goodsSScheme.GoodsDes;
                    UBBProperty.GetInstance().getRatio(GoodsDes);
                    U3D_Render.Common.UBB.toHtml(ref GoodsDes, UBB_FORMAT_TYPE.UGUI);
                    GoodsTooltips.SetText(GoodsTooltip_InfoParamName, GoodsDes);
                    GoodsTooltips.SetText(GoodsTooltip_CostParamName, goodsSScheme.GoodsCost.ToString());
                }
                else
                {
                    GoodsTooltips.enabled = false;
                }
            }
        }
Esempio n. 15
0
        public virtual void SetData(UListHeroTalentData item)
        {
            TalentIconImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_Skill, WndID.WND_ID_GAMEWAITINGROOMVIEW, 1, item.nTalentIconId);
            TalentIconImage.ResetToDefaultMaterial();
            TalentNameText.ResetToDefaultMaterial();
            TalentDescText.ResetToDefaultMaterial();
            TalentKeyText.ResetToDefaultMaterial();
            if (TalentIconImage.sprite == null) // 空的话给个默认的
            {
                TalentIconImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_HeadPortrait, WndID.WND_ID_GAMEWAITINGROOMVIEW, 1, 3, 4);
            }

            string sTalentDesc = item.sTalentDesc;
            string sTalentName = item.sTalentName;

            UBBProperty.GetInstance().getRatio(sTalentDesc);
            U3D_Render.Common.UBB.toHtml(ref sTalentDesc, UBB_FORMAT_TYPE.UGUI);
            // 此处需要再转换一下,不然PASD标签不能正确解析
            U3D_Render.Common.UBB.toHtml(ref sTalentDesc, UBB_FORMAT_TYPE.UGUI);

            U3D_Render.Common.UBB.toHtml(ref sTalentName, UBB_FORMAT_TYPE.UGUI);

            TalentDescText.text = sTalentDesc;
            UseTypeText.text    = item.sUseTypeDesc;
            TalentNameText.text = sTalentName;
            TalentKeyText.text  = "Ctrl+" + item.nSortIndex;
            Item = item;

            bActive = LogicDataCenter.heroTalentDataManager.isActivedThisTalent(item.nTalentId);
            ActiveObject.SetActive(bActive);

            if (NoActiveLockObject != null)
            {
                NoActiveLockObject.SetActive(item.bLock);
            }

            // 前置天赋未激活
            bTermActive = LogicDataCenter.heroTalentDataManager.isActivedThisTalent(item.nTalentTermId);
            ActiveObject.SetActive(bActive);

            if (item.nTalentTermId > 0 && !bTermActive)
            {
                TalentDescText.text = sTalentDesc + "(前置天赋未激活)";
                TalentIconImage.AddNewMaterial(EUIShaderType.EST_Gray);
                TalentNameText.AddNewMaterial(EUIShaderType.EST_Gray);
                TalentDescText.AddNewMaterial(EUIShaderType.EST_Gray);
                TalentKeyText.AddNewMaterial(EUIShaderType.EST_Gray);
            }

            bCanActive = LogicDataCenter.heroTalentDataManager.isCanActiveTalent(item.nTalentId, item.nTalentLevel);

            // 推荐图标
            if (RecommandImage != null)
            {
                if (Item.bRecommand)
                {
                    RecommandImage.gameObject.SetActive(true);
                }
                else
                {
                    RecommandImage.gameObject.SetActive(false);
                }
            }

            #region 新手引导部分
            if (item.bUseGuideWidget)
            //{
            //    gameObject.RemoveComponent<UGuideWidget>();
            //}
            //else
            {
                UGuideWidget guideWidget = gameObject.GetComponent <UGuideWidget>();
                if (guideWidget == null)
                {
                    guideWidget = this.gameObject.AddComponent <UGuideWidget>();
                }
                guideWidget.GuideID       = (GUIDE.EGuideNodeID)item.nGuideID;
                guideWidget.GuideStepID   = item.nGuideStepID;
                guideWidget.GuideEffectID = item.nGuideEffectID;
                guideWidget.IsForceGuide  = true;
            }
            #endregion
        }