private void CheckHasUpgrade() { bool has = false; ArkCrossEngine.RoleInfo roleInfo = ArkCrossEngine.LobbyClient.Instance.CurrentRole; for (var i = 0; i < CanUpgradeCount; i++) { bool showTip = false; if (equiparry[i].hasEquip && equiparry[i].level < roleInfo.Level) { ArkCrossEngine.ItemLevelupConfig config = ArkCrossEngine.ItemLevelupConfigProvider.Instance.GetDataById(equiparry[i].level); if (config != null) { float needMoney = config.m_PartsList.Count > i ? config.m_PartsList[i] : 0; if (roleInfo.Money >= needMoney) { has = true; showTip = true; } } } ShowEquipUpgradeTip(i, showTip); } ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_systemnewtip_state_change", "ui", SystemNewTipType.Equip_Upgrade, has); }
void Buttonwhich(int buttonid) { if (buttonid == 2) { ArkCrossEngine.ItemLevelupConfig iluc = ArkCrossEngine.ItemLevelupConfigProvider.Instance.GetDataById(level); ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole; if (iluc != null && ri != null) { int costmoney = iluc.m_PartsList.Count > position ? iluc.m_PartsList[position] : 0; int needmoney = costmoney - (int)(ri.Money); if (needmoney > 0) { float needgold = needmoney * (iluc.m_Rate == float.Epsilon ? 1 : iluc.m_Rate); if (needgold > ri.Gold) { ArkCrossEngine.MyAction <int> fun = Buttonwhichone; ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_show_dialog", "ui", ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(123), "YES", null, null, fun, false); } else { ArkCrossEngine.LogicSystem.PublishLogicEvent("ge_upgrade_item", "lobby", position, ID, true); } } } } }
public void ItemUpdate() { ArkCrossEngine.ItemLevelupConfig iluc = ArkCrossEngine.ItemLevelupConfigProvider.Instance.GetDataById(level); ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole; if (iluc != null && ri != null) { int costmoney = iluc.m_PartsList.Count > position ? iluc.m_PartsList[position] : 0; if (costmoney > ri.Money) { ArkCrossEngine.MyAction <int> fun = Buttonwhich; ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_show_dialog", "ui", ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(122), ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(140), null, null, null /*fun*/, false); } else { ArkCrossEngine.LogicSystem.PublishLogicEvent("ge_upgrade_item", "lobby", position, ID, false); } } }
public void SetItemProperty(int itemid, int pos, int itemlevel, int propertyid, bool isUpgrade = false, bool hideBtnArea = false) { ShowActionButton(true); isCompareUI = false; ID = itemid; property = propertyid; position = pos; level = itemlevel; UnityEngine.Transform tfc = gameObject.transform.Find("SpriteBackLeft"); if (tfc != null) { NGUITools.SetActive(tfc.gameObject, false); } tfc = transform.Find("SpriteBackRight"); if (tfc != null) { tfc.localPosition = new UnityEngine.Vector3(0.0f, 0.0f, 0.0f); tfc = tfc.Find("line/Label"); if (tfc != null) { UILabel ul = tfc.gameObject.GetComponent <UILabel>(); if (ul != null) { ul.text = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(152); ul.color = new UnityEngine.Color(1.0f, 0.52549f, 0.18039f); } } } tfc = transform.Find("SpriteBuy"); if (tfc != null) { NGUITools.SetActive(tfc.gameObject, false); } tfc = transform.Find("SpriteSale"); if (tfc != null) { NGUITools.SetActive(tfc.gameObject, false); } tfc = transform.Find("SpriteInlay"); if (tfc != null) { // UILabel ul = tfc.gameObject.GetComponent<UILabel>(); // if (ul != null) { // ul.text = "镶嵌"; // } NGUITools.SetActive(tfc.gameObject, false); } tfc = transform.Find("SpriteUpdate/Label"); if (tfc != null) { UILabel ul = tfc.gameObject.GetComponent <UILabel>(); if (ul != null) { ul.text = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(121); } } tfc = transform.Find("SpriteUpdate/Up/money"); if (tfc != null) { UILabel ul = tfc.gameObject.GetComponent <UILabel>(); if (ul != null) { ArkCrossEngine.ItemLevelupConfig iluc = ArkCrossEngine.ItemLevelupConfigProvider.Instance.GetDataById(level); if (iluc != null) { ul.text = (iluc.m_PartsList.Count > position ? iluc.m_PartsList[position] : 0).ToString(); } else { ul.text = "0"; } } } tfc = transform.Find("SpriteUpdate"); if (tfc != null) { UIButton ub = tfc.GetComponent <UIButton>(); if (/*us != null &&*/ ub != null) { ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole; if (itemlevel >= ri.Level) { ub.isEnabled = false; if (spLevelUp != null) { spLevelUp.color = UnityEngine.Color.grey; } } else { ub.isEnabled = true; if (spLevelUp != null) { spLevelUp.color = UnityEngine.Color.white; } } } } ArkCrossEngine.ItemConfig ic = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(itemid); tfc = transform.Find("SpriteUpdate"); if (tfc != null && ic != null) { if (!ic.m_CanUpgrade) { NGUITools.SetActive(tfc.gameObject, false); //hideBtnArea = true; } else { NGUITools.SetActive(tfc.gameObject, !hideBtnArea); } } tfc = transform.Find("SpriteBackRight/Sprite"); if (tfc != null) { NGUITools.SetActive(tfc.gameObject, !hideBtnArea); } SetItemHeadProperty(itemid, itemlevel, propertyid, transform.Find("SpriteBackRight"), isUpgrade); CompareProperty(0, 0, 0, 0, 0, 0); CalculateUIPosition(transform.Find("SpriteBackRight")); }