public void OnShowTipStrWnd(string strTitle, string strContent) { UBB.toHtml(ref strTitle); UBB.toHtml(ref strContent); TipTitle.text = strTitle; TipContent.text = strContent; }
/// <summary> /// 初始化英雄信息配置 /// </summary> /// <param name="strDefaultViewConfigPath"></param> private void InitAboutDetailedPropertyInfo(string strDefaultViewConfigPath) { string strDetailedPropertyInfoPath = strDefaultViewConfigPath + MobaSchemesConfig.DETAILED_PROPERTY_INFO; ScpReader DetailedPropertyInfoReader = new ScpReader(strDetailedPropertyInfoPath, true, 2); DetailedPropertyInfoTable = new Hashtable(); int PropertyID = 0; for (int i = 0; i < DetailedPropertyInfoReader.GetRecordCount(); i++) { MobaDetatiledPropertyInfo PropertyInfo = new MobaDetatiledPropertyInfo(); PropertyID = DetailedPropertyInfoReader.GetInt(i, (int)EMobaDetailedPropertyInfo.EMDPIR_PropertyID, -1); if (PropertyID == -1) { continue; } PropertyInfo.PropertyName = DetailedPropertyInfoReader.GetString(i, (int)EMobaDetailedPropertyInfo.EMDPIR_PropertyName, ""); PropertyInfo.PropertyDes = DetailedPropertyInfoReader.GetString(i, (int)EMobaDetailedPropertyInfo.EMDPIR_PropertyDes, ""); UBB.toHtml(ref PropertyInfo.PropertyDes); DetailedPropertyInfoTable.Add(PropertyID, PropertyInfo); } }
public void OnGenicImageClick(int index) { int nHeroID = arrayCollectGenic[index].nHeroID; if (nHeroID <= 0) { return; } SSchemePersonModelData heroData = new SSchemePersonModelData(); if (PersonModelConfig.Instance.GetData_Out(nHeroID, out heroData) == false) { return; } string content = string.Format("是否进化为{0}英雄,进化后无法逆转", heroData.szHeroName); UBB.toHtml(ref content); TooltipAndDialog.UIDialogData data = new TooltipAndDialog.UIDialogData( title: "进化", message: content, buttons: new UIWidgets.DialogActions() { { "进化", () => OnEnvolveHero(index) }, { ULocalizationService.Instance.Get("UIView", "Common", "CancelBtn"), null } }, modal: true, mutex: true ); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_DIALOG, data); }
public void OpenRecordShareFrame() { string desc = String.Format(ULocalizationService.Instance.Get("UIView", "LifeHeroCulture", "ShareDesc"), EntityFactory.MainHeroView.Property.CreatureName); UBB.toHtml(ref desc); ShareDesc.text = desc; shareConfirmBtnText.text = ULocalizationService.Instance.Get("UIView", "LifeHeroCulture", "NewChallenge"); string imgFullPath = CaptureScreen.GetInstance().CaptureTempDir + "/" + shareImgName; if (File.Exists(imgFullPath)) { byte[] imgData = ImageExtensions.GetAllByteData(imgFullPath); if (null != ShareRawImg) { if (null == ShareRawImg.texture) { if (shareTex2D != null) { shareTex2D.LoadImage(imgData); } ShareRawImg.texture = shareTex2D; } ShareRawImg.gameObject.SetActive(true); } ShareBar.SetData(SocialSharingType.LifeHero, imgData); } RecordShareFrame.gameObject.SetActive(true); }
public void SetXPSkillInfo(int nSpellID) { if (nSpellID <= 0) { Debug.LogWarning("XPSKill," + nSpellID); return; } IntPtr Ptr = GameLogicAPI.getSpellData(nSpellID); if (Ptr == IntPtr.Zero) { Debug.LogWarning("XPSKill,Ptr == IntPtr.Zero," + nSpellID); return; } SPELL.SPELL_DATA spellData = IntPtrHelper.toData <SPELL.SPELL_DATA>(Ptr); IntPtr strPtr = GameLogicAPI.getSpellStrData(nSpellID, (int)SPELL_DATA_ID.SPDATA_DESC); String szDesc = IntPtrHelper.Ptr2Str(strPtr); Debug.Log("XPSKill," + spellData.nID + "," + szDesc + "," + nSpellID); UBB.toHtml(ref szDesc, UBB_FORMAT_TYPE.UGUI); slotTooltipTrigger.SetText(UTooltipParamName.BodyText, szDesc); slotTooltipTrigger.enabled = true; skillImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_Skill, WndID.WND_ID_WAR_XPSKILL, 1, spellData.nIcon); skillImage.gameObject.SetActive(true); xpSkillName = spellData.szName; }
public void StartTimer(int nTimerID, int nLeftTime, uint nCheckID, int nMatchType) { if (nMatchType == (int)EMMatchType.MatchType_NewPlayerGuide2) { GuideMatchTypeShow(); } else { NormalMatchShow(); } m_nMatchType = nMatchType; m_dwCheckID = nCheckID; m_lEndTicks = DateTime.Now.AddSeconds((double)nLeftTime).Ticks; m_bConfirm = false; string strDes = String.Format(ULocalizationService.Instance.Get("UIView", "AcceptWaitInfo", "LeftTimeDesc"), nLeftTime); UBB.toHtml(ref strDes); LeftSecDes.text = strDes; LeftSecDes.gameObject.SetActive(true); strDes = String.Format(ULocalizationService.Instance.Get("UIView", "AcceptWaitInfo", "WaitTimeDesc"), nLeftTime); UBB.toHtml(ref strDes); WaitOtherSec.text = strDes; WaitOtherSec.gameObject.SetActive(false); CloseBtn.gameObject.SetActive(nMatchType != (int)EMMatchType.MatchType_NewPlayerGuide2); TimerManager.SetTimer(this, nTimerID, 1.0f); SoundManager.CreateUISound(ACCEPT_WAIT_SHOW_SOUNDID); }
public void OnClanDismissBtnClick() { if ((EMClanState)LogicDataCenter.clanDataManager.ClanBaseData.nState == EMClanState.emClanState_Dismissing) { // 取消解散联盟 ViewEventHelper.Instance.SendCommand(GameLogicDef.GVIEWCMD_CLAN_CANCEL_DISMISS); } else { string dismissContent = ULocalizationService.Instance.Get("UIView", "ClanDetail", "DissmissContent_1"); if (LogicDataCenter.clanDataManager.ClanBaseData.nKinCount > 1) { int dismissingLife = ASpeedGame.Data.ClanConfig.ClanConfig.Instance.tClanConfig.nDismissingLife; string tips = ObtainDismissTimeTip(dismissingLife); dismissContent += String.Format(ULocalizationService.Instance.Get("UIView", "ClanDetail", "DissmissContent_2"), tips); } UBB.toHtml(ref dismissContent); TooltipAndDialog.UIDialogData data = new TooltipAndDialog.UIDialogData( title: ULocalizationService.Instance.Get("UIView", "ClanDetail", "DissmissTitle"), message: dismissContent, buttons: new UIWidgets.DialogActions() { { ULocalizationService.Instance.Get("UIView", "ClanDetail", "Confirm"), ClanDissmiss }, { ULocalizationService.Instance.Get("UIView", "ClanDetail", "Cancel"), null } } ); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_DIALOG, data); } }
public bool ParseWarTableGoodsTooltip(Value _tooltipElememts) { double _x, _y = 0; int _nGoodsCost; string _strGoodsName, _strGoodsDes; if (_tooltipElememts.GetElement(5) == null) { return(false); } _strGoodsName = (string)_tooltipElememts.GetElement(5); _nGoodsCost = (int)_tooltipElememts.GetElement(6); _strGoodsDes = (string)_tooltipElememts.GetElement(7); //解析UBB UBB.toHtml(ref _strGoodsDes); //传数据到AS if (!Value.IsValueValid(WarPurchasedGoodsTooltip)) { Trace.LogError("解析Tooltip类型时,发现WarPurchasedGoodsTooltip无实例对象"); return(false); } // public function SetText(_nGoodsCost:int,_strGoodsName:String,_strGoodsDes:String) if (WarPurchasedGoodsTooltip.Invoke("SetText", _nGoodsCost, _strGoodsName, _strGoodsDes) == null) { Trace.LogError("解析Tooltip类型时,执行WarSkillTooltip 的SetText操作失败"); return(false); } double tipsHeight = (double)WarPurchasedGoodsTooltip.GetMember("height"); double tipsWidth = (double)WarPurchasedGoodsTooltip.GetMember("width"); return(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()); }
public void setEquipInfo(cmd_war_persongoodsinfo cmdGoodsInfo, SSchemeMobaGoods schemeMobaGoods) { // 物品图标 int nEquipIcon = schemeMobaGoods.GoodsIconID; playerEquipTipsTrigger.enabled = nEquipIcon > 0; this.goodsImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_MobaGoods, WndID.WND_ID_WAR_RECORDTABLE_FIGHTING, 1, nEquipIcon); if (this.goodsImage.sprite == null && this.goodsImage.gameObject.activeSelf) { this.goodsImage.gameObject.SetActive(false); } else if (this.goodsImage.sprite && this.goodsImage.gameObject.activeSelf == false) { this.goodsImage.gameObject.SetActive(true); } // 物品数量 int nTimes = cmdGoodsInfo.nCanUseTimes; if (nTimes != 0) { goodsCount.gameObject.SetActive(true); } else { goodsCount.gameObject.SetActive(false); } this.goodsCount.text = nTimes.ToString(); m_sEquipDesc = schemeMobaGoods.GoodsDes; UBB.toHtml(ref schemeMobaGoods.GoodsName, UBB_FORMAT_TYPE.UGUI); playerEquipTipsTrigger.SetText(UTooltipParamName.ItemName, schemeMobaGoods.GoodsName); playerEquipTipsTrigger.SetText(UTooltipParamName.ItemCost, schemeMobaGoods.GoodsSoldOutCost.ToString()); }
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); }
public void SetReturnMatchState() { string str = "返回匹配邀请界面<br>暂未开始匹配"; UBB.toHtml(ref str); ReturnMatchBtnDesc.text = str; ReturnMatchBtn.gameObject.SetActive(true); }
public void Init() { UTooltipTrigger sendBtnToolTipTrigger = SendBtn.gameObject.GetComponent <UTooltipTrigger>(); string sendBtnTips = ULocalizationService.Instance.Get("UIView", "SNS", "SendBtnTips"); UBB.toHtml(ref sendBtnTips); sendBtnToolTipTrigger.SetText(UTooltipParamName.BodyText, sendBtnTips); }
public void SetData() { m_taskID = LogicDataCenter.lifeHeroDataManager.PrizeTaskData; if (m_taskID >= 0 && m_taskID < LifeHeroConfig.Instance.LifeHeroPrizeList.Count) { this.gameObject.SetActive(true); Transform container = prizeItem.transform.parent; SSchemeLifeHeroPrize prizeConfig = LifeHeroConfig.Instance.LifeHeroPrizeList[m_taskID]; m_prizeIDList = prizeConfig.prizeIDList; if (m_prizeIDList != null && m_prizeIDList.Count > 0) { prizeItem.SetData(m_prizeIDList[0]); int count = m_prizeIDList.Count - container.childCount; int i; if (count > 0) { for (i = 0; i < count; ++i) { PrizeItem item = Instantiate(prizeItem); if (item != null) { item.transform.SetParent(container); item.transform.localScale = Vector3.one; item.transform.localRotation = item.transform.localRotation; item.transform.SetLocalPosition(Vector3.zero); } } } for (i = 0; i < m_prizeIDList.Count; ++i) { GameObject child = container.GetChild(i).gameObject; child.SetActive(true); child.GetComponent <PrizeItem>().SetData(m_prizeIDList[i]); } for (; i < container.childCount; ++i) { container.GetChild(i).gameObject.SetActive(false); } } else { Debug.LogWarningFormat("该级别无奖励ID。taskID={0}", m_taskID); } string desc = prizeConfig.prizeDesc; UBB.toHtml(ref desc); prizeDesc.text = desc; SetObtainBtn(); } else { this.gameObject.SetActive(false); } }
private bool ParseDefaultTooltip(Value _tooltipElememts) { bool res = true; double _x, _y = 0; double _w, _h = 0; string _defaultText; /* * 元素0:目标的x坐标 * 元素1:目标的y坐标 * 元素2:目标的宽 * 元素3:目标的高 * 元素4:目标DefaultText内容 */ if (_tooltipElememts.GetArraySize() > 0) { _x = (double)_tooltipElememts.GetElement(0); _y = (double)_tooltipElememts.GetElement(1); _w = (double)_tooltipElememts.GetElement(2); _h = (double)_tooltipElememts.GetElement(3); if (_tooltipElememts.GetElement(4) == null) { return(false); } _defaultText = (string)_tooltipElememts.GetElement(4); //解析UBB UBB.toHtml(ref _defaultText); if (!Value.IsValueValid(DefaultTooltip)) { Trace.LogError("解析Tooltip类型时,发现DefaultTooltip无实例对象"); return(false); } if (DefaultTooltip.Invoke("SetText", _defaultText) == null) { Trace.LogError("解析Tooltip类型时,执行DefaultTooltip 的SetText操作失败"); return(false); } //设置完内容后重新计算 //_y -= DefaultTooltip.GetMember("height"); ////按比例调整偏移,目前发现好像不需要加偏移 ////_x -= _curAspRatioOffset.x; //_y -= _curAspRatioOffset.y; CalTooltipPostion(ref _x, ref _y, _w, _h, DefaultTooltip); //让AS显示 ShowTooltipEx(DefaultTooltip, _x, _y); } return(res); }
public virtual void SetData(UListItemRankRecord item) { if (item.node.wSeasonID <= 0) { BgIcon.gameObject.SetActive(true); ItemView.SetActive(false); BgIcon.raycastTarget = false; return; } BgIcon.gameObject.SetActive(true); BgIcon.raycastTarget = true; ItemView.SetActive(true); DateTime beginTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified).AddSeconds(item.node.nBeginTime); beginTime = beginTime.ToLocalTime(); DateTime endTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified).AddSeconds(item.node.nEndTime); endTime = endTime.ToLocalTime(); Season.text = string.Format("({0}){1}年{2}月--{3}年{4}月", item.node.szSeasonTitle, beginTime.Year, beginTime.Month, endTime.Year, endTime.Month); int nMatchType = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MATCHTYPE); IntPtr ptr = GameLogicAPI.getActorRankNameByGrade(nMatchType, item.node.wRankGrade); string strRankName = ""; if (ptr != IntPtr.Zero) { strRankName = IntPtrHelper.Ptr2Str(ptr); } Rank.text = strRankName; WinCount.text = item.node.wWinCount.ToString(); float fWinPro = item.node.wMatchCount > 0 ? (float)item.node.wWinCount / item.node.wMatchCount : 0; WinPro.text = string.Format("{0:F0}%", fWinPro * 100); int nIndex = 0; for (int i = 0; i < item.node.wHeroRecord.Length; i = i + 3) { int nHeroID = item.node.wHeroRecord[i]; int nMatchCount = item.node.wHeroRecord[i + 1]; int nWinCount = item.node.wHeroRecord[i + 2]; float fHeroWinPro = nMatchCount > 0 ? (float)nWinCount / nMatchCount : 0; MostUseHero[nIndex].sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_HeadPortrait, WndID.WND_ID_RANK_RECORD, 1, 4, nHeroID); string strTip = String.Format("胜率:{0}%<br>总场次:{1}", fHeroWinPro * 100, nMatchCount); UBB.toHtml(ref strTip); MostUseHeroTrigger[nIndex].SetText(UTooltipParamName.BodyText, strTip); nIndex++; } }
public void OnShipValDropdownChanged() { if (masterShipTooltipTrigger == null) { masterShipTooltipTrigger = masterSumShipTrans.transform.GetComponentInChildren <UTooltipTrigger>(true); } if (prenticeShipTooltipTrigger == null) { prenticeShipTooltipTrigger = prenticeSumShipTrans.transform.GetComponentInChildren <UTooltipTrigger>(true); } String szMasterDesc = ""; String szPrenticeDesc = ""; int masterSumShip = 0; int prenticeSumShip = 0; cmd_mentorship_person_baseinfo personData = LogicDataCenter.mentorshipDataManager.MentorshipPersonData; if (personData.nPDBID > 0) { masterSumShip = personData.nMSumShipVal; prenticeSumShip = personData.nPSumShipVal; szMasterDesc = ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "MWeekShipTitleDesc") + ":" + personData.nMWeekShipVal.ToString() + "\n" + ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "MLastWeekShipTitleDesc") + ":" + personData.nMLastWeekShipVal.ToString() + "\n" + ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "MLastWeekOrderDesc") + ":" + personData.nMLastSVOrder.ToString(); szPrenticeDesc = ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "PWeekShipTitleDesc") + ":" + personData.nPWeekShipVal.ToString() + "\n" + ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "PLastWeekShipTitleDesc") + ":" + personData.nPLastWeekShipVal.ToString() + "\n" + ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "PLastWeekOrderDesc") + ":" + personData.nPLastSVOrder.ToString(); } else { szMasterDesc = ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "MWeekShipTitleDesc") + ":0" + "\n" + ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "MLastWeekShipTitleDesc") + ":0" + "\n" + ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "MLastWeekOrderDesc") + ":0"; szPrenticeDesc = ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "PWeekShipTitleDesc") + ":0" + "\n" + ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "PLastWeekShipTitleDesc") + ":0" + "\n" + ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "PLastWeekOrderDesc") + ":0"; } mastserSumShipText.text = ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "MSumShipTitleDesc"); prenticeSumShipText.text = ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "PSumShipTitleDesc"); masterSumShipVal.text = masterSumShip.ToString(); prenticeSumShipVal.text = prenticeSumShip.ToString(); UBB.toHtml(ref szMasterDesc, UBB_FORMAT_TYPE.UGUI); masterShipTooltipTrigger.SetText(UTooltipParamName.BodyText, szMasterDesc); UBB.toHtml(ref szPrenticeDesc, UBB_FORMAT_TYPE.UGUI); prenticeShipTooltipTrigger.SetText(UTooltipParamName.BodyText, szPrenticeDesc); }
private void UpdateRandLoadingTip() { SSchemeLoadingWarTip tip = LoadingWarTipConfig.Instance.GetRandTipConfig(); if (tip != null) { string strTemp = tip.sTipContent; UBB.toHtml(ref strTemp); TipDesc.text = strTemp; } }
private void ShowDialog(string title, string content, DialogActions buttons) { UBB.toHtml(ref content); USpeedUI.TooltipAndDialog.UIDialogData data = new USpeedUI.TooltipAndDialog.UIDialogData( title: title, message: content, modal: true, hideByModalClick: false, buttons: buttons ); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_DIALOG, data); }
public override bool Init(IUISubWnd wnd) { string sClanTip = ClanConfig.Instance.tClanConfig.sClanTip; if (!sClanTip.Equals(string.Empty)) { UBB.toHtml(ref sClanTip, UBB_FORMAT_TYPE.UGUI); ClanTip.text = sClanTip; } return(base.Init(wnd)); }
//public Image DefaultBG; public virtual void SetData(UListItemClanEvent item) { if (DefalutBGSprite == null) { DefalutBGSprite = ComponentBG.sprite; } string sEventDesc = item.ClanEventDes; UBB.toHtml(ref sEventDesc, UBB_FORMAT_TYPE.UGUI); ClanEventDes.text = sEventDesc; }
/// 外部调用UI上系统飘字信息 public void onBroadFloatTextSystem(string stTextInfo = "", int nPosType = 0, int nTime = 0) { if (MyRoot != null && MyRoot.IsValid()) { string stInfo = stTextInfo; UBB.toHtml(ref stInfo); if (null == MyRoot.Invoke("onBroadFloatTextSystem", stInfo, nPosType, nTime)) { Trace.LogError("onBroadFloatTextSystem invoke == NULL stInfo = " + stInfo + ", nPosType = " + nPosType + "nTime = " + nTime); } } }
public void SetData() { Title.text = "排位赛"; string strTip = ULocalizationService.Instance.Get("UIView", "RankSeason", "TitleTip"); UBB.toHtml(ref strTip); Trigger.SetText(UTooltipParamName.BodyText, strTip); LadderBtnDesc.text = "排行榜"; RecordBtnDesc.text = "历史记录"; StartBtnDesc.text = "开始匹配"; }
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 SetRuneSlotShow(ref Dictionary <int, int> dicAllRuneSlotInfo) { for (int i = 0; i < arrayRuneSlot.Length; i++) { int nSlotId = i + 1; if (!dicAllRuneSlotInfo.ContainsKey(nSlotId)) { this.arrayRuneSlot[nSlotId - 1].transform.FindChild("Sprite").gameObject.SetActive(false); continue; } int nRuneId = dicAllRuneSlotInfo[nSlotId];//id->iconid if (nRuneId == 0) { this.arrayRuneSlot[nSlotId - 1].transform.FindChild("Sprite").gameObject.SetActive(false); continue; } SSchemeRuneConfig runeConfig = RunePage.Instance.allRunePageTable[nRuneId] as SSchemeRuneConfig; if (runeConfig == null) { continue; } this.arrayRuneSlot[nSlotId - 1].transform.FindChild("Sprite").gameObject.GetComponent <Image>().sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_Rune, WndID.WND_ID_PLAYERFRAME, runeConfig.nRuneInlayType, runeConfig.nRuneIconId); this.arrayRuneSlot[nSlotId - 1].transform.FindChild("Sprite").gameObject.SetActive(true); UTooltipTrigger slotTooltipTrigger = this.arrayRuneSlot[nSlotId - 1].gameObject.GetComponent <UTooltipTrigger>(); if (slotTooltipTrigger == null) { slotTooltipTrigger = this.arrayRuneSlot[nSlotId - 1].gameObject.AddComponent <UTooltipTrigger>(ETooltipStyle.ETS_Default); slotTooltipTrigger.backgroundTint = Color.grey; slotTooltipTrigger.IsUpStay = false; } if (runeConfig == null) { slotTooltipTrigger.SetText(UTooltipParamName.BodyText, "EmptyDesc"); return; } if (runeConfig.szParametersValueArray == "") { slotTooltipTrigger.SetText(UTooltipParamName.BodyText, "EmptyDesc"); return; } UBB.toHtml(ref runeConfig.szRuneDESC, UBB_FORMAT_TYPE.UGUI); slotTooltipTrigger.SetText(UTooltipParamName.BodyText, runeConfig.szRuneDESC); } }
// 初始化 public override bool Init(IUIWnd wnd) { base.Init(wnd); TitleDesc.text = ULocalizationService.Instance.Get("UIView", "Common", "TipText"); string szTip = ULocalizationService.Instance.Get("UIView", "Task", "ReflushTip"); UBB.toHtml(ref szTip); TipDesc.text = szTip; BtnDesc.text = ULocalizationService.Instance.Get("UIView", "Task", "ReflushNow"); MoneyTitleDesc.text = ULocalizationService.Instance.Get("UIView", "Task", "ReflushMoney"); return(true); }
private bool ParseRoomHeroDescTooltip(Value _tooltipElememts) { bool res = true; double _x, _y, _width, _height = 0; string skillDesc = ""; /*目前解析为测试用 * 元素5:目标的召唤师技能名字描述 * 元素6:目标的召唤师技能描述 */ if (_tooltipElememts.GetArraySize() > 0) { _x = (double)_tooltipElememts.GetElement(0); _y = (double)_tooltipElememts.GetElement(1); _width = (double)_tooltipElememts.GetElement(2); _height = (double)_tooltipElememts.GetElement(3); //Trace.LogWarning("_tooltipElememts.GetArraySize()=" + _tooltipElememts.GetArraySize()); if (_tooltipElememts.GetElement(4) == null) { return(false); } skillDesc = ((string)_tooltipElememts.GetElement(4)).TrimStart('$'); //解析UBB UBB.toHtml(ref skillDesc); //传数据到AS if (!Value.IsValueValid(RoomHeroDescTip)) { Trace.LogError("解析Tooltip类型时,发现ParseRoomHeroDescTooltip无实例对象"); return(false); } // function SetText(_strDes1:String):void if (RoomHeroDescTip.Invoke("SetText", skillDesc) == null) { Trace.LogError("解析Tooltip类型时,执行ParseRoomHeroDescTooltip 的SetText操作失败"); return(false); } _x += _width * 1; _y += _height * 0.5; //让AS显示 ShowTooltipEx(RoomHeroDescTip, _x, _y); } return(res); }
public void setCardInfo(cmd_entity_hero_card cmdData) { heroHead.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_HeadPortrait, WndID.WND_ID_WAR_RECORDTABLE_END, 1, 7, cmdData.nHeroID); //cardFrame.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_CardFrameUI, WndID.WND_ID_WAR_RECORDTABLE_END, cmdData.nCardFrameID); string stCardName = cmdData.chHeroCardName; if (stCardName != null) { UBB.toHtml(ref stCardName, UBB_FORMAT_TYPE.UGUI); } cardName.text = stCardName; cardCount.text = cmdData.nCount.ToString(); }
public override bool Init(IUIWnd wnd) { TitleDes.text = ULocalizationService.Instance.Get("UIView", "LegendCupPrize", "Title"); TotalBonusDes.text = ULocalizationService.Instance.Get("UIView", "LegendCupPrize", "TotalBonus"); RankDes.text = ULocalizationService.Instance.Get("UIView", "LegendCupPrize", "Rank"); TeamPrizeDes.text = ULocalizationService.Instance.Get("UIView", "LegendCupPrize", "TeamPrize"); PersonalPrizeDes.text = ULocalizationService.Instance.Get("UIView", "LegendCupPrize", "PersonalPrize"); string strTip = ULocalizationService.Instance.Get("UIView", "LegendCupPrize", "PrizeTip"); UBB.toHtml(ref strTip); PrizeTip.text = strTip; return(base.Init(wnd)); }
public void OnWndOpen() { SSchemeLoadingWarTip tip = LoadingWarTipConfig.Instance.GetRandTipConfig(ELoadingTipType.ELTT_SECOND); if (tip != null) { string strContent = tip.sTipContent; UBB.toHtml(ref strContent); TipDesc.text = strContent; TipTitle.text = tip.sTipTitle; } TipGo.SetActive(false); //TipGo.SetActive(true); }