public void RefreshHeadBoxItem(PropItemInfo info) { IniteCompent(); if (info == null) { return; } AtlasHelper.SetItemIcon(icon, info); headBox_name.text = info.itemName; var item = Module_Cangku.instance.GetItemByID(info.ID); lockBtn.SafeSetActive(item == null); if (lockBtn.gameObject.activeInHierarchy) { lockBtn.onClick.RemoveAllListeners(); lockBtn.onClick.AddListener(() => { Module_Global.instance.UpdateGlobalTip((ushort)info.ID, true, false); }); } string GetID = Util.Format("{0},{1}", Module_Player.instance.roleInfo.roleId, info.ID); int ID = PlayerPrefs.GetInt(Util.Format("{0}", GetID)); newLockImage.SafeSetActive(Module_Equip.instance.HasProp(info.ID) && (ID != info.ID && info.ID != 901) && ID != Module_Set.instance.SelectBoxID); slecton.SafeSetActive(info.ID == Module_Set.instance.SelectBoxID); }
private void Refresh() { if (null == _chaseTask) { return; } int index = 0; index = _chaseTask.taskData.resetTimes >= _chaseTask.taskConfigInfo.dayRemainCount - 1 ? _chaseTask.taskConfigInfo.dayRemainCount - 1 : _chaseTask.taskData.resetTimes; if (index < 0 || index > _chaseTask.taskConfigInfo.cost.Length - 1) { return; } string[] str = _chaseTask.taskConfigInfo.cost[index].Split('-'); if (str.Length < 2) { return; } var prop = ConfigManager.Get <PropItemInfo>(Util.Parse <int>(str[0])); contentTip.text = Util.Format(ConfigText.GetDefalutString(TextForMatType.ChaseUIText, 30), str[1], prop.itemName); int remainCount = _chaseTask.taskConfigInfo.dayRemainCount - _chaseTask.taskData.resetTimes; currentDayCount.text = Util.Format(ConfigText.GetDefalutString(TextForMatType.ChaseUIText, 31), remainCount >= 0 ? remainCount : 0); AtlasHelper.SetItemIcon(costIcon, prop); bool canPay = modulePlayer.roleInfo.diamond >= Util.Parse <int>(str[1]); string colorStr = GeneralConfigInfo.GetNoEnoughColorString(modulePlayer.roleInfo.diamond.ToString()); Util.SetText(costCount, (int)TextForMatType.ChaseUIText, 32, str[1], canPay ? modulePlayer.roleInfo.diamond.ToString() : colorStr); sureBtn.interactable = canPay && remainCount > 0; }
private void SetInsoulInfo()//设置入魂的信息 { //武器的id if (item == null) { return; } WeaponAttribute dInfo = ConfigManager.Get <WeaponAttribute>(item.itemTypeId); if (dInfo == null) { return; } //元素小图 AtlasHelper.SetShared(elementicongroup, m_elementData[(int)(dInfo.elementType) - 1]); AtlasHelper.SetShared(m_fill.gameObject, m_elementFill[(int)(dInfo.elementType) - 1]); AtlasHelper.SetShared(m_fillelement, m_elementIcon[(int)(dInfo.elementType) - 1]); PropItemInfo elementInfo = ConfigManager.Get <PropItemInfo>(dInfo.elementId); AtlasHelper.SetItemIcon(elementdebris, elementInfo); m_eleMaxYes.gameObject.SetActive(false); elementMax.anchoredPosition = new Vector3(0, 30, 0); ElementNext(); Element_up(); }
private void SetUnionIntegral() { m_unionHint.gameObject.SetActive(false); m_unionShow.gameObject.SetActive(false); if (modulePlayer.roleInfo.leagueID != 0) { var info = ConfigManager.Find <PropItemInfo>(o => o.itemType == PropType.BordGrade); if (info) { AtlasHelper.SetItemIcon(m_unionIcon, info); } var keyStr = "unionRank" + modulePlayer.id_; bool firstOpen = moduleWelfare.FrirstOpen(keyStr, false); if (moduleUnion.m_selfInter == null) { return; } if (firstOpen && moduleUnion.m_selfInter.intergl > 0) { m_unionHint.gameObject.SetActive(true); } if (moduleUnion.m_selfInter != null) { m_unionShow.gameObject.SetActive(true); m_unionScore.text = moduleUnion.m_selfInter.intergl.ToString(); } } }
private void SetItemData(Transform node, PShopItem data) { if (data == null) { return; } PropItemInfo psi = ConfigManager.Get <PropItemInfo>(data.itemTypeId); if (psi == null) { return; } Image icon = node.Find("icon").GetComponent <Image>(); Text orderName = node.Find("title").GetComponent <Text>(); Image priceIcon = node.Find("consume/number/icon").GetComponent <Image>(); Text price = node.Find("consume/number").GetComponent <Text>(); Image newMark = node.Find("newInfo").GetComponent <Image>(); Button btnBuy = node.Find("bug_Btn").GetComponent <Button>(); Text textBtnBuy = node.Find("bug_Btn/buy_Txt").GetComponent <Text>(); Text textdesc = node.Find("des").GetComponent <Text>(); Util.SetText(textBtnBuy, ConfigText.GetDefalutString(TextForMatType.NpcDatingRest, 1)); Util.SetText(textdesc, psi.desc); //菜品描述 Util.SetText(orderName, psi.itemNameId); AtlasHelper.SetItemIcon(icon, psi); //菜品图标 PropItemInfo itemInfo = ConfigManager.Get <PropItemInfo>(data.currencyType); AtlasHelper.SetItemIcon(priceIcon, itemInfo);//设置货币的icon string strPrice = "×" + data.currencyNum; //如果是免费的,则显示免费字样 priceIcon.SafeSetActive(data.currencyNum > 0); if (data.currencyNum > 0) { Util.SetText(price, strPrice); } else { Util.SetText(price, ConfigText.GetDefalutString(TextForMatType.NpcDatingRest, 2)); //免费字样看文本 } bool enoughMoney = CheckMoney(data.currencyType, data.currencyNum); price.color = ColorGroup.GetColor(ColorManagerType.NpcDatingRestOrder, enoughMoney); newMark.SafeSetActive(data.isNew == 0); var btnIndex = btnBuy.transform.parent.GetSiblingIndex(); if (m_itemDataDic.ContainsKey(btnIndex)) { m_itemDataDic.Remove(btnIndex); } m_itemDataDic.Add(btnIndex, data); }
private void RefreshExpense() { var info = ConfigManager.Get <PropItemInfo>(moduleShop.curShopMsg.refreshCurrency); if (info != null) { AtlasHelper.SetItemIcon(payTypeImage, info); } Util.SetText(DiamondBySpend_text, "×" + moduleShop.curShopMsg.refreshNum); }
private void CloseInfo(PExpendItem[] expend, int throughTimes) { GeneralConfigInfo generalInfo = GeneralConfigInfo.defaultConfig; if (generalInfo == null) { Logger.LogError("pet time is null"); return; } var remainTimes = 0; if (Module_Home.instance.LocalPetInfo != null) { remainTimes = Module_Home.instance.LocalPetInfo.times; } var sysnText = pettask_txt[10] + remainTimes + pettask_txt[9]; Util.SetText(m_restTimes, sysnText); sureopen.onClick.RemoveAllListeners(); sureopen.onClick.AddListener(() => { Module_Home.instance.Opentask(); }); if (expend.Length == 0) { Logger.LogDetail("NO expend"); m_expendTip.gameObject.SetActive(false); return; } m_expendTip.gameObject.SetActive(true); int propid = expend[0].expendid; int propnum = expend[0].expendnum; PropItemInfo item = ConfigManager.Get <PropItemInfo>(propid);//id 是1 或者2 if (item == null) { Logger.LogError("expend prop is null"); m_expendTip.gameObject.SetActive(false); return; } AtlasHelper.SetItemIcon(costimage, item); int num = (int)Module_Player.instance.roleInfo.diamond; if (propid == 1) { num = (int)Module_Player.instance.roleInfo.coin; } var synthetic = "×" + propnum.ToString() + pettask_txt[8] + num + pettask_txt[9]; Util.SetText(havenum, synthetic); }
private void Name_Spend()//从服务器获取更改名字需要花费的钻石 { if (moduleSet.spend_num == null) { return; } PropItemInfo info = ConfigManager.Get <PropItemInfo>(moduleSet.spend_num.itemTypeId); AtlasHelper.SetItemIcon(spend_name_img1, info); AtlasHelper.SetItemIcon(spend_name_img2, info); two_txt_num.text = moduleSet.spend_num.price.ToString(); sure_change_num.text = moduleSet.spend_num.price.ToString(); }
private void RefreshGradeIcon() { var info = ConfigManager.Find <PropItemInfo>(o => o.itemType == PropType.BordGrade); if (info) { AtlasHelper.SetItemIcon(m_gradeIcon, info); } if (modulePet.FightingPet != null) { Util.SetPetSimpleInfo(this.m_petIcon, modulePet.FightingPet); this.m_petIcon.SafeSetActive(true); } else { this.m_petIcon.SafeSetActive(false); } }
public void RefreshUiData(ShopMessage msg, PShopItem data) { IniteCompent(); var info = ConfigManager.Get <PropItemInfo>(data.itemTypeId); if (info == null) { return; } Util.SetItemInfoSimple(wupin, info); if (msg.pos == ShopPos.Npc) { AtlasHelper.SetIcons(wupin?.Find("icon"), info.mesh != null && info.mesh.Length > 1 ? info.mesh[1] : info.icon); } _name.text = info.itemName; count.text = "×" + data.num.ToString(); Util.SetText(alreadyHave, (int)TextForMatType.TravalShopUIText, 9); Util.SetText(alreadySelled, (int)TextForMatType.TravalShopUIText, 10); Util.SetText(discountImage, (int)TextForMatType.TravalShopUIText, 12); cost_panel.SafeSetActive(true); grayPanel.SafeSetActive(false); //正常 var currencyType = ConfigManager.Get <PropItemInfo>(data.currencyType); if (currencyType && payType) { payType.SafeSetActive(true); AtlasHelper.SetItemIcon(payType, currencyType); } cost.text = "×" + data.currencyNum.ToString(); tip_btn.onClick.RemoveAllListeners(); tip_btn.onClick.AddListener(() => { Module_Global.instance.UpdateGlobalTip(data.itemTypeId, true); }); //促销 int hash = Module_Shop.instance.GetPromoHash(msg.shopId, data.itemTypeId, data.num); PShopPromotion promotion = Module_Shop.instance.allPromo.Get(hash); if (promotion != null) { discountCostPanel.SafeSetActive(true); originalCost.text = "×" + data.currencyNum.ToString(); if (promotion != null) { nowCost.text = "×" + promotion.price.ToString(); } discountImage.transform.parent.SafeSetActive(true); cost.SafeSetActive(false); } else { discountCostPanel.SafeSetActive(false); cost.SafeSetActive(true); discountImage.transform.parent.SafeSetActive(false); } isHaved = false; isSelled = false; //随机商店显示已售罄 if (msg.isRandom) { isSelled = data.buy == 1; cost_panel.SafeSetActive(!isSelled); grayPanel.SafeSetActive(isSelled); alreadyHave.SafeSetActive(false); alreadySelled.SafeSetActive(isSelled); } //如果是时装显示已拥有&&不能是子类型为8的时装,为8的要显示已售罄 var have = (info.itemType == PropType.FashionCloth && (FashionSubType)info.subType != FashionSubType.FourPieceSuit) || (info.itemType == PropType.HeadAvatar && info.subType == 1); if (have) { isHaved = Module_Equip.instance.HasProp(data.itemTypeId); cost_panel.SafeSetActive(!isHaved); grayPanel.SafeSetActive(isHaved); alreadyHave.SafeSetActive(isHaved); alreadySelled.SafeSetActive(false); } if (msg.pos == ShopPos.Npc && Module_Npc.instance.curNpc != null && Module_Npc.instance.curNpc.npcInfo != null) { isEquip = Module_Npc.instance.curNpc._mode == data.itemTypeId; isHaved = Module_Equip.instance.HasProp(data.itemTypeId) || isEquip || Module_Npc.instance.curNpc.npcInfo.cloth == data.itemTypeId; cost_panel.SafeSetActive(!isHaved); grayPanel.SafeSetActive(isHaved); grayPanel.enabled = !isHaved; alreadyHave.SafeSetActive(isHaved); alreadySelled.SafeSetActive(false); offImage.SafeSetActive(!isHaved); alreadyEquip.SafeSetActive(isEquip); //选中框 if (isEquip && Module_Shop.instance.lastClickItem == null) { Module_Shop.instance.curClickItem = data; } } selectBox.SafeSetActive(Module_Shop.instance.curClickItem != null && Module_Shop.instance.curClickItem == data); }
private void RefreshPublic(PropItemInfo propInfo) { if (!propInfo) { return; } if (propInfo.itemType == PropType.Weapon) { WeaponAttribute weaponAttributes = ConfigManager.Get <WeaponAttribute>(propInfo.ID); //武器名字 if (weapon_name) { weapon_name.gameObject.SetActive(true); weapon_name.text = propInfo.itemName; } //其他名字 if (other_name) { other_name.gameObject.SetActive(false); } CreatureElementTypes type = weaponAttributes ? (CreatureElementTypes)weaponAttributes.elementType : CreatureElementTypes.Count; //武器后面的属性描述 string attributeName = string.Empty; switch (type) { case CreatureElementTypes.Wind: attributeName = ConfigText.GetDefalutString(TextForMatType.EquipUIText, 15); break; case CreatureElementTypes.Fire: attributeName = ConfigText.GetDefalutString(TextForMatType.EquipUIText, 16); break; case CreatureElementTypes.Water: attributeName = ConfigText.GetDefalutString(TextForMatType.EquipUIText, 17); break; case CreatureElementTypes.Thunder: attributeName = ConfigText.GetDefalutString(TextForMatType.EquipUIText, 18); break; case CreatureElementTypes.Ice: attributeName = ConfigText.GetDefalutString(TextForMatType.EquipUIText, 19); break; default: break; } weapon_attbitue.text = attributeName; //左边图标 foreach (var attr in leftAttrDic) { attr.Value.gameObject.SetActive((int)attr.Key == propInfo.subType); } if (propInfo.subType == (int)WeaponSubType.Gun) { //星级 for (int i = 0; i < starsImages.Length; i++) { starsImages[i].gameObject.SetActive(i < propInfo.quality + 1); } //底板 for (int i = 0; i < bgQualityImages.Length; i++) { bgQualityImages[i].gameObject.SetActive(i + 1 == propInfo.quality); } } else//武器要特殊处理底板 { int index = (data.InvalidGrowAttr() ? 0 : data.growAttr.equipAttr.star) + 1; //底板 for (int i = 0; i < bgQualityImages.Length; i++) { bgQualityImages[i].gameObject.SetActive(i + 1 == index); } //星级 for (int i = 0; i < starsImages.Length; i++) { starsImages[i].gameObject.SetActive(i < index); } } } else { if (weapon_name) { weapon_name.gameObject.SetActive(false); } if (other_name) { other_name.gameObject.SetActive(true); other_name.text = propInfo.itemName; } //星级 for (int i = 0; i < starsImages.Length; i++) { starsImages[i].gameObject.SetActive(i < propInfo.quality); } } //换icon if (propInfo) { AtlasHelper.SetItemIcon(icon, propInfo); } }