private void RefreshNow() { var petInfo = petSelectModule.selectInfo; if (petInfo == null) { return; } var grade = petInfo.GetUpGradeInfo(petInfo.Grade); var skill = petInfo.GetSkill(grade); if (skill != null) { Util.SetText(rightName, petInfo.SkillName); AtlasHelper.SetShared(rightIcon, skill.skillIcon); } var showList = petInfo.Attribute; for (var i = 0; i < showList.Count; i++) { if (cache.ContainsKey((CreatureFields)showList[i].id)) { var t = cache[(CreatureFields)showList[i].id].GetComponent <Text>("attr_txt_03"); Util.SetText(t, showList[i].ValueString()); } } }
private void RefreshPrev() { var petInfo = petSelectModule.selectInfo; if (petInfo == null) { return; } var grade = petInfo.GetUpGradeInfo(petInfo.Grade - 1); var skill = petInfo.GetSkill(grade); if (skill != null) { Util.SetText(leftName, Util.Format(ConfigText.GetDefalutString(skill.skillName), petInfo.AdditiveLevel - 1)); AtlasHelper.SetShared(leftIcon, skill.skillIcon); } if (AttrGroupRoot == null) { return; } //创建属性条 var rList = petInfo.GetAttribute(petInfo.Level, petInfo.Grade - 1); foreach (var aShow in rList) { var t = AttrGroupRoot.AddNewChild(AttrTemplete); t.SafeSetActive(true); BindProperty(t, aShow); cache.Add((CreatureFields)aShow.id, t); } }
public void Init(PSoulAttr rSoulAttr) { var soulInfo = ConfigManager.Get <SoulInfo>(rSoulAttr?.soulId ?? 0); ownNode.SafeSetActive(soulInfo != null); noneNode.SafeSetActive(soulInfo == null); if (soulInfo == null) { return; } var t = GetSoulInfo(rSoulAttr); Util.SetText(name, soulInfo.nameId); Util.SetText(awakePercent, t.Item1); Util.SetText(grade, t.Item2); Util.SetText(desc, soulInfo.descId); AtlasHelper.SetShared(icon, soulInfo.icon); Util.ClearChildren(attributeGroup); for (var i = 0; i < t.Item3.Length; i++) { var a = attributeGroup.AddNewChild(attributeTemplate); a.SafeSetActive(true); Util.SetText(a?.gameObject, t.Item3[i]); } }
protected void HandleMonsterIcon(MonsterInfo info) { if (info != null) { AtlasHelper.SetShared(m_portraitItem.portrait, info.avatar); } }
protected override void OnBecameVisible(bool oldState, bool forward) { playerInfo = Window.GetWindowParam <Window_ApplyFriend>().param1 as PPlayerInfo; if (playerInfo == null) { return; } Util.SetText(name_, playerInfo.name); Util.SetText(uid_, "<color=#CDFDFFFF>UID:</color>{0}", playerInfo.index); Util.SetText(level, $"LV.{playerInfo.level}"); Util.SetText(introduce, moduleSet.SetSignTxt(playerInfo.intro)); AtlasHelper.SetShared(protoHint, "ui_invitefriend_" + playerInfo.proto); friendBox.HeadBox(playerInfo.headBox); Module_Avatar.SetClassAvatar(Head_img?.gameObject, playerInfo.proto, false, playerInfo.gender); bool apply = moduleFriend.AddApplyID.Exists(a => a == playerInfo.roleId); if (apply) { Util.SetText(m_addTxt, 263, 5); } else { Util.SetText(m_addTxt, 263, 1); } addButton.interactable = !apply; }
private void EffectInfo(RectTransform rt, BossEffectInfo info) { if (info == null) { return; } var time = 0; var eff = moduleUnion.BossBuffInfo.Find(a => a.effectId == info.ID); if (eff != null) { time = eff.times; } var img = rt.Find("icon").GetComponent <Image>(); AtlasHelper.SetShared(img, info.icon); var eName = rt.Find("name").GetComponent <Text>(); Util.SetText(eName, info.nameId); var open = rt.Find("open").GetComponent <Text>(); var openBg = rt.Find("openBg"); open.gameObject.SetActive(time > 0); openBg.gameObject.SetActive(time > 0); img.SafeSetActive(false); img.saturation = time > 0 ? 1 : 0; img.SafeSetActive(true); Util.SetText(open, time.ToString()); }
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 RefreshInfo() { awakeButton?.transform.SetGray(state != 0); awakeButton.SetInteractable(state == 0); Util.SetText(buttonText, ConfigText.GetDefalutString(TextForMatType.AwakePoint, state == 0 ? 11 : state == -1 ? 10 : 12)); if (info != null) { Util.SetText(skillName, info.NameString); Util.SetText(skillDesc, info.DescString); AtlasHelper.SetShared(skillIcon, info.icon, null, true); if (info.cost != null) { var prop = ConfigManager.Get <PropItemInfo>(info.cost.itemId); AtlasHelper.SetIcons(costIcon, prop.icon); Util.SetText(costNum, info.cost.count.ToString()); uint own = 0; if (prop.itemType == PropType.Currency) { own = modulePlayer.GetMoneyCount((CurrencySubType)prop.subType); } else { own = moduleAwake.GetBeadCount(prop.subType); } Util.SetText(ownNum, Util.Format(ConfigText.GetDefalutString((int)TextForMatType.AwakePoint, 9), own)); costNum.color = ColorGroup.GetColor(ColorManagerType.IsMatrialEnough, info.cost.count <= own); } } }
public void HeadBox(int boxid)//设置头像框 { get(); if (boxid == 0 || boxid == 1) { Logger.LogError("this player head id is {0}", boxid); boxid = 901;//如果为零则自动成为默认头像 } PropItemInfo BoxInfo = ConfigManager.Get <PropItemInfo>(boxid); if (BoxInfo == null) { Logger.LogError("headbox datda error null id is {0}", boxid); return; } string[] mesh = BoxInfo.mesh; if (mesh != null && mesh.Length > 0) { AtlasHelper.SetShared(headbox_bottom, mesh[0]); if (mesh.Length > 1 && headbox_top != null) { AtlasHelper.SetShared(headbox_top, mesh[1]); } } else { Logger.LogError("headbox datda error" + boxid); } }
public void SetNpcInfo(INpcMessage rInfo, Transform targetPos) { if (rInfo == null) { return; } AssertInit(); AtlasHelper.SetShared(_icon, rInfo.icon); SetRelationShip(rInfo.fetterStage); DrawLine(rInfo, targetPos); }
public static void Bind(Transform rRoot, PRoleSummary rRole, UnityAction rOnDeleteClick) { var profession = rRoot.GetComponent <Transform>("profession"); AtlasHelper.SetShared(profession, $"proicon_0{rRole.proto}"); Util.SetText(rRoot.GetComponent <Text>("name"), rRole.name); Util.SetText(rRoot.GetComponent <Text>("level"), $"Lv.{rRole.level}"); Util.SetText(rRoot.GetComponent <Text>("raidValue"), ConfigText.GetDefalutString(204, 36) + rRole.power); rRoot.GetComponent <Button>("delete_btn")?.onClick.AddListener(rOnDeleteClick); }
// Update is called once per frame public void SetPlayerInfo(PUnionPlayer playerInfo) { Get(); PPlayerInfo baseInfo = playerInfo.info; if (baseInfo == null) { return; } Module_Avatar.SetClassAvatar(m_headImg, baseInfo.proto, false, baseInfo.gender); headBoxFriend detailBox = m_headBox.GetComponentDefault <headBoxFriend>(); detailBox.HeadBox(baseInfo.headBox); m_name.text = baseInfo.name; m_level.text = "LV." + baseInfo.level; m_contribution.text = ConfigText.GetDefalutString(242, 183) + playerInfo.sentiment.ToString(); if (baseInfo.state == 0) { m_state.text = ConfigText.GetDefalutString(218, 30); m_state.color = Color.gray; } else { m_state.text = ConfigText.GetDefalutString(218, 29); m_state.color = Color.green; } m_rankImg.gameObject.SetActive(false); if (playerInfo.title == 0) { m_rankImg.gameObject.SetActive(true); AtlasHelper.SetShared(m_rankImg.gameObject, "ui_union_level01"); m_rankTxt.text = ConfigText.GetDefalutString(242, 184); } else if (playerInfo.title == 1) { m_rankImg.gameObject.SetActive(true); AtlasHelper.SetShared(m_rankImg.gameObject, "ui_union_level02"); m_rankTxt.text = ConfigText.GetDefalutString(242, 185); } if (baseInfo.roleId == Module_Player.instance.roleInfo.roleId) { detailBox.HeadBox(Module_Player.instance.roleInfo.headBox); m_name.text = Module_Player.instance.name_; m_level.text = "LV." + Module_Player.instance.level; } }
private void SetBaseIndo(PItem info) { PropItemInfo prop = ConfigManager.Get <PropItemInfo>(info.itemTypeId); int index = Module_Forging.instance.GetWeaponIndex(prop); if (index != -1) { AtlasHelper.SetShared(m_weaponIcon.gameObject, m_weaponType[index]); } m_strengLevel.text = "+" + info.growAttr.equipAttr.strength.ToString(); m_weaponName.text = prop.itemName; }
private void UpdateHeadBox() { PropItemInfo info = ConfigManager.Get <PropItemInfo>(Module_Player.instance.roleInfo.headBox == 0 ? 901 : Module_Player.instance.roleInfo.headBox); if (info != null && info.mesh != null && info.mesh.Length > 0) { AtlasHelper.SetShared(headbox_bottom, info.mesh[0]); if (info.mesh.Length > 1) { AtlasHelper.SetShared(headbox_top, info.mesh[1]); } } }
private void SetlableInfo(RectTransform rt, PWeflareInfo info) { if (moduleWelfare.chooseInfo == null || info == null) { return; } var lable = rt.Find("label_Txt").GetComponent <Text>(); var tip = rt.Find("tip"); Util.SetText(lable, info.title); tip.gameObject.SetActive(false); if (info.title.Contains("&")) { var t = info.title.Split('&')[0]; var txt = info.title.Split('&')[1]; tip.gameObject.SetActive(true); Util.SetText(lable, txt); var index = Util.Parse <int>(t); if (index < 0 || index >= recommend.Length) { index = 0; } AtlasHelper.SetShared(tip, recommend[index], null, true); } if (info.type == (int)WelfareType.ActiveNewPuzzle) { Util.SetText(lable, info.introduce); } if (info.id == moduleWelfare.chooseInfo.id || (moduleWelfare.chooseInfo.type == (int)WelfareType.ActiveNewPuzzle && info.type == (int)WelfareType.ActiveNewPuzzle)) { var tog = rt.parent.GetComponentDefault <Toggle>(); tog.isOn = false; m_checkImg.duration = 0.15f; m_checkImg.from = m_checkImg.transform.localPosition; var pos = rt.parent.localPosition; pos.y -= 4; m_checkImg.to = pos; m_checkImg.Play(); tog.isOn = true; } else if (lable.color != Color.white) { var teween = lable.transform.GetComponent <TweenColor>(); teween.PlayReverse(); } var hint = rt.Find("hint"); hint.SafeSetActive(moduleWelfare.GeLableHint(info)); }
public void RefreshTip(PetSkill.Skill rSkill, int rLevel, EnumPetMood rMood)//技能 { IniteCompent(); expRemainTime = -1; dropBtn.gameObject.SetActive(false); m_petSkill?.gameObject.SetActive(true); m_rTime.transform.parent.gameObject.SetActive(false); Util.DisableAllChildren(wupin, new[] { "icon", "name" }); AtlasHelper.SetShared(wupin.GetComponent <Image>("icon"), rSkill.skillIcon); Util.SetText(wupin.GetComponent <Text>("name"), Util.Format(ConfigText.GetDefalutString(rSkill.skillName), rLevel)); Util.SetText(tip_text, rSkill.GetDesc(rLevel)); Util.SetText(m_petSkill, Util.Format(ConfigText.GetDefalutString(105000), (int)rMood)); }
private void RefreshSkill() { if (SelectPet == null) { return; } var skill = SelectPet.GetSkill(); if (skill == null) { return; } AtlasHelper.SetShared(skillIcon, skill.skillIcon); Util.SetText(skillDescText, SelectPet.SkillName); }
private void OnSetData(RectTransform rt, Module_Npc.NpcMessage info) { Transform no = rt.Find("noImage"); Transform have = rt.Find("haveImage"); Transform select = rt.Find("selectBox"); if (!no || !have || !select) { return; } no.gameObject.SetActive(false); have.gameObject.SetActive(true); int index = Module_Npc.instance.allNpcs.FindIndex((p) => p.npcId == info.npcId); //设置默认选中已有的 第一个符文 if (m_CurClickIndex == -1) { m_CurClickIndex = index; } select.gameObject.SetActive(index == m_CurClickIndex); if (index == m_CurClickIndex) { AtlasHelper.SetShared(m_NpcIcon, info.icon); Util.SetText(m_NpcName, info.npcInfo.name); Util.SetText(m_NpcNation, info.npcInfo.nation); Util.SetText(m_NpcFaith, info.npcInfo.belief); //UIDynamicImage.LoadImage(m_NpcFullImage.transform, info.npcInfo.allbobyicon, null, true); //这里需要全身像数据 Util.SetText(m_NpcFetterValue, info.nowFetterValue); Util.SetText(m_NpcFetterLevel, info.fetterLv); Util.SetText(m_NpcFetterState, info.curLvName); int c = info.fetterLv % 3; m_NpcFetterStage_0_Flag.SafeSetActive(c == 1); m_NpcFetterStage_0_Flag.SafeSetActive(c == 2); m_NpcFetterStage_0_Flag.SafeSetActive(c == 0); if (info.belongStageName.Length >= 3) { Util.SetText(m_NpcFetterStage_0, info.belongStageName[0]); Util.SetText(m_NpcFetterStage_1, info.belongStageName[1]); Util.SetText(m_NpcFetterStage_2, info.belongStageName[2]); } } }
private void ShowRank(int index, int type, ulong setId, bool set) { m_dataNormal.gameObject.SetActive(false); m_dataBefor.gameObject.SetActive(false); m_dataNo.gameObject.SetActive(false); if (index == 0) { m_dataBefor.gameObject.SetActive(true); AtlasHelper.SetShared(m_dataBefor.gameObject, "ui_bordland_ranklevel_01"); } else if (index == 1) { m_dataBefor.gameObject.SetActive(true); AtlasHelper.SetShared(m_dataBefor.gameObject, "ui_bordland_ranklevel_02"); } else if (index == 2) { m_dataBefor.gameObject.SetActive(true); AtlasHelper.SetShared(m_dataBefor.gameObject, "ui_bordland_ranklevel_03"); } else if (index == -1) { m_dataNo.gameObject.SetActive(true); } else { m_dataNormal.gameObject.SetActive(true); m_dataNormal.text = (index + 1).ToString(); } if (!set) { return; } var m_back = transform.Find("back").GetComponent <Image>(); m_back.color = Color.white; if (type == 0 && setId == Module_Player.instance.id_) { m_back.color = GeneralConfigInfo.defaultConfig.rankSelfColor; } else if (type == 1 && setId == Module_Player.instance.roleInfo.leagueID) { m_back.color = GeneralConfigInfo.defaultConfig.rankSelfColor; } }
public bool RefreshTitle() { var prop = moduleFurnace.currentSublimationItem?.GetPropItem(); if (null == prop) { return(false); } int index = Module_Forging.instance.GetWeaponIndex(prop); if (index != -1) { AtlasHelper.SetShared(icon, ForgePreviewPanel.WEAPON_TYPE_IMG_NAMES[index]); } Util.SetText(nameText, prop.itemName); Util.SetText(levelText, "+" + moduleFurnace.currentSublimationItem.GetIntentyLevel()); return(true); }
private void UpdateAvatarBox() { if (!m_creature || !avatarBoxBg && !avatarBoxMask) { return; } if (m_creature.isMonster) // Use static atlas { if (avatarBoxBg) { AtlasHelper.SetShared(avatarBoxBg, Creature.GetStaticAvatarBox(m_creature.avatarBox)); } if (avatarBoxMask) { AtlasHelper.SetShared(avatarBoxMask, string.Empty); } return; } var box = ConfigManager.Get <PropItemInfo>(m_creature.avatarBox == 0 ? Creature.DEFAULT_AVATAR_BOX : m_creature.avatarBox); if (!box) { return; } if (avatarBoxBg) { AtlasHelper.SetShared(avatarBoxBg, box.mesh.Length < 1 ? string.Empty : box.mesh[0]); } if (avatarBoxMask) { AtlasHelper.SetShared(avatarBoxMask, box.mesh.Length < 2 ? string.Empty : box.mesh[1]); } }
public override void UpdateItemInfo() { Transform n = transform.Find("item"), s = n.Find("stars"); Util.SetText(gameObject.GetComponent <Text>("item/name"), 9405, m_item.num > 0 ? 6 : 5, itemInfo ? itemInfo.itemName : "null", m_item.num); Util.SetItemInfo(n, itemInfo, item.level, (int)item.num, true, item.star); n.Find("sprite").gameObject.SetActive(false); n.Find("rune").gameObject.SetActive(false); if (itemInfo) { var it = itemInfo.itemType; var idx = it == PropType.Rune || it == PropType.FashionCloth ? 1 : 0; var spriteName = idx >= itemInfo.mesh.Length ? null : itemInfo.mesh[idx]; if (it == PropType.Rune) { var shadowSprite = itemInfo.mesh.Length > 7 ? itemInfo.mesh[6] : null; UIDynamicImage.LoadImage(spriteName, t => { n.Find("rune").SafeSetActive(t); }, false, n.Find("rune")); UIDynamicImage.LoadImage(shadowSprite, t => { n.Find("spriteShadow").SafeSetActive(t); }, false, n.Find("spriteShadow")); } else { UIDynamicImage.LoadImage(spriteName, t => { n.Find("sprite").SafeSetActive(t); }, false, n.Find("sprite")); AtlasHelper.SetShared(n.Find("spriteShadow"), "ui_wish_" + Module_Player.instance.proto, t => { n.Find("spriteShadow").SafeSetActive(true); }); } } var qq = itemInfo ? item.star : 0; for (int i = 0; i < s.childCount; ++i) { var sn = s.Find(i.ToString()); if (sn) { sn.gameObject.SetActive(i < qq); } } Util.ClearChildren(AttRoot); for (var i = 0; i < itemInfo.attributes.Length; i++) { var t = AttRoot.AddNewChild(AttTemplete); Util.SetText(t.GetComponent <Text>("name"), itemInfo.attributes[i].TypeString()); Util.SetText(t.GetComponent <Text>("number"), itemInfo.attributes[i].ValueString()); t.SafeSetActive(true); } //没有属性才显示描述 var desNode = n.GetComponent <Transform>("des"); if (itemInfo.attributes.Length == 0) { Util.SetText(desNode?.GetComponent <Text>("txt"), itemInfo.desc); desNode?.SafeSetActive(true); } else { desNode?.SafeSetActive(false); } }
public void ForingItem(PItem item, bool addLockEvent = true) { if (item == null) { return; } ForingUse(); PropItemInfo prop = ConfigManager.Get <PropItemInfo>(item.itemTypeId); WeaponAttribute weaponAttributes = ConfigManager.Get <WeaponAttribute>(item.itemTypeId); if (!prop) { return; } //名字 CreatureElementTypes elemrntType = weaponAttributes ? (CreatureElementTypes)weaponAttributes.elementType : CreatureElementTypes.Count; if (weaponName) { weaponName.text = prop.itemName; } if (levelTxt) { levelTxt.text = "+" + item.growAttr.equipAttr.strength.ToString(); } elementIcon.SafeSetActive(false); //武器属性 武器图标 if (prop.itemType == PropType.Weapon && prop.subType != (byte)WeaponSubType.Gun) { elementIcon.SafeSetActive(true); AtlasHelper.SetShared(elementIcon, m_element[(int)(elemrntType) - 1]); } int index = Module_Forging.instance.GetWeaponIndex(prop); if (index != -1) { AtlasHelper.SetShared(typeIcon, WEAPON_TYPE_IMG_NAMES[index]); } // //已装备 bool isContains = Module_Equip.instance.currentDressClothes.Contains(item); if (Module_Equip.instance.weapon != null && Module_Equip.instance.offWeapon != null) { if (item.itemId == Module_Equip.instance.weapon.itemId || item.itemId == Module_Equip.instance.offWeapon.itemId) { isContains = true; } } equiped.SafeSetActive(isContains); for (int i = 0; i < stars.Length; i++) { stars[i].SafeSetActive(i < prop.quality); } //锻造等级 m_leftLevel.SafeSetActive(true); var str = (ConsumePercentSubType)item.growAttr.equipAttr.star + ConfigText.GetDefalutString(224, 23); Util.SetText(m_leftLevel, str); if (addLockEvent) { SetLock(item); } }
public void Bind(PMatchProcessInfo info) { Util.SetText(name, info.roleName); Util.SetText(level, Util.Format(ConfigText.GetDefalutString((int)TextForMatType.AwakeStage, 18), info.level)); AtlasHelper.SetShared(career, $"career_icon_{info.roleProto:00}"); }